# Add External Agents to your Agent (/typescript-sdk/external-agents)

Learn how to configure and use external agents using the A2A protocol



<SkillRule id="external-agents-overview" skills="typescript-sdk" title="External Agents Overview" description="How to configure and use external agents using the A2A protocol">
  External agents let you integrate agents built outside of Inkeep (using other frameworks or platforms) into your Agent. They communicate over the A2A (Agent‑to‑Agent) protocol so your Inkeep sub-agents can delegate tasks to them as if they were native. Note that Inkeep Agents are available via an [A2A endpoint](/talk-to-your-agents/a2a) themselves and used from other platforms.

  Learn more about A2A:

  * A2A overview on the Google Developers Blog: [A2A — a new era of agent interoperability](https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/)
  * A2A protocol site: [a2a.how](https://a2a.how/)

  Examples platforms that expose Agents in A2A-format:

  | Platform                                                                                                                      | Type         | Description                                                         |
  | ----------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------- |
  | [LangGraph](https://docs.langchain.com/langgraph-platform/server-a2a)                                                         | Native       | Built-in A2A endpoint & Agent Card for graph agents.                |
  | [Google Agent Development Kit (ADK)](https://google.github.io/adk-docs/a2a/)                                                  | Native       | Official guide to build agents that expose/consume A2A.             |
  | [Microsoft Semantic Kernel](https://devblogs.microsoft.com/foundry/semantic-kernel-a2a-integration/)                          | Native       | “SK now speaks A2A” with sample to expose compliant agents.         |
  | [Pydantic AI](https://ai.pydantic.dev/a2a/)                                                                                   | Native       | Convenience method to publish a Pydantic AI agent as an A2A server. |
  | [AWS Strands Agents SDK](https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/agent-to-agent/) | Native       | A2A support in Strands for cross‑platform agent communication.      |
  | [CrewAI](https://codelabs.developers.google.com/intro-a2a-purchasing-concierge)                                               | With Adapter | Use the A2A Python SDK to serve a CrewAI agent over A2A.            |
  | [LlamaIndex](https://a2aprotocol.ai/blog/a2a-samples-llama-index-file-chat-openrouter)                                        | With Adapter | Example Workflows app exposed via A2A (agent + card).               |

  <Note>
    Any agent that exposes an A2A‑compatible HTTP endpoint can be integrated by providing its `baseUrl` plus headers/auth (static or dynamic).
  </Note>

  ## Creating an External Agent

  Every external agent needs a unique identifier, name, description, base URL for A2A communication, and optional authentication configuration:

  ```typescript
  import { externalAgent } from "@inkeep/agents-sdk";

  const technicalSupportAgent = externalAgent({
    id: "technical-support-agent",
    name: "Technical Support Team",
    description: "External technical support specialists for complex issues",
    baseUrl: "https://api.example.com/agents/technical-support", // A2A endpoint
  });
  ```

  ## External Agent Relationships

  Agents can be configured to delegate tasks to external agents.

  ```typescript
  import { subAgent, agent } from "@inkeep/agents-sdk";
  import { myExternalAgent } from "./external-agents/exernal-agent-example";

  // Define the customer support sub-agent with delegation capabilities
  const supportSubAgent = subAgent({
    id: "support-agent",
    name: "Customer Support Sub-Agent",
    description: "Handles customer inquiries and escalates technical issues",
    prompt: `You are a customer support sub-agent that handles general customer inquiries.`,
    canDelegateTo: () => [myExternalAgent],
  });

  // Create the customer support agent with external agent capabilities
  export const supportAgent = agent({
    id: "customer-support-agent",
    name: "Customer Support System",
    description: "Handles customer inquiries and escalates to technical teams when needed",
    defaultSubAgent: supportSubAgent,
    subAgents: () => [supportSubAgent],
  });
  ```

  ## External Agent Options

  Configure authentication by providing a [credential reference](/typescript-sdk/credentials/overview).

  ```typescript
  const myExternalAgent = externalAgent({
    // Required
    id: "external-support-agent",
    name: "External Support Agent", // Human-readable agent name
    description: "External AI agent for specialized support", // Agent's purpose
    baseUrl: "https://api.example.com/agents/support", // A2A endpoint URL
    // Optional - Credential Reference
    credentialReference: myCredentialReference,
  });
  ```

  When delegating to an external agent, you can specify headers to include with every request to the external agent.
  These headers can be dynamic variables that are [resolved at runtime](/typescript-sdk/headers).

  ```typescript
  const supportSubAgent = subAgent({
    id: "support-agent",
    name: "Customer Support Sub-Agent",
    description: "Handles customer inquiries and escalates technical issues",
    prompt: `You are a customer support sub-agent that handles general customer inquiries.`,
    canDelegateTo: () => [myExternalAgent.with({ headers: { Authorization: "Bearer {{headers.Authorization}}" } })],
  });
  ```

  | Parameter             | Type                | Required | Description                                                                                                           |
  | --------------------- | ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
  | `id`                  | string              | Yes      | Stable agent identifier used for consistency and persistence                                                          |
  | `name`                | string              | Yes      | Human-readable name for the external agent                                                                            |
  | `description`         | string              | Yes      | Brief description of the agent's purpose and capabilities                                                             |
  | `baseUrl`             | string              | Yes      | The A2A endpoint URL where the external agent can be reached                                                          |
  | `credentialReference` | CredentialReference | No       | Reference to dynamic credentials for authentication. See [Credentials](/typescript-sdk/tools/credentials) for details |
</SkillRule>