This project demonstrates a Multi-Agent System (MAS) built with the Google Agent Development Kit (ADK). It simulates a Customer Support department for ABAX AS, a leading European telematics provider.
The system showcases advanced agentic design patterns, including:
- Orchestration: A central dispatcher routing tasks.
- Agent-to-Agent (A2A) Protocol: Standardized communication between independent agents using JSON-RPC 2.0 over HTTP.
- Grounding: Using Google Search to provide real-time, factual information about ABAX products.
- Asynchronous Execution: Non-blocking tool execution for high performance.
The system consists of four distinct agents running on a single ADK server.
graph TD
User(User) -->|Chat| Dispatcher(Dispatcher Agent)
subgraph "A2A Network (JSON-RPC over HTTP)"
Dispatcher -->|routes to| Sales(Sales Agent)
Dispatcher -->|routes to| Finance(Finance Agent)
Dispatcher -->|routes to| Tech(Tech Support Agent)
end
Sales -->|Google Search| Web(Internet)
Finance -->|Google Search| Web
Tech -->|Google Search| Web
| Agent | Role | Key Features |
|---|---|---|
| Dispatcher | Front-line triage. Analyzes user intent and routes to the correct specialist. | Uses A2AClient tools to forward messages. |
| Sales | Handles inquiries about Triplog, Fleet Control, and subscriptions. | Google Search Grounding for pricing/product details. |
| Finance | Handles billing, invoices, and refunds. | Google Search Grounding for financial policies. |
| Tech | Troubleshooting hardware (GPS units) and software (App/Portal). | Google Search Grounding for manuals/guides. |
- Python 3.10+ installed.
- Google Cloud Project:
- A project with billing enabled.
- Vertex AI API enabled.
- Access to Gemini 3.0 Pro Preview (or Flash 2.5).
- Google Cloud SDK:
gcloudinstalled and authenticated.
Create and activate a virtual environment to keep dependencies isolated.
python3 -m venv venv
source venv/bin/activateInstall the required packages, including the ADK and A2A SDK.
pip install -r requirements.txtAuthenticate your local environment with Google Cloud Application Default Credentials (ADC).
gcloud auth application-default loginYou must configure the .env files for each agent. This project simulates a distributed system where each agent could theoretically live on a different server with different credentials.
Files to Update:
agents/dispatcher/.envagents/sales/.envagents/finance/.envagents/tech/.env
Content:
Update GOOGLE_CLOUD_PROJECT with your actual project ID.
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_CLOUD_PROJECT=your-actual-project-id
GOOGLE_CLOUD_LOCATION=global> Note: We use global location to access Gemini 3.0 Pro Preview.
To demonstrate the Agent-to-Agent (A2A) capabilities, we run a single ADK server that hosts all agents and exposes their A2A endpoints.
-
Start the Server: Run the following command in your terminal:
adk web agents --a2a
adk web: Starts the ADK Development UI and API server.agents: Points to the directory containing our agent packages.--a2a: Enables the A2A protocol, creating endpoints like/a2a/sales.
-
Access the UI: Open your browser to http://localhost:8000.
-
Interact:
- Select
dispatcherfrom the dropdown menu in the top-left. - Start chatting!
- Select
Try these prompts to see the Dispatcher route to different agents:
-
Sales Scenario:
"I want to buy a subscription for ABAX Triplog for my company cars. What are the benefits?"
- Expected Behavior: Dispatcher routes to Sales Agent -> Sales Agent searches web for Triplog features -> Responds.
-
Tech Scenario:
"My GPS unit isn't tracking trips properly. How do I reset the hardware?"
- Expected Behavior: Dispatcher routes to Tech Agent -> Tech Agent searches for troubleshooting steps -> Responds.
-
Finance Scenario:
"I was double charged for my fleet subscription this month."
- Expected Behavior: Dispatcher routes to Finance Agent -> Finance Agent responds about billing policy.
We implemented a custom SimpleA2AClient to demonstrate how the protocol works under the hood.
- It sends JSON-RPC 2.0 requests (
POST) to the target agent's URL. - Method:
message/send(Standard A2A method). - Payload: Includes
role,message_id, andparts(text). - Async: It uses
httpx.AsyncClientto ensure the Dispatcher doesn't block while waiting for the Sales/Tech agent to reply.
- Defines Async Tools (
async def send_to_sales...). - Uses
LlmAgentinstructions to act as a router. - Does not have knowledge of ABAX products itself; it relies entirely on delegation.
- Defined with specific
instructionprompts for their domain. - Equipped with
google_searchtool (Grounding) to fetch live data fromabax.com. - Configured with
agent.jsonfiles which define them as A2A services (Capabilities, URL, Description).
- Method not found: Ensure you are running with the
--a2aflag. - 404 Not Found: Ensure the URL in
agents/utils.pymatches your local server port (default 8000). - Timeout: The agents perform real Google Searches and LLM calls. This can take 5-10 seconds. The client timeout is set to 60s.