> For the complete documentation index, see [llms.txt](https://docs.orbitfin.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orbitfin.ai/orbit-api-reference/a2a/4.-integration-example/4.1-custom-agent-integration-example.md).

# 4.1 Custom Agent Integration Example

In this method, you build your own "outer Agent" with reasoning capabilities — it autonomously determines whether the user's request needs to call Agent Builder, what to call, and how to present the results.

To make it easy for you to get started directly, we provide a standalone reference SDK that does not depend on any internal code, containing a complete reference implementation of an outer dispatcher agent and a visual chat page.

**Step One: Download the SDK**

Download URL: <https://oassets.orbitfin.ai/orbit-common-resources/agent-builder-a2a-sdk/agent-builder-a2a-sdk.zip>

It is ready to use after extraction. For detailed installation dependencies and credential configuration steps, please refer to the README.md (in English) inside the archive, which fully explains:

* How to install dependencies (pip install -r requirements.txt)
* The difference and configuration methods between the two sets of credentials — your own OpenAI API Key (which drives the outer dispatcher agent's own reasoning capabilities, configured in the .env file) and Agent Builder's API Key (used for identity authentication when calling Agent Builder itself, filled in the web settings panel)
* The startup command (python server.py)

**Step Two: Open the Page, Connect to Agent Builder**

After successful startup, access <http://localhost:8787> in the browser. On first open, the "Connection Settings" panel will pop up automatically. Fill in Agent Builder's API Key, click "Test Connection", and after success it will display Agent Builder's name, function description, and the number of capabilities (Skills). Click "Save" to enter the chat interface.

<figure><img src="/files/9WfmFQ4LVjVbo8DovbQn" alt=""><figcaption></figcaption></figure>

(Connection Settings panel — fill in Agent Builder's API Key)

<figure><img src="/files/R3ts3F7rg9L7EIl4eg5h" alt=""><figcaption></figcaption></figure>

(Test Connection successful — displays Agent Builder's real name, description, and number of capabilities)

**Step Three: Start the Conversation**

Now you can chat directly with the outer dispatcher agent, and it will determine on its own whether to call Agent Builder. A few example questions:

* Query existing Agents: "What agents do I have?" — you should see the call actually happen (a "Called Agent Builder via A2A" label appears below the reply), and a new record synchronously appears in the call records panel on the left
* Create a new Agent: "Help me build an agent that analyzes NVIDIA's supply chain risk." — Agent Builder will guide you through the framework, fields, data source, report frequency, and analysis target steps; reply continue at each step to advance to the next
* Verify calls are not abused: "What can you help me with?" — for such a question that clearly does not need Agent Builder, ideally it should not trigger a call, no new entry will be added to the call records, and this can be used to test whether the outer Agent's judgment is reasonable

<figure><img src="/files/nCipiJrH7d3fuSyLlHfs" alt=""><figcaption></figcaption></figure>

(Real conversation effect — after the outer Agent determines a call is needed, it obtains Agent Builder's real reply through the A2A protocol (here it is querying the list of existing Agents), with a Called Agent Builder via A2A label below the reply)

<figure><img src="/files/mAbDuO4JuvrvnkJIfaPx" alt=""><figcaption></figcaption></figure>

(A2A call records panel on the left — every A2A call that actually occurs is displayed here in real time, including the called capability, raw parameters, and raw return results, used to verify that this is real collaboration between two independent systems, rather than a pre-written effect)

**Frequently Asked Questions (Related to SDK Usage)**

* Prompt "Unable to connect to Agent Builder": Check whether the API Key in the settings panel is correct.
* The outer Agent does not call Agent Builder at all: Check whether the OPENAI\_API\_KEY in .env is valid — the outer Agent's own reasoning step depends on it; after modifying .env, you need to restart server.py for it to take effect.
* Everything you say triggers a call, including clearly irrelevant questions: This is a reflection of the outer dispatcher agent's real judgment capability, not a bug in this SDK — this demonstration itself is designed to observe how accurately an LLM, without additional fine-tuning, can judge the matter of "whether or not to call".
