What is ACP (Agent Communication Protocol)?
The Agent Communication Protocol (ACP) is an open standard designed to enable interoperable, low-latency communication between AI agents, regardless of the framework, programming language, or runtime environment they’re built on
Think of ACP as the HTTP for AI agents a lightweight, REST-native protocol that allows agents to discover, message, and coordinate with each other in real time. It abstracts away framework-specific details and provides a unified interface for agent interaction, making it ideal for building modular, composable, and scalable multi-agent systems.
Why ACP Matters
Modern AI systems often rely on specialized agents for tasks like retrieval, reasoning, classification, and tool use. However, these agents are typically siloed within their own ecosystems (LangChain, CrewAI, BeeAI, etc.), making integration difficult.
ACP solves this by:
- Standardizing communication across agents
- Supporting multimodal messaging (text, images, embeddings, etc.)
- Enabling local-first orchestration without cloud dependencies
- Facilitating agent discovery and collaboration across organizations
ACP Architecture
ACP supports multiple deployment patterns :
1. Single-Agent Server
- A client communicates with one agent via a REST interface.
- Ideal for simple setups and debugging.
2. Multi-Agent Server
- One server hosts multiple agents.
- Each agent is addressable via metadata-based routing.
3. Distributed Multi-Server
- Multiple servers host agents independently.
- Enables scalability, fault isolation, and flexible deployment.
4. Router Agent Pattern
- A central agent decomposes tasks and delegates to specialized agents.
- Supports orchestration, parallelism, and aggregation.
ACP Endpoints
ACP defines a minimal set of RESTful endpoints for agent interaction. Here’s a breakdown:
Run Lifecycle Endpoints
POST /runs Starts a new agent run. Requires agent_name, input, and optional mode (sync, async, stream).
GET /runs/{run_id} Retrieves the current state and output of a run.
POST /runs/{run_id} Resumes a paused run (in awaiting state).
POST /runs/{run_id}/cancel Requests cancellation of an ongoing run.
Agent Metadata & Discovery
GET /agents Lists all available agents.
GET /agents/{agent_id} Retrieves metadata about a specific agent.
Message Exchange
POST /agents/{agent_id}/messages Sends a message to an agent.
GET /agents/{agent_id}/messages/{message_id}/response Retrieves the response to a message.
Key Features of ACP
- Framework Agnostic: Works with LangChain, CrewAI, AutoGen, or custom implementations
- REST-Based: Standard HTTP communication protocol
- Async Support: Both synchronous and asynchronous transmission
- State Management: Supports stateless and stateful operation patterns
- Streaming: Real-time interaction streaming capabilities
- Discovery: Online and offline agent discovery mechanisms
- Open Governance: Community-driven development and standards
ACP Server
"""
ACP Server - SreeniParrotAgent Implementation
This server implements a simple ACP (Agent Communication Protocol) server with a single agent
that echoes back received messages after a 30-second processing delay.
Dependencies:
- acp_sdk: The ACP SDK for building agent servers
- asyncio: For asynchronous operations
Usage:
python main.py
The server will start on http://0.0.0.0:8000
"""
import asyncio
from acp_sdk.server import Server
from typing import AsyncGenerator
from acp_sdk import MessagePart
# Initialize the ACP server instance
server = Server()
@server.agent(
name="SreeniParrotAgent", # Unique identifier for the agent
description="An agent that echoes back the received message.", # Human-readable description
metadata={
"version": "1.0", # Agent version
"author": {
"name": "Sreeni", # Author name
"email": "sreeni@example.com" # Author contact
}
}
)
async def SreeniParrotAgent(messages: list) -> AsyncGenerator[MessagePart, None]:
"""
Main agent function that processes incoming messages.
Args:
messages (list): List of message objects containing input data
Yields:
MessagePart: Processed output messages
Processing Flow:
1. Receives messages from client
2. Waits 30 seconds (simulating processing time)
3. Echoes back the original content
"""
for message in messages:
# Process each message in the input
for part in message.parts:
# Simulate processing delay (30 seconds)
await asyncio.sleep(30)
# Echo back the received content as output
yield MessagePart(
name="output", # Output identifier
content_type="text", # Content type (text in this case)
content=part.content # The actual content to echo back
)
if __name__ == "__main__":
# Start the server when script is run directly
server.run(host="0.0.0.0", port=8000)
ACP client with python client SDK
"""
ACP Client - Endpoint Testing Suite
This client tests all available endpoints of the ACP server and displays
comprehensive status information and response content.
Dependencies:
- requests: HTTP library for making API calls
Usage:
python client.py
Prerequisites:
- ACP server must be running on http://0.0.0.0:8000
"""
import requests
import json
# Base URL for the ACP server
BASE_URL = "http://0.0.0.0:8000"
# ANSI color codes for terminal output
class Colors:
BLUE = '
