Skip to content

eddiehaug/abax-hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ABAX Customer Support Multi-Agent System

Agent Development Kit (ADK) Training Demo

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:

  1. Orchestration: A central dispatcher routing tasks.
  2. Agent-to-Agent (A2A) Protocol: Standardized communication between independent agents using JSON-RPC 2.0 over HTTP.
  3. Grounding: Using Google Search to provide real-time, factual information about ABAX products.
  4. Asynchronous Execution: Non-blocking tool execution for high performance.

🏗️ Architecture

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
Loading

The Agents

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.

🚀 Prerequisites

  1. Python 3.10+ installed.
  2. Google Cloud Project:
    • A project with billing enabled.
    • Vertex AI API enabled.
    • Access to Gemini 3.0 Pro Preview (or Flash 2.5).
  3. Google Cloud SDK: gcloud installed and authenticated.

🛠️ Setup Guide

1. Environment Setup

Create and activate a virtual environment to keep dependencies isolated.

python3 -m venv venv
source venv/bin/activate

Install the required packages, including the ADK and A2A SDK.

pip install -r requirements.txt

2. Authentication

Authenticate your local environment with Google Cloud Application Default Credentials (ADC).

gcloud auth application-default login

3. Configuration

You 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/.env
  • agents/sales/.env
  • agents/finance/.env
  • agents/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.


🏃‍♂️ Running the System

To demonstrate the Agent-to-Agent (A2A) capabilities, we run a single ADK server that hosts all agents and exposes their A2A endpoints.

  1. 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.
  2. Access the UI: Open your browser to http://localhost:8000.

  3. Interact:

    • Select dispatcher from the dropdown menu in the top-left.
    • Start chatting!

Demo Scenarios (Prompts)

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.

📚 Code Walkthrough (For Training)

1. The A2A Client (agents/utils.py)

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, and parts (text).
  • Async: It uses httpx.AsyncClient to ensure the Dispatcher doesn't block while waiting for the Sales/Tech agent to reply.

2. The Dispatcher (agents/dispatcher/agent.py)

  • Defines Async Tools (async def send_to_sales...).
  • Uses LlmAgent instructions to act as a router.
  • Does not have knowledge of ABAX products itself; it relies entirely on delegation.

3. The Specialist Agents (agents/sales, etc.)

  • Defined with specific instruction prompts for their domain.
  • Equipped with google_search tool (Grounding) to fetch live data from abax.com.
  • Configured with agent.json files which define them as A2A services (Capabilities, URL, Description).

🐛 Troubleshooting

  • Method not found: Ensure you are running with the --a2a flag.
  • 404 Not Found: Ensure the URL in agents/utils.py matches 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages