Typescript sdk

Add External Agents to your Agent

Copy page

Learn 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 themselves and used from other platforms.

Learn more about A2A:

Examples platforms that expose Agents in A2A-format:

PlatformTypeDescription
LangGraphNativeBuilt-in A2A endpoint & Agent Card for graph agents.
Google Agent Development Kit (ADK)NativeOfficial guide to build agents that expose/consume A2A.
Microsoft Semantic KernelNative“SK now speaks A2A” with sample to expose compliant agents.
Pydantic AINativeConvenience method to publish a Pydantic AI agent as an A2A server.
AWS Strands Agents SDKNativeA2A support in Strands for cross‑platform agent communication.
CrewAIWith AdapterUse the A2A Python SDK to serve a CrewAI agent over A2A.
LlamaIndexWith AdapterExample Workflows app exposed via A2A (agent + card).
Note
Note

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

Creating an External Agent

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

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.

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.

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.

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}}" } })],
});
ParameterTypeRequiredDescription
idstringYesStable agent identifier used for consistency and persistence
namestringYesHuman-readable name for the external agent
descriptionstringYesBrief description of the agent's purpose and capabilities
baseUrlstringYesThe A2A endpoint URL where the external agent can be reached
credentialReferenceCredentialReferenceNoReference to dynamic credentials for authentication. See Credentials for details