> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/workflow-guides/integrate-an-agent.md).

# Integrate an agent

Connect a built agent to a Qore app or an external app.

For a Qore app, use its **Agents** tab. For an external app, use the agent's **Export/Integrate** options.

## Prerequisites

{% hint style="info" %}
You need a built and tested agent. If needed, first [create an agent](/workflow-guides/create-an-agent.md).

You also need the target app. A Qore app build must be **finished**. You cannot attach agents during generation.
{% endhint %}

## Attach an agent to a Qore app

{% stepper %}
{% step %}

### Open the app's Agents tab

Open the app in **App Builder**. Select the **Agents** tab in the top bar.

You see **"Make Your App Smarter with Agents"** and two options.

<figure><img src="/files/QjBL6bnYnhST7QsGrOQe" alt=""><figcaption><p>The Agents tab in the App Builder, offering Build an Agent or Attach an Existing Agent</p></figcaption></figure>
{% endstep %}

{% step %}

### Attach an existing agent

Under **Attach an Existing Agent**, click **+ Attach Agents**. Select a prebuilt agent from the list.

{% hint style="warning" %}
If you see **"Cannot attach agents while application generation is in progress,"** wait for the app's build to finish (or Skip the pending build step), then try again.
{% endhint %}

<figure><img src="/files/lgg1PMijxaXNMyQJp8kU" alt=""><figcaption><p>The Attach Agents dialog, listing prebuilt agents to connect</p></figcaption></figure>
{% endstep %}

{% step %}

### (Or) build a new agent for the app

Choose **Build an Agent → Visit Agent Builder** to create a custom agent. Then return and attach it.
{% endstep %}

{% step %}

### Test end to end

Preview the app and confirm the agent responds and uses its knowledge and skills as expected.
{% endstep %}
{% endstepper %}

## Embed an agent in an external app

Use this path when the app lives outside Qore.

From **Manage Agent → Export/Integrate Agent**, choose the lowest-level option that fits your architecture:

* **Embed Agent** — an HTML/JavaScript widget you paste into a web page. Best for web apps where the widget manages its own conversation state. Uses the agent's Authentication (Widget) key and is gated by **Whitelisted Domains**.
* **API Integration** — endpoints and credentials to call the agent as an HTTP API. Best for server-side, mobile, or non-web apps.
* **Headless Agent Integration** — server-to-server invocation with no platform UI. Best when the agent is one part of a larger pipeline.

{% hint style="info" %}
Before generating an embed or API integration, set the agent's **Authentication** keys and **Whitelisted Domains** — a live widget reaches the agent through whatever auth and domain rules you've set.
{% endhint %}

## Verify

For a Qore app, confirm the agent responds in the app preview. Confirm it uses its knowledge and skills as expected.

For an external app, confirm it responds from the external surface. It only responds where your auth and domain rules allow.

## Common issues

* **"Cannot attach agents while application generation is in progress."** Finish or Skip the app's current build step, then attach.
* **The embedded widget won't load.** Check the host domain is whitelisted and the widget uses a valid Authentication key.
* **API calls are rejected.** Reconfirm the credentials from **API Integration** match the agent's Authentication keys.

## Related pages

* [Apps & Services](/agent-builder/build/apps-and-services.md)
* Build the agent first: [Create an agent](/workflow-guides/create-an-agent.md)
* Build the host app: [Create an app](/workflow-guides/create-an-app.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uptiq.ai/workflow-guides/integrate-an-agent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
