Wrap an Agent
How to make an existing agent ACP-compatible
The ACP SDK allows you to wrap an existing agent, regardless of its framework or programming language, into a reusable and interoperable service. By implementing a simple interface, your agent becomes compatible with the ACP protocol and can communicate over HTTP, interact with other agents in workflows, and exchange structured messages using a shared format.
Once wrapped, your agent becomes:
- Remotely callable over REST APIs
- Composable in workflows with other agents
- Discoverable by other systems
- Reusable without changing its internal logic
Simple agent
uv add acp-sdk
Wrap an agent by annotating a Python function with @server.agent()
. The agent name comes from the function name, and the description comes from the docstring. You can add more metadata like capabilities, dependencies, and content types - see the Agent Manifest section for details.
This creates an ACP-compliant agent that can receive messages and respond via HTTP using the ACP protocol:
What happens here:
- The
@server.agent()
decorator registers your function as an ACP agent inputs
contains the messages sent to your agentcontext
provides request metadata and utilitiesyield
statements send responses back to the caller- The server automatically handles HTTP routing and message serialization
Simple LLM agent
Here’s a more sophisticated example that wraps an LLM agent with memory and tools using the beeai-framework
: