# Agent-to-Agent Links

Build a team of specialist AVCodex agents that automatically hand off questions to each other. One front-line agent. A roster of specialists behind it. The user sees one conversation.

Agent-to-Agent Links let one agent delegate to specialist agents in your workspace. Your main agent acts as the orchestrator. When a user asks something a specialist handles better, the orchestrator passes the question over and folds the response back into the answer.

> **Note:** Agent links require a Builder plan or higher.

## How It Works

1. You link specialist agents to your main agent.
2. Linked agents register automatically as tools during the user chat.
3. When the main agent decides a specialist would answer better, it calls that specialist.
4. The specialist responds using its own system prompt, model, and knowledge base.
5. The main agent folds the specialist's response into its reply.

The user sees a single coherent conversation. They never need to know multiple agents are working behind the curtain.

## Setting Up Agent Links

**1. Open Agent Tools**

Open your agent's **Build** page, click the **Connect** tab, and find the **Agent Tools** card.

**2. Add Linked Agents**

Click **Add agent tools**. A modal lists every agent in your workspace. Click one to link it.

**3. Test It**

In the chat preview, ask a question that falls inside a specialist's lane. You should see the main agent delegate and incorporate the response.

To remove a linked agent, click the **x** next to its name in the Agent Tools list.

## What Gets Passed to Specialists

When a linked agent is called:

| Passed | Not Passed |
|--------|-----------|
| The specific question or request | The user's conversation history |
| Specialist's system prompt and model | User memory or profile |
| Specialist's knowledge base (RAG) | Uploaded files |
| Web search (if enabled on the specialist) | Billing or subscription info |

Each call is a single turn. The specialist answers once and returns the result. No multi-turn back-and-forth between agents.

## Delegation Depth

Linked agents can have their own linked agents, supporting multi-hop delegation:

- **Depth 0:** user talks to your main agent.
- **Depth 1:** main agent calls a specialist.
- **Depth 2:** that specialist calls one of its linked agents.
- **Depth 3:** maximum nesting depth. No further delegation.

This prevents infinite recursion while still supporting reasonable multi-hop chains.

## Use Cases

| Scenario | Setup |
|----------|-------|
| **AV helpdesk triage** | A front-line helpdesk agent routes Crestron control system questions to a Crestron-programmer agent, Q-SYS Lua questions to a QSC specialist, network and AV-over-IP questions to a network specialist. |
| **Multi-manufacturer expertise** | A design engineer's research agent delegates Crestron spec questions to a Crestron-docs agent, Q-SYS to a Q-SYS agent, Biamp to a Biamp agent, Shure to a Shure agent. |
| **Department delegation** | An internal AV ops agent sends RFP questions to a proposal-writing agent, programming questions to a code-review agent, and dispatch questions to a scheduling agent. |
| **Skill-based routing** | A sales-engineering agent asks the product-knowledge agent for the latest model numbers before composing the customer-facing response. |

## Billing

When a linked agent is called, token usage is billed to the **source agent's organization** (the agent the user is talking to). There is no extra fee for agent-to-agent calls. It is part of your standard LLM token billing.

## Tips

- **Write clear descriptions** for your specialist agents. The main agent uses the description to decide when to delegate. Be specific. "Crestron SIMPL# Pro programmer assistant for control system code review and macro generation" beats "programming agent."
- **Keep specialists focused.** A Q-SYS Lua specialist with a tailored system prompt and a Q-SYS knowledge base outperforms a general-purpose programmer agent.
- **Test delegation patterns.** In the chat preview, ask questions that should trigger delegation and confirm the right specialist picks them up.

## Troubleshooting

**Agent not delegating?**
- Confirm the specialist is linked in the Connect tab.
- Verify the specialist's description names the specialty clearly.
- The main agent may answer itself if it already has the knowledge.

**Wrong specialist being called?**
- Tighten specialist descriptions so each one stakes out a clear lane.
- Add explicit delegation guidance to your main agent's system prompt ("If the question involves Q-SYS, hand it to the Q-SYS specialist").

**Slow responses?**
- Each delegation adds a round trip.
- Decide whether the specialist adds enough value to justify the latency.
- Avoid depth 2 to 3 nesting unless you need it.

*AVCodex · Your AV expertise. Amplified by AI.*
