Agent2Agent ProtocolBeta
Learn what the Agent2Agent (A2A) protocol is, how it differs from the Model Context Protocol (MCP), and when to use it with Haystack Enterprise Platform.
What Is the Agent2Agent Protocol?
A2A is an open protocol that lets AI agents discover each other and exchange messages over a standard JSON-RPC interface. Instead of building a custom integration for every agent, a client reads a description of the agent and then calls it in a standard way.
Key Concepts
- Agent card: A JSON document that describes an agent. It contains the agent's name, description, the URL to call, and the security scheme it expects. Clients fetch it from a well-known endpoint to find out how to reach the agent.
- Message: A request that a client sends to an agent. It consists of one or more parts, such as text.
- Task: The unit of work an agent creates to handle a message. In Haystack Enterprise Platform, a task exists only for the duration of a single request.
The Workflow
- The client fetches the agent card for the pipeline or deployment it wants to call.
- The client reads the interface URL and the security scheme from the card.
- The client sends a
SendMessageorSendStreamingMessagerequest with its bearer credential. - The agent runs the pipeline and returns the response, either as a single result or as a stream.
A2A and MCP
Both protocols let other AI applications use your pipelines, but they serve different purposes:
- MCP exposes your pipelines as tools that an AI assistant calls. You create one MCP server for a workspace and enable each pipeline as a tool.
- A2A exposes each eligible pipeline or deployment as its own agent with its own agent card. Another agent talks to it by sending messages.
Choose MCP when an AI coding assistant, such as Cursor or Claude Code, needs your pipelines as tools. Choose A2A when your pipeline should act as an agent that other agents discover and call.
A2A in Haystack Enterprise Platform
Haystack Enterprise Platform supports A2A for deployed pipelines that produce a chat or generative output and for runnable deployments. Requests are stateless: each request is handled on its own, and there's no task retrieval, continuation, file or structured-data input, or push notifications. A2A support is disabled by default and available on request.
For instructions, see Use Your Pipelines as A2A Agents.
Related Information
Was this page helpful?