> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-docs-new-messaging-and-agent-tasks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Build & Deployment Optimizer

> Ready-made Agent Task that proposes faster, cheaper build and deployment configurations

<Warning>
  **Alpha.** Agent Tasks is in early development and not yet generally available. Capabilities and setup will change before release.
</Warning>

## Overview

Identifies build and deployment optimization levers and their expected gain, then opens a PR with the proposed change and/or updates the build configuration in Qovery directly. It never merges a fix on its own.

## How It Works

To find concrete ways to make builds and deployments faster and cheaper, the agent:

1. Inspects the service's build setup: Dockerfile, dependency installation, layer caching, image size, and the build/deploy configuration in Qovery.
2. Identifies optimization levers, for example better layer ordering and caching, multi-stage builds, smaller base images, pruning unused dependencies, or parallelisable steps.
3. For each lever, estimates the expected gain (build time, image size, or cost) and the risk.
4. Opens a PR with the proposed changes to the build configuration, and/or updates the build configuration in Qovery directly.
5. Summarises what it changed, the expected gain, and anything that needs a human decision. It never merges, the human always stays the gate.

## Setting It Up

* **Context**: add the service's Git repository so the agent can inspect the Dockerfile and build setup.
* **Access**: add the Qovery MCP server manually (`https://mcp.qovery.com/mcp`). A read-only [API Policy Token](/configuration/organization/api-policy-token) is enough to read the build/deploy configuration and propose changes via PR. Use one with write permissions instead if the agent should update Qovery directly.
* **Resources and environment variables**: see [Configuration](/configuration/agent-tasks/overview#configuration) for the general settings shared by every agent task.

## Triggering It

Add a schedule trigger, for example weekly, to periodically review build performance, or trigger it from a webhook. See [Automations](/configuration/agent-tasks/overview#automations) for how triggers and outputs work in general.
