> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Builder

> Build, explore, and ship changes to your agent in natural language inside PolyAI Studio. Every change runs on a branch you can review before merging.

Agent Builder is the chat panel on the Agent Studio home screen. Describe what you want, it reads your project and proposes a plan, you approve or revise. Nothing changes until you approve. Every edit lands on a branch, not on the live agent.

<Note>
  **Availability (Beta).** Agent Builder is available to **project admins** on enterprise clusters. During the Beta, non-admin members on a project can't access Agent Builder — permissions will become more granular over time. See [Role permissions](/user-management/access-control-scope) for what each role can do. Bug reports and feedback are welcome in your usual PolyAI support channel.
</Note>

## How to ask

A few patterns produce noticeably better drafts:

* **State the business rule, not just the action.** *"Add a refund flow with a 30-day window, original payment method only"* gets you a usable plan. *"Add a refund flow"* gets you something you'll need to rewrite.
* **One unit of work per request.** One flow, one topic, one set of related changes. Easier to review and roll back.
* **Name what to keep.** On rewrites and cleanups, call out anything that should stay. Or ask for a plan first and read it before approving.

More patterns and copy-paste examples in the [prompting guide](/agent-builder/prompting).

## What it can change

Agent Builder operates on the same building blocks you'd edit by hand: flows, topics, entities, functions, integrations, handoffs, and agent settings. For any of these, it can read your current config, propose changes, and write them to a branch.

| Building block     | Examples of what the assistant can do                                                  |
| ------------------ | -------------------------------------------------------------------------------------- |
| **Flows**          | Create new flows; restructure steps, transitions, and conditions; rewrite step prompts |
| **Topics**         | Create knowledge-base topics from a description; update wording or scope               |
| **Entities**       | Define entities and their values; update entity definitions used by flows              |
| **Functions**      | Wire flows to existing functions; describe and create new function specs               |
| **Integrations**   | Configure integrations and connect them to flows                                       |
| **Handoffs**       | Add transfer-to-human steps with the right conditions and metadata                     |
| **Agent settings** | Set or update purpose, role, and personality                                           |

Heavy requests get broken down into smaller reasoning steps under the hood. You don't manage those directly; they appear inline in the conversation log.

## Modes

| Mode      | What it does                                 | When to use it                                                       |
| --------- | -------------------------------------------- | -------------------------------------------------------------------- |
| **Agent** | Plans a change, then applies it on approval. | Default for build work.                                              |
| **Plan**  | Plans a change but doesn't apply it.         | Comparing approaches before committing.                              |
| **Ask**   | Read-only questions about your project.      | *"What does this flow do?"*, *"Why did containment drop yesterday?"* |

## What to expect

Agent Builder edits the branch you're on. It doesn't publish or promote between [environments](/environments-and-versions/introduction); merging and promotion stay manual.

Business knowledge comes from you. The assistant won't invent prices, hours, policies, or names. If those are missing from your project, the plan surfaces them as questions.

Every change is reviewable. Each applied edit produces a tracked-changes summary you can inspect, tweak, or revert before merging back to `Main`.

## Limits

Agent Builder has a fair-use limit so usage stays predictable. The size and reset cadence are managed by PolyAI on your account. Current usage shows next to the message input.

When you hit the limit, the assistant pauses until the next reset. A rest card replaces the input, and manual editing in Studio still works normally.

[Usage and limits →](/agent-builder/usage-and-limits)

## A full session, step by step

<Accordion title="The full tour: chat → ask → branch → plan → approve → merge">
  The steps you'll repeat for most build work, with screenshots from a real session.

  <Steps>
    <Step title="Start from the home screen">
      The chat panel opens with a prompt input and templates grouped by intent: **Build**, **Test**, **Ask**, and **Analyze**. Pick a suggestion, edit it, or type your own request. The **Agent wizard** entry under Build kicks off a guided builder for brand-new agents from a company URL. The usage indicator next to the send button shows your current spend.

      <Frame caption="Home screen with Build, Test, Ask, and Analyze templates">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/home-templates.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=8ca9da58648f8b27167ad173e0e1ac97" alt="Agent Builder home screen with prompt templates and usage indicator" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2564" height="1616" data-path="images/agent-builder/home-templates.png" />
      </Frame>
    </Step>

    <Step title="Ask about your agent">
      For exploration, the assistant reads your agent settings, flows, topics, entities, and functions, then replies with answers grounded in your project. The tools it runs (`read`, `explore`, and so on) appear inline before the final message.

      <Frame caption="Ask mode — answers grounded in your project">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/ask-mode-response.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=c3cb842c3f5b3fbda6eaa29a329be1cb" alt="Agent Builder response showing a project-specific Agent Overview" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2552" height="1622" data-path="images/agent-builder/ask-mode-response.png" />
      </Frame>
    </Step>

    <Step title="Make a change on a branch">
      The first time you ask for a change, Agent Builder creates a branch automatically and names it after the request. `Main` stays untouched while the assistant works on the branch. The branch chip replaces `Main` in the top-left for the rest of the session.

      <Frame caption="A new branch is created automatically — Main stays untouched">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/branch-created.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=02e4efb1b6d36a4d8c0c9e07d8a3550c" alt="Agent Builder creating a branch before making changes" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2030" height="796" data-path="images/agent-builder/branch-created.png" />
      </Frame>
    </Step>

    <Step title="Answer any clarifying questions">
      If your request is ambiguous, the assistant asks a clarifying multiple-choice question before it starts planning. Pick an option, type your own answer, or **Skip** to let the assistant choose.

      <Frame caption="Pick an option, type your own answer, or Skip">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/clarifying-question.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=60c3bd8440fbcf56520d3450bce18501" alt="Agent Builder asking a clarifying multiple-choice question with a Skip option" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2534" height="1618" data-path="images/agent-builder/clarifying-question.png" />
      </Frame>
    </Step>

    <Step title="Approve or revise the plan">
      Once it has enough context, the assistant presents a plan card with **Approve** and **Reject** buttons. **Nothing is written until you approve.** Click the plan card to expand the full breakdown. From the expanded view you can write feedback for the assistant to revise the plan, then **Send** to re-plan.

      <Frame caption="Expand the plan to review details or write feedback">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/approve-flow-revise.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=f4b25354f4a65cd6aad979dae84de658" alt="Expanded plan modal with a feedback textarea and Cancel/Send buttons" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2548" height="1626" data-path="images/agent-builder/approve-flow-revise.png" />
      </Frame>

      After you send revisions, the plan is marked **Changes requested** and your feedback is shown above the regenerated plan.

      <Frame caption="Your feedback is shown above the regenerated plan">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/approve-flow-revised.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=8fed6dabf7077c18876d7a178bb3b069" alt="Plan card after revisions with Changes requested pill and feedback block" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2552" height="1242" data-path="images/agent-builder/approve-flow-revised.png" />
      </Frame>

      When you **Approve**, the changes apply to your branch. Every applied edit is summarized in a **changes made** card.

      <Frame caption="Changes applied to the branch with a summary of additions">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/change-applied.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=a25f5f6f3eafcb24842336e07519d41c" alt="Approved plan card with a Quick Edit summary listing the additions made" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2018" height="1066" data-path="images/agent-builder/change-applied.png" />
      </Frame>
    </Step>

    <Step title="Merge to main">
      The **Merge** button in the top-right opens a dialog where you can add an optional message, then ship the branch back to `Main`. From there, your changes flow through the normal [Sandbox → Live](/environments-and-versions/introduction) pipeline.

      <Frame caption="Merge the branch back to Main when you're ready">
        <img src="https://mintcdn.com/polyai/PeTdaYpOcRWx5wbp/images/agent-builder/merge-dialog.png?fit=max&auto=format&n=PeTdaYpOcRWx5wbp&q=85&s=f47c6ff09bb961934120fec9e6a635b1" alt="Merge to main branch dialog with an optional message" style={{ maxWidth: '720px', width: '100%', margin: '0 auto', display: 'block' }} width="2556" height="1604" data-path="images/agent-builder/merge-dialog.png" />
      </Frame>
    </Step>
  </Steps>
</Accordion>

## Conversations and history

Chats are saved in the **History** panel on the left, scoped to the project. You can resume any past chat, switch between concurrent ones, or archive what you're not using.

The assistant remembers everything in the current chat. Follow-ups like *"now do the same for the cancellation flow"* work without repeating context. Drag in transcripts, policy docs, or screenshots to attach files; the assistant reads them as part of the request.

Start a new chat when switching to unrelated work. Each chat carries its full history as context, so very long chats can slow responses or trigger automatic summarization.

## Related pages

<CardGroup cols={2}>
  <Card title="Prompting guide" icon="message-pen" href="/agent-builder/prompting">
    Patterns for getting consistently good results.
  </Card>

  <Card title="Usage and limits" icon="gauge" href="/agent-builder/usage-and-limits">
    Your fair-use allowance, reset cadence, and what to do when you hit it.
  </Card>
</CardGroup>

<CardGroup cols={3}>
  <Card title="Flows" icon="diagram-project" href="/flows/introduction">
    The building blocks the assistant uses to structure conversations.
  </Card>

  <Card title="Managed topics" icon="book" href="/managed-topics/introduction">
    Knowledge the assistant reads from and writes to.
  </Card>

  <Card title="Deployments" icon="layer-group" href="/environments-and-versions/introduction">
    Promote the assistant's branches from `Main` to Live.
  </Card>
</CardGroup>
