Architecture
Understand core ACP architecture
This page serves as a placeholder for our upcoming detailed architecture documentation. We will soon provide a comprehensive overview of our design approach for agent-to-agent communication and the protocol architecture.
In the meantime, we invite the community to actively participate in shaping key architectural decisions through focused discussions. The following discussion topics cover some of the most challenging and critical aspects of agent communication and protocol establishment:
Community Discussions
Join the conversations on GitHub:
Pending topics:
- Natural Language as an Agent Interface (pending creation)
- Choosing between REST and JSON-RPC for Communication (pending creation)
- WebSockets vs HTTP vs Peer-to-Peer (Full Duplex Communication) (pending creation)
- Integration of Legacy Software with Agent Protocols (pending creation)
- Streaming Data between Agents (pending creation)
- Handling Request Cancellation and Ensuring Persistency (pending creation)
- Agent and Tool Providers versus MCP Servers: Roles and Responsibilities (pending creation)
- Deployment Strategies for Agents (pending creation)
- Configuration and Model Dependency Management for Agents (pending creation)
- Namespacing and name uniqueness (pending creation)
- Improved Installation Process (pending creation)
Manifest-Based Agent Offline Discoverability
Problem
In the Pre-alpha version of ACP, we introduced a tight coupling between agent providers and agents, meaning they run in the same runtime. To be discoverable, an agent must first be instantiated (dependencies installed, main process running). This presents several challenges:
- Agents are only discoverable if the provider is running.
- Agents require instantiation to become discoverable, consuming significant resources.
- Agents become discoverable only if successfully executed, but sometimes agents depend on external configurations that aren’t available until discovery occurs.
- Agents built using different languages or frameworks cannot coexist within the same provider.
- Environment management currently occurs on the agent provider’s side, yet should be coupled directly to the agent.
- Agents might depend on local resources (e.g., locally installed models) that must be prepared before runtime. The current design doesn’t support this.
- Agent installation currently happens implicitly—it should instead occur explicitly at user request (to handle failures transparently).
- A single agent should be deployable independently rather than deploying an entire provider.
- Fatal errors in the provider or agent currently affect both, impacting stability.
Current Implementation
Currently, the platform functions as a service registry. Providers register via the beeai provider add
command, pointing to a manifest file specifying deployment configurations. Providers then notify the platform through an JSON-RPC API about available agents embedded within their runtime.
Discoverability Process
Response:
Provider Manifest Format
Example:
Goal
Reevaluate the agent manifest and provider concepts. While grouping agents under providers has usability advantages, it introduces complexities outlined above. We propose shifting the provider details directly into individual agent manifests, enabling offline discovery and simplifying deployment. The new agent manifest should clearly describe:
- Deployment and consumption (as a service or deployable artifact).
- Interface definition (input/output schemas).
- Configuration requirements (secrets, environment variables).
- Dependencies (including other agents or external resources)
- Capabilities (sessions, interruptions) and metadata (license, description, skills, etc.)
Open Questions
- Should the agent manifest be compatible or inspired by Kubernetes manifests, or do we need a completely different schema due to ACP-specific requirements?
- Should MCP resources (e.g., tools, prompts) be combined in a single manifest or maintain separate manifests for clarity and modularity?
Additional Resources
- Lamma stack - Support for providers outside of this codebase
- MCP - .well-known/mcp directory
- MCP - Service discovery for MCPs
- MCO - MCP server registry
Support for Stateful Agents
Motivation
Supporting both stateless and stateful agents enables ACP to handle a broader range of use cases, particularly complex or long-lived interactions requiring persistent context. Such agents can offer more natural, efficient, and sophisticated user experiences. The following are some agent examples:
- aider: Agent designed for collaborative AI-assisted programming with integrated file system support.
supervisor
: A long-lived agent managing multi-step tasks.- Interactive agents involving continuous human-agent interactions while maintaining conversational context.
Stateless vs Stateful Agents
Area | Stateless Agents | Stateful Agents |
---|---|---|
Scalability and load balancing | ✅ Easy | ❌ Difficult |
Complexity of interaction | ❌ Low | ✅ High |
Communication efficiency | ❌ Low | ✅ High (incremental changes) |
Failure, interruption recovery | ✅ Easy | ❌ Difficult |
Agent complexity | ✅ Low | ❌ High (state management) |
Problem
ACP in Pre-alpha supports both stateful and stateless agents. Stateful agents utilize agent templates, but this feature is currently undocumented. The transport mechanisms (e.g., SSE, WebSockets) inherently maintain stateful connections, raising questions about the adequacy and clarity of the existing implementation. This implementation must be clearly evaluated and documented.
Selecting appropriate transport mechanisms is critical. Incorporating stateful behavior should not overly complicate ACP nor compromise its scalability and performance.
Current Stateless Implementation
The agent author provides a single method to instantiate, run, and destroy an agent:
Current Stateful Implementation
The agent author provides three separate methods: create
, run
and destroy
of an agent. The create
method returns an instance ID, generated by the agent provider. The run
method can be called repeatedly.
Create:
Run:
Destroy:
Open Questions
- Is the current stateful implementation (session = agent instance) sufficient for all use cases?
- Is the current stateless implementation well-documented, can statelessness be enforced by design?
- Transport consequences - REST (stateless) vs long-lived SSE (stateful) vs websocket (stateful)? Consider progressive enhancement?
- Should standardized headers or metadata be adopted?
- Mechanisms for restartable or recoverable connections?
- Strategies for automated resource cleanup when stateful agents are no longer in use?
- Provide OOTB support for key-value storage?
Alternative Proposal
Passing sessionId
through _meta
object.
Goal
ACP should flexibly support stateful and stateless agents while maintaining simplicity and scalability.
Specifically, ACP should:
- Keep protocol-level statefulness minimal, without requiring persistent state management within the protocol itself.
- Provide standardized mechanisms for agents to optionally manage context and state.
- Delegate responsibility for persistent state management and resource cleanup explicitly to agent implementations.