Architecture Overview
Solace Agent Mesh is an event-driven framework that creates a distributed ecosystem of collaborative AI agents. The architecture decouples agent logic from communication and orchestration, enabling you to build scalable, resilient, and modular AI systems.The framework integrates Solace Event Broker for messaging, Solace AI Connector (SAC) for component lifecycle management, and Google Agent Development Kit (ADK) for agent intelligence.
Architectural Principles
The design of Agent Mesh is founded on three key architectural principles:Event-Driven Architecture
All interactions between major components are asynchronous and mediated by the Solace event broker, eliminating direct dependencies.
Component Decoupling
Gateways, Agent Hosts, and services communicate through standardized A2A protocol messages without knowing each other’s implementation.
Scalability & Resilience
Horizontal scaling of components with fault tolerance and guaranteed message delivery through the event broker.
Why Event-Driven?
The event-driven architecture provides several critical benefits:- Asynchronous Communication: Components don’t wait for responses, enabling high throughput
- Loose Coupling: Services can be developed, deployed, and scaled independently
- Fault Tolerance: The event broker ensures message delivery even if components fail
- Dynamic Scaling: Add or remove components without system downtime
- Complete Observability: All communication flows through the broker for monitoring
System Architecture Diagram
The following diagram illustrates how external systems, gateways, the event broker, agent hosts, and backend services interact:Core Components
Solace Event Broker
The Solace Event Broker serves as the central nervous system of the agent mesh.- Overview
- Topic Structure
- Message Flow
The event broker provides:
- Topic-based routing: Hierarchical topic structure for precise message routing
- Request/reply patterns: Synchronous-style communication over async messaging
- Publish/subscribe: For agent discovery and broadcast messages
- Guaranteed delivery: Messages are persisted and delivered even if recipients are offline
- High throughput: Handles millions of messages per second
Gateways
Gateways bridge external systems and the agent mesh, handling protocol translation and session management.Gateways are SAC applications built using the Gateway Development Kit (GDK), which provides BaseGatewayApp and BaseGatewayComponent classes.
Protocol Translation
Convert external protocols (HTTP, WebSockets, Slack RTM) into standardized A2A protocol messages and vice versa.
Authentication & Authorization
Authenticate incoming requests and use a pluggable AuthorizationService to retrieve user permission scopes.
Response Handling
Handle asynchronous responses and status updates from agents, including streaming updates.
Agent Hosts and Agents
An Agent Host is a SAC application that hosts a single ADK-based agent.- Agent Host
- Agent Definition
- Agent Card
Agent Host Responsibilities:
- Manages the lifecycle of the ADK Runner and LlmAgent
- Handles A2A protocol translation between incoming requests and ADK Task objects
- Enforces permission scopes by filtering available tools
- Initializes ADK services (ArtifactService, MemoryService)
- Publishes agent capabilities via AgentCard
- Manages agent discovery and peer delegation
The A2A Protocol
The Agent-to-Agent (A2A) protocol is the standardized communication protocol based on JSON-RPC 2.0.Protocol Message Types
- SendTaskRequest
- StatusUpdate
- SendTaskResponse
- AgentCard
Purpose: Submit a task to an agentTopic: User Properties (Solace message headers):
{namespace}/a2a/request/{agent_name}Structure:Message Parts
A2A messages contain an array of “parts” that can be different types:Key Architectural Flows
User Task Processing Flow
This flow demonstrates how a user request moves through the system:Authentication & Authorization
Gateway authenticates the request and retrieves user permission scopes via AuthorizationService.
A2A Task Creation
Gateway translates the request into an A2A task message, including scopes in message user properties.
Task Routing
Gateway publishes the message to the target agent’s request topic on the Solace Broker.
Agent Processing
Agent Host receives the message, extracts scopes, filters available tools, and initiates an ADK task.
LLM Interaction
ADK LlmAgent processes the task, invoking the LLM with filtered tools and generating a plan.
Agent-to-Agent Delegation Flow
Agents can delegate subtasks to peer agents while maintaining security context:Agent Discovery Flow
The system automatically discovers available agents through a publish-subscribe mechanism:AgentCard Publishing
On startup and periodically, each Agent Host publishes an AgentCard describing its capabilities to the discovery topic.
Services and Storage
Agent Mesh provides pluggable services for various storage and management needs:- Session Service
- Artifact Service
- Identity Service
Purpose: Store conversation history and contextAvailable Types:Behaviors:
memory: In-memory storage (development only)sql: SQLite, PostgreSQL, or other SQL databasesvertex_rag: Google Vertex AI RAG for vector-based retrieval
PERSISTENT: Sessions persist across agent restartsRUN_BASED: Sessions cleared when agent stops
Advanced Features
Dynamic Embeds
Embeds allow late-stage resolution of placeholders in agent responses:status_update: Rendered as streaming status messageartifact_content: File content loaded and embeddedcalc: Mathematical expression evaluated
Artifact Handling Modes
- ignore
- embed
- reference
Artifacts are not included in responses. Useful when artifacts are large or not needed by the client.
Auto-Summarization
Conversation history can be automatically summarized to manage context length:Tool Permission Scopes
Tools can be restricted based on user permissions:Deployment Architecture
Agent Mesh supports various deployment patterns:- Development (Single Process)
- Distributed (Multiple Processes)
- Containerized (Docker/Kubernetes)
All components run in a single process:
- Simple setup
- Easy debugging
- Not suitable for production
Performance Considerations
Message Size
Keep A2A messages under 10MB (Solace broker limit). Use artifact references for large files.
Tool Parallelization
Enable parallel tool calls in LLM configuration:
Caching
Use prompt caching to reduce LLM costs:
Batching
Configure stream batching threshold:
Security Architecture
Next Steps
Now that you understand the architecture:Create Custom Agents
Learn how to build specialized agents for your use cases.
Build Gateways
Create custom gateways to integrate with your systems.
Deploy to Production
Learn best practices for production deployments.
Monitor & Debug
Set up observability and troubleshooting for your agent mesh.