
A Practitioner’s Guide to Agent Communication Protocol (ACP)

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 specificiations 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 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
Initialized project `acp-projs`
- uv venv - This command creates a virtual environment which is automatically named .venv.
Using CPython 3.13.3 interpreter at: /opt/homebrew/opt/[email protected]/bin/python3.13
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
- 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 the Agent Communication Protocol (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.
# It patches the event loop to allow it to be nested, preventing errors.
nest_asyncio.apply()
# --- 1. Initialize the ACP Server ---
# Create an instance of the Server class from the ACP SDK. This server will host our agent and handle communication.
server = Server()
# --- 2. Configure the Language Model ---
# Set up the connection to a local Large Language Model (LLM) using LiteLLM. This configuration points to a local Ollama instance.
model = LiteLLMModel(
model_id="ollama_chat/qwen3:4b", # Specifies the exact model to use (in this case, Qwen3 4B-parameter model via Ollama).
api_base="http://localhost:11434", # The URL where the local Ollama API is running.
num_ctx=4096, # Sets the context window size (the maximum number of tokens the model can consider).
)
# --- 3. Define the Agent ---
# The `@server.agent()` decorator registers the following function as an agent on the ACP server. This makes it discoverable and runnable through the ACP protocol.
@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."""
# Inside the agent function, create an instance of CodeAgent from the smolagents library. This agent is equipped with tools for searching the web and visiting webpages.
agent = CodeAgent(tools=[DuckDuckGoSearchTool(), VisitWebpageTool()], model=model)
# Extract the actual text content from the first part of the first message in the input list. This is the user's prompt that the agent needs to act on.
prompt = input[0].parts[0].content
# Run the agent with the user's prompt. The agent will use its model and tools to generate a response based on the prompt.
response = agent.run(prompt)
# The 'yield' keyword sends the final response back to the user through the ACP server. It wraps the string response in the standard Message and MessagePart format.
yield Message(parts=[MessagePart(content=str(response))])
# --- 4. Run the Server ---
# This is a standard Python construct. The code inside this block will only run when the script is executed directly (not when it's imported as a module).
if __name__ == "__main__":
# This command starts the ACP server, making the 'research_agent' available to receive requests from other applications or agents.
server.run()
client.py
import nest_asyncio # A library to allow asynchronous event loops to be nested.
import asyncio # The standard Python library for writing asynchronous code using async/await syntax.
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 ---
# This line allows the asyncio event loop to be run within an already running loop.
nest_asyncio.apply()
# --- Define the main asynchronous client function ---
# 'async def' defines a coroutine, a function that can be paused and resumed.
async def acp_client() -> None:
# --- Connect to the ACP Server ---
# 'async with' creates a context where the client connection is automatically managed (opened and closed). The Client is configured to connect to an ACP server running on localhost at port 8000.
async with Client(base_url="http://localhost:8000") as client:
# --- Run a task on the remote agent ---
# 'await' pauses the function here until the agent on the server completes its task and returns a result. client.run_sync sends a request to a specific agent and waits for the final result.
run = await client.run_sync(
agent="research_agent", # Specifies the name of the agent to run on the server.
input=[Message(parts=[MessagePart(content="Explain Agentic AI in less than 100 words?")])] # Constructs the message payload to send as input to the agent.
)
# Print the final response received from the agent.
print(run)
# --- Entry point of the script ---
# This standard Python block ensures the code inside only runs when the script is executed directly.
if __name__ == "__main__":
# 'asyncio.run()' starts the asyncio event loop and runs the 'acp_client' coroutine until it completes.
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
- 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

Sachin Tripathi
Sachin Tripathi is the Manager of AI Research at AIM, with over a decade of experience in AI and Machine Learning. An expert in generative AI and large language models (LLMs), Sachin excels in education, delivering effective training programs. His expertise also includes programming, big data analytics, and cybersecurity. Known for simplifying complex concepts, Sachin is a leading figure in AI education and professional development.