This project aims to create a robust framework incorporating Micro-Service Choreography Pattern (MCP), Agent-to-Agent (A2A) communication, and Coinbase x402 payments to enable complex, automated workflows executed by AI agents.
a2a_discovery
: Handles agent registration, discovery (via Agent Cards), and reputation management.developer_toolkit
: Provides utilities for setting up simulations and interacting with the framework.documentation
: Contains developer and user guides.ecosystem_integration
: Contains mock clients for external services (Anthropic, AWS Bedrock, Coinbase Facilitator).mcp_tool_server
: Implements the Micro-Service Choreography Pattern for tool execution.observability
: Handles logging of system events for monitoring and analysis.security
: Contains components for security architecture (policy, fraud detection, A2A message security).task_orchestration
: Manages workflow decomposition, agent matching, and execution flow.tests
: Unit and integration tests for all modules.value_transfer
: Manages mock escrow and cross-chain settlement services.x402_payment_module
: Handles x402 payment processing logic.
-
Set up a simulation environment:
- Use the helper functions from the developer toolkit:
from developer_toolkit.toolkit import setup_simulation_environment, populate_simulation_agents # Get a dictionary with all core services initialized services = setup_simulation_environment() # Optionally, populate the agent registry with sample agents agent_registry = services['agent_registry'] populate_simulation_agents(agent_registry)
- Use the helper functions from the developer toolkit:
-
Run tests:
- Execute tests using the Python
unittest
module from the root directory of the project:python -m unittest discover -s tests -p "test_*.py"
- Execute tests using the Python
The framework is built upon several core components that interact to enable complex, automated workflows:
- Micro-Service Choreography Pattern (MCP) (
mcp_tool_server
): Standardizes how AI agents expose their capabilities (tools) and how these tools are executed. It promotes interoperability. - Agent-to-Agent (A2A) Discovery (
a2a_discovery
): Facilitates the dynamic discovery of agents based on their advertised capabilities and reputation scores. This allows the system to find the most suitable agent for a given task. - X402 Payment Module (
x402_payment_module
): Integrates a (simulated) machine-native payment mechanism based on the X402 standard, enabling agents to charge for their services. - Task Orchestration Engine (
task_orchestration
): This is the brain of the system. It takes high-level user requests, parses them into a sequence of executable steps (a workflow), and then manages the execution of this workflow.
Key Workflow:
The typical flow of operations within the framework is as follows:
- User Request: A user or an external system submits a high-level request.
- Task Parsing: The
TaskParser
(intask_orchestration
) breaks the request into a definedWorkflow
consisting of multipleWorkflowStep
s. - Agent Selection (A2A): For each
WorkflowStep
, theTaskOrchestrator
queries theAgentRegistry
to find suitable agents. Selection is based on the agent's advertised capabilities and their reputation. - Secure Tool Execution (MCP + Security):
- The
MCPPolicyEngine
(insecurity
) checks if the selected agent is authorized to use the required tool for the step. - If the task requires payment (determined by the agent's tool or X402 middleware), the
X402Middleware
handles payment negotiation. - The
X402FraudDetectionService
checks the payment for potential fraud. - The
TaskOrchestrator
then uses theMCPClient
to instruct the selected agent to execute the tool.
- The
- Context Chaining: Output from one step is made available as input to subsequent steps, enabling complex multi-stage processing.
- Reputation Update: Upon task completion (or failure), the performing agent's reputation in the
AgentRegistry
is updated. - Observability Logging: Throughout the workflow, the
ObservabilityService
logs critical events, agent metrics, payment flows, and context propagation details for monitoring, debugging, and auditing. - Payment & Escrow (Value Transfer & X402): (Conceptually) Payments are made upon successful task completion, potentially involving escrow services for more complex interactions.
This framework enables complex workflows by combining A2A's agent collaboration, MCP's tool interoperability, and X402's machine-native payments, all managed by a central orchestration logic.
For more detailed information, please refer to the following documents in the documentation/
directory:
DEVELOPERS.md
: Guide for developers, including module overviews and instructions for extending the framework.USERS.md
: Conceptual guide for users, explaining how to interact with the system and an example workflow.