Building Multi-Agent Systems with ACP, Strands and Bedrock: A Practical Implementation
Image generated using Amazon Nova Canvas

Building Multi-Agent Systems with ACP, Strands and Bedrock: A Practical Implementation

As AI applications become more sophisticated, the need for multiple specialized agents to work together has become increasingly important. However, building cohesive multi-agent systems presents unique challenges. This is where the Agent Communication Protocol (ACP) comes into play, offering a standardized way for AI agents to communicate and collaborate effectively. In this blog post, I have demonstrated using a multi-agent weather application how you can use Amazon Bedrock, AWS Strands and ACP to discover, orchestrate and invoke multiple agents.

Here is a short demo of the multi-agent application. In the sections below, I will elaborate on the concepts and the Solution Architecture.

Demo of the Multi-Agent Weather App

What is ACP?

The Agent Communication Protocol (ACP) is an open-source, agent-to-agent communication protocol governed by the Linux Foundation. ACP addresses a critical challenge in enterprise AI: agents are often built and run in isolation, using different technologies, infrastructure, and managed by different teams. This fragmentation makes it difficult for agents to work together cohesively, ultimately slowing innovation.

ACP provides a standardised communication layer that enables agents to discover, connect, and collaborate regardless of their underlying implementation. Think of it as a universal translator for AI agents. In this blog post, I have created a sample implementation, a Streamlit based Weather application that acts as an ACP client, while the pincode and weather agents run as separate ACP servers on different ports.

Amazon Bedrock and Strands: The Foundation for Intelligent Agents

Amazon Bedrock is a fully managed service that provides access to foundation models from leading AI companies through a single API. It enables developers to build and scale generative AI applications without managing infrastructure. AWS Strands Agents is an open-source Python SDK designed to simplify the development and deployment of AI agents. It utilizes a model-driven approach, allowing developers to build agents that can plan, reason, and use tools to accomplish tasks, all with minimal code.

For our multi-agent implementation, we leverage Amazon Bedrock's Claude 3.5 Haiku for both agent orchestration and individual agent intelligence. Bedrock's serverless architecture makes it ideal for building scalable, production-ready AI agents.

ACP Client-Server Architecture

ACP follows a client-server architecture where agents are wrapped as ACP servers that can be discovered and invoked by ACP clients. Here's how it works:

  • ACP Servers: Individual agents run as independent servers, each exposing their capabilities through standardized ACP endpoints

  • ACP Clients: Applications that discover and communicate with ACP servers using REST APIs

  • Service Discovery: Clients can automatically discover available agents without hardcoded dependencies

  • Protocol Standardization: All communication follows ACP specifications, ensuring interoperability

Server Discovery and Agent Routing

ACP Server Discovery:

  • Registration: ACP servers register themselves with discovery services or run on known endpoints

  • Health Checks: Clients can ping servers to verify availability

  • Capability Advertisement: Servers expose their capabilities through standardised metadata

  • Dynamic Discovery: Clients can discover new agents without code changes

Intelligent Agent Routing:

  • Query Analysis: Amazon Bedrock analyzes user queries to determine required agents

  • Dependency Resolution: The system identifies if agents need to be called sequentially

  • Execution Planning: Creates an execution plan with proper agent ordering

  • Result Chaining: Passes outputs from one agent as inputs to the next

The Multi-Agent Weather Application

To demonstrate ACP's capabilities, I built a practical multi-agent system that provides weather information based on Indian postal codes (pincodes). The GitHub code repo for the Weather application can be found here. The solution consists of three key components:

1. Streamlit Application (streamlit_app.py): The main application serves as the orchestrator and user interface. Here's what it does:

  • Intelligent Routing: Uses Amazon Bedrock's Claude 3.5 Haiku to analyze user queries and determine which agents to call and in what order

  • Agent Discovery: Automatically discovers available ACP agents running on different ports

  • Chain Execution: Coordinates sequential agent calls, passing results between agents when needed

2. Pincode Agent (pincode_agent_acp_server.py): This strands agent handles Indian postal code lookups:

  • Single Purpose: Focused solely on pincode-to-location mapping

  • API Integration: Uses the Postal Pincode API to fetch location details

  • Structured Output: Returns location data in a consistent format for downstream agents

3. Weather Agent (weather_agent_acp_server.py): The weather strands agent provides current conditions:

  • Weather Intelligence: Integrates with OpenWeather API for real-time data

  • Enhanced Responses: Includes fun facts about cities using Claude 3.5 Haiku

  • Temperature Conversion: Automatically converts Kelvin to Celsius for user-friendly output

How It All Works Together

  1. User Input: User enters a query like "What's the weather for pincode 110001?"

  2. Intelligent Routing: The Streamlit app uses Bedrock to analyze the query and determines it needs both pincode and weather agents.

  3. Agent Discovery: The application connects to ACP servers running on ports 8001 (pincode) and 8002 (weather).

  4. Sequential Execution:First, the pincode agent converts "110001" to "New Delhi, Central Delhi, Delhi, India". Then, the weather agent uses this location to fetch current weather conditions.

  5. Unified Response: The user receives comprehensive information combining location details and weather data.

Solution Architecture

ACP vs MCP

ACP is designed for agent-to-agent communication across multiple servers using REST APIs, enabling distributed agents to discover and collaborate with each other in a standardized way. MCP (Model Context Protocol) focuses on enriching a single agent's context by providing it with tools, prompts, and external resources to enhance its capabilities.

Use ACP when you need multiple independent agents to work together in a coordinated workflow, and use MCP when you want to extend a single agent's functionality with additional tools and context.

Conclusion

This implementation demonstrates how ACP and Amazon Bedrock can work together to create sophisticated multi-agent systems. The standardized communication protocol makes it easy to add new agents, while Bedrock's intelligence enables smart orchestration and enhanced agent capabilities.

As enterprises adopt more AI agents, protocols like ACP will become essential for building cohesive, scalable multi-agent ecosystems. The combination with managed AI services like Amazon Bedrock provides a powerful foundation for production-ready intelligent systems.

The key advantage of ACP lies in its ability to create loosely coupled, discoverable agents that can work together without tight integration. This architectural approach enables teams to develop agents independently while maintaining system-wide coherence through standardized communication protocols.

Justin Fraenkel

AI & Automation Consultant

1mo

Impressive work integrating different agents seamlessly. This could transform how applications interact in real-time. What lies ahead for agent collaboration?

Like
Reply

To view or add a comment, sign in

Others also viewed

Explore topics