Agent Communication Protocol (ACP), introduced by IBM’s BeeAI, is an open-standard protocol designed to solve challenges related to agent interoperability and connectivity. The protocol aims to bridge the gap between autonomous agent operations and communications. ACP is agnostic in terms of internal implementations and requires minimal specifications for compatibility. As an AI agent communication protocol with an open governance, ACP enables AI agents to communicate and operate across different frameworks and technology stacks such as LangChain, CrewAI, Autogen, or any custom code. ACP is a part of the BeeAI platform, used for discovering, running, and composing AI agents, which IBM contributed to the non-profit Linux Foundation to advance AI community participation. This articles explores ACP practically through hands-on implementation.
Table of Contents
- Understanding Agent Communication Protocol (ACP)
- Key Features of ACP
- Comparison between ACP, MCP, and A2A Standards
- Hands-on Implementation of ACP
Understanding Agent Communication Protocol (ACP)
The main problem with current AI agent development is that the agents are created and developed across different frameworks, implementation standards and infrastructures in an isolated environment. The communication between such agents based on different implementation schemas poses a unique challenge of fragmentation which ultimately slows development and deployment of agents making it inflexible for agent to agent collaboration and communication. ACP rectifies this problem by defining and using REST-based rule sets that allows the agents to communicate with each other through the RESTful API. This API supports both synchronous and asynchronous transmission, interaction streaming, stateless and statefull operation patterns, online and offline agent discovery across different forms of modality.
In other words, ACP acts as a bridge allowing seamless agent to agent communication irrespective of the underlying, internal framework on which the said agents are built. The protocol is internal implementation agnostic and is able to support coherent and consistent collaboration between agents built using non-identical or dissimilar frameworks, say LangChain, CrewAI, AutoGen, etc. The following image showcases an example of ACP client and ACP agents of different frameworks communicating with each other –
ACP Architecture
ACP comprises of two main components – Client & Server. The ACP client is used by an ACP agent or service to make a request to an ACP server using the ACP protocol. Whereas, the ACP server can host one or more ACP agents that execute client requests and respond using the ACP protocol. The primary usability of an ACP server is to expose agents through a REST interface. ACP can be used based on different architectures such as single-agent, multi-agent server, or distributed multi-server.
Single-agent architecture is the simplest architecture which connects a single agent to the client directly through the REST interface over HTTP. This type of schema is best suited for direct communication with a single specialized lightweight agent setup with minimal infra needs. The ACP server wraps the agent and exposes an HTTP endpoint through which client can interact.
Multi-agent architecture is best suited for situations where agents share similar resources or are related to each other based on co-location. In this setup, the ACP server can host multiple agents behind a single HTTP endpoint. Each agent can be individually addressed through routing procedures based on agent metadata.
Distributed multi-server architecture allows independent agent scaling, load distribution across different servers with fault tolerance between different offered services. Here, the ACP client can discover and collaborate with multiple servers which are hosting one or more agents.
Key Features of ACP
Comparison between ACP, MCP, and A2A Standards
Hands-on Implementation of ACP
This section explores utilising ACP based on a client-server architecture built using smolagents framework.
Step 1: Environment Setup
Initialise a uv project, create and activate a virtual environment, and install the required libraries using the commands provided below (in a terminal) –
- mkdir ACP_projs
- cd ACP_projs
- uv init – This initializes a new Python project using the uv tool. It creates a pyproject.toml file, which is the modern standard for configuring Python projects and managing their dependencies
- uv venv – This command creates a virtual environment, which is automatically named .venv.
- source .venv/bin/activate – This command activates the virtual environment you just created.
- uv add acp_sdk load_dotenv nest-asyncio ‘smolagents[litellm]’ duckduckgo-search – This is the final step, where uv adds (downloads and installs) all the required Python libraries into your active virtual environment. It also updates the pyproject.toml file to record that your project depends on them.
Step 2: Ollama Setup and LLM Download
Make sure you have Ollama application up and running so that qwen3:4b model can be pulled and used in our implementation. Use the following commands to download qwen3:4b model and check if it’s download properly (in a terminal) –
- ollama pull qwen3:4b
- ollama list
Step 3: Server and Client Setup
We will create two python scripts server.py and client.py for using ACP to create, run our agent and interact with it using HTTP requests –
server.py
from collections.abc import AsyncGenerator # Used for creating asynchronous generators, which can pause and resume execution.
from acp_sdk.models import Message, MessagePart # Import data structures for handling messages from ACP SDK.
from acp_sdk.server import Context, RunYield, RunYieldResume, Server # Import server components from the ACP SDK to create and manage the agent.
from smolagents import CodeAgent, DuckDuckGoSearchTool, LiteLLMModel, VisitWebpageTool # Import agent logic and tools from the smolagents library.
import nest_asyncio # A library to allow asynchronous code to run in environments that don't natively support it.
import logging # Imports Python's standard logging library for outputting information.
nest_asyncio.apply()
# --- 1. Initialize the ACP Server ---
server = Server()
# --- 2. Configure the Language Model ---
model = LiteLLMModel(
model_id="ollama_chat/qwen3:4b",
api_base="http://localhost:11434",
num_ctx=4096,
)
# --- 3. Define the Agent ---
@server.agent()
async def research_agent(input: list[Message], context: Context) -> AsyncGenerator[RunYield, RunYieldResume]:
"""This is a ResearchAgent which assists users in understanding topics with ease."""
agent = CodeAgent(tools=[DuckDuckGoSearchTool(), VisitWebpageTool()], model=model)
prompt = input[0].parts[0].content
response = agent.run(prompt)
yield Message(parts=[MessagePart(content=str(response))])
# --- 4. Run the Server ---
if __name__ == "__main__":
server.run()
client.py
import nest_asyncio
import asyncio
from acp_sdk.client import Client # Imports the Client class to communicate with an ACP server.
from acp_sdk.models import Message, MessagePart # Imports the data structures for creating a message to send to an agent.
# --- Patch the asyncio event loop ---
nest_asyncio.apply()
# --- Define the main asynchronous client function ---
async def acp_client() -> None:
async with Client(base_url="http://localhost:8000") as client:
run = await client.run_sync(agent="research_agent", input=[Message(parts=[MessagePart(content="Explain Agentic AI in less than 100 words?")])])
print(run)
if __name__ == "__main__":
asyncio.run(acp_client())
Step 4: Agent Execution and Response
Run server.py and client.py in two separate terminal windows respectively to check the generated response –
- uv run server.py
- uv run client.py
Final Output –
Our agent (in server.py) gave the response based on the prompt input (in client.py) as shown in the above screenshot.
Final Words
Agent Communication Protocol (ACP) is an important standard that enables integrating AI agents seamlessly and effectively. It’s support for stateful and stateless agent can support AI engineers and developers to scale agents or deploy agents with an improved context retention in long-running workflows. ACP’s JSON-RPC based communication also makes it easy to integrate AI agents into event-driven systems and microservices architectures. ACP compliments MCP by providing a more seamless solution to agent communication and collaboration thereby reducing interoperability problems, and enabling the development of more dynamic and scalable agentic AI solutions.
References
- Link to Code
- Agent Communication Protocol Official Documentation
- Agent Communication Protocol GitHub Repository
- IBM’s BeeAI GitHub Repository
- What is Agent Communication Protocol (ACP) – IBM?
- The Simplest Protocol for AI Agents to Work Together – IBM
- IBM’s Agent Communication Protocol (ACP) – A Technical Overview for Software Engineers