Benefits
- Discovery. Your agent publishes a card with its name, description, skills, and supported authentication methods. Orchestrators read it to decide which tasks fit the agent.
- Delegation. An orchestrator sends the agent one message and gets one answer back, over a standard transport, without an Algolia-specific client.
- Reuse. The same published agent serves your chat widget through
/completionsand your orchestrator through A2A. Model, guardrails, and caching work the same way on both. For tool limitations, see Design your agent for A2A. A2A requests and responses appear in your conversations and analytics.
Request flow
Each message request to Agent Studio starts an independent turn: one text message from the client followed by one text reply from the agent. Agent Studio doesn’t support conversation continuation, task lifecycles, streaming, or push notifications through A2A.Enable A2A on an agent
1
Publish the agent
A2A only serves published agents.
Publish your agent from the Agent Studio dashboard before you enable A2A.
To learn more, see Get started with the Agent Studio dashboard.
2
Turn on A2A
Select your agent in the Agent Studio dashboard.In Advanced settings, turn on Agent-to-agent (A2A) and click Configure.
Copy the agent card URL to use in your orchestrator.
3
Describe the agent for orchestrators
In the same panel, write the card content that orchestrators read to route tasks:
- Name and description. They default to the agent’s own name and description. Override them to describe the agent in business terms, including what it doesn’t handle.
- Skills. Add one skill per capability, with a short name, a description, tags, and example queries. Click Generate to let the agent’s model draft a description or suggest skills from the agent’s instructions and tools, then edit before you save.
Endpoints
Both endpoints use your app’s Agent Studio host. A2A clients retrieve the agent card, then read the RPC URL from itssupportedInterfaces property.
- Agent card
- RPC
Copy the exact agent card URL from the Algolia dashboard and give it to your orchestrator.
The orchestrator uses this endpoint to discover the agent’s capabilities and connection details.The following URL shows the endpoint format:
Agent card
404 if the agent doesn’t exist, isn’t published, or doesn’t have A2A enabled.
Authentication
Both endpoints accept an Algolia API key with thesearch ACL, or a secured API key scoped to the agent’s indices.
The application is part of the URL, so the X-Algolia-Application-Id header is optional. If you send it, it must match the application in the path.
Send the key in one of two ways. The card advertises both as security schemes.
401 with a WWW-Authenticate: Bearer challenge.
Send a message
A2A clients handle the protocol for you. The following example uses the A2A Python SDK to discover the agent from its card and send one message. To run it, first install the SDK and HTTPX:Command line
CARD_URL with the agent card URL copied from the Algolia dashboard.
Then run the example:
Python
A2A-Version: 1.0 header. SDK clients add it for you:
Command line
Response
contextId for each turn, and it’s informational only. Don’t send it back: every message is a new turn.
Use the agent from an orchestrator
Orchestration frameworks with A2A support treat your agent as a remote sub-agent: they read the card, and their router delegates to it when a task matches the card’s description and skills. The following example uses Google’s Agent Development Kit (ADK) to route requests to your Agent Studio agent. To run it, first install ADK with A2A support:Command line
CARD_URL with the agent card URL copied from the Algolia dashboard.
The concierge uses a Gemini model, so set the GOOGLE_API_KEY environment variable to a Google AI Studio key, or follow the ADK quickstart to use another model.
The ADK A2A integration is experimental.
Check the ADK documentation for API changes.
Python
httpx_client sends your Algolia API key when ADK retrieves the agent card and sends messages to the agent.
Design your agent for A2A
A2A callers only receive the agent’s text reply. Keep these points in mind when you point an orchestrator at an agent that also serves a chat widget:- Answer in text. Results the agent shows as product cards in the widget don’t travel over A2A. Instruct the agent to list results in its reply, for example as a numbered list with a title and one sentence each.
- Avoid client-side tools and approvals. For A2A requests, Agent Studio excludes client-side tools because orchestrators can’t run them. Turns that require tool approval fail without returning a final answer.
- Give the agent a way to stop. When the index can’t answer a question, the agent can keep searching until it reaches its
max_iterationslimit (Max steps per completion in the dashboard), which fails the turn. Instruct the agent to answer with what it found, or to say it can’t, when a search returns nothing. Make sure the attributes orchestrators ask about are searchable. Raise the limit only for agents that need longer tool chains: each step is a billed model call. - Write the card for a router. Orchestrators pick agents by reading skills and descriptions. Describe business capabilities and their limits, not implementation details.
Caching, conversations, and analytics
A2A turns behave like a first/completions turn:
- When you enable caching, the completion cache answers identical messages to the same agent without a model call. The response carries an
X-Cacheheader. - Agent Studio stores each turn as a one-turn conversation. A2A activity also appears in Agent Studio analytics.
- Guardrails and rate limits apply as they do on
/completions.
Errors
Failures before the request reaches the agent are plain HTTP errors. Failures after that are an HTTP200 with a JSON-RPC error object.
A
-32603 error carries a fixed message. Check the agent’s conversations and your provider’s logs for the cause: a step-limit or provider error on the agent’s side shows up there.
A turn has about 100 seconds to answer, covering agent setup and the model call.
A turn that takes longer fails with -32603 and Agent Studio discards it: it doesn’t create a conversation, and the turn doesn’t appear in analytics.
Your LLM provider may still bill the interrupted model call.
Further reading
- A2A protocol specification. The protocol Agent Studio implements, with the full JSON-RPC method list.
- Integrate Agent Studio. Call the same agent from your frontend through the completions API.