# Embed agents in an app

> Add agents to an app you built. They launch from the interface, inherit its connections and context, and put the result back where you work.

Apps present your data; embedded agents act on it. An embedded agent lives inside an app you built: it launches from a button in the interface, inherits the app's connected systems and the record you're looking at, and delivers its result back into the page. Where workflows run in the background on schedules and triggers, embedded agents work in line, while you watch.

The video builds one into a support queue app that unifies Zendesk, HubSpot, and a production database: a **Draft Reply** agent on every ticket that briefs the issue and writes a response you can send with one click.

## Add an agent

<Steps>
  <Step>
    Open your app and start a new thread in the chat panel. If you don't have an
    app yet, start with [Build an app](/getting-started/build-an-app).
  </Step>
  <Step>
    Describe the agent: where it should appear, what context it should gather,
    and what it should produce. From the video: "Add an agent visible on each
    detail page. It should gather context from all the systems connected to this
    application, plus my Gmail for past interactions, then give me a brief of
    the issue and draft a response I can send to Zendesk in one click."
  </Step>
  <Step>
    Submit and let the author agent build. A few minutes later the agent's
    control is live in your interface.
  </Step>
</Steps>

<Callout type="tip">
  Spell out placement, inputs, and output. "An agent on each ticket page that
  reads Zendesk, HubSpot, and Gmail, then drafts a reply" beats "add an AI
  assistant."
</Callout>

## Run it

<Steps>
  <Step>
    Open a record and click the agent's button. Every launch asks you to confirm
    before it starts.
  </Step>
  <Step>
    The agent runs in place: it works through the connected systems with the
    context of the record you launched it from, and the result lands in the
    interface when it finishes.
  </Step>
</Steps>

Every embedded agent also shows up in the app's **Agents** tab: live activity while a run is going, the full run history, and the agent's instructions and settings. If a run pauses to ask you something, the tab shows **Needs input**.

<Callout type="note">
  Agent runs use the app owner's connected accounts. Anyone you share the app
  with can launch them, and every run records who triggered it.
</Callout>

## Refine it

<Steps>
  <Step>
    Ask for interface changes in the chat panel, like moving the agent's
    response into its own tab in the detail view.
  </Step>
  <Step>
    Tune the agent itself from the **Agents** tab: edit its instructions or
    change its model, no rebuild needed. The next run picks up your edits.
  </Step>
</Steps>

<Callout type="tip">
  One app can carry several agents. A support app might pair the reply drafter
  with an investigator that digs into billing history, each launched from the
  spot in the interface where its work starts.
</Callout>