This document summarizes the current state of the multi-agent project and provides instructions for you to proceed.
I have successfully refactored the project to implement a secure, scalable, and low-latency multi-tenant architecture. The host_agent now acts as a central orchestrator that can route requests to both global and tenant-specific downstream agents.
-
Multi-Tenant Architecture: Implemented a registry-based discovery mechanism using a new
demo_agent_registryservice. Each tenant now gets their ownhost_agentinstance, configured at startup with atenant_id. -
Security: Implemented a complete OAuth 2.0 security flow.
- A new mock Identity Provider (IDP) (
idp) handles user authentication and issues JWTs with atenant_idclaim. - Downstream agents now validate these JWTs using a shared
token_validator.py. - The
host_agentautomatically initiates the login flow when a secure agent is accessed for the first time.
- A new mock Identity Provider (IDP) (
-
Tenant-Specific Agent: Created a new, runnable
horizon_agentto serve as a sample single-tenant service. -
API Refactoring: The
host_agentnow provides a simple Gradio chat interface for each tenant, removing the need for JSON input. -
Agent Refactoring: The
horizon_agentwas refactored to use the simplegoogle.adk.Agentpattern, resolving aModuleNotFoundError. -
Documentation: All relevant
README.md,spec.md, andsummary.mdfiles have been updated to reflect the new architecture.
Here is a clear, actionable guide for you to run the complete system.
If you have not already, you must install the project's dependencies. This is a critical step to resolve any potential ModuleNotFoundError issues. Run this command from the project root directory:
pip install -e .To run the system, you must start all the services and agents in the following order. Open a separate terminal for each of the following commands and run them from the project root directory.
Terminal 1: Start the Identity Provider (IDP)
python -m idp.appTerminal 2: Start the Demo Agent Registry
python -m demo_agent_registry.appTerminal 3: Start the Weather Agent
python -m weather_agentTerminal 4: Start the Calendar Agent
python -m calendar_agentTerminal 5: Start the Horizon Agent for Tenant 'tenant-abc'
python -m horizon_agent --port 10008 --tenant-id tenant-abcTerminal 6: Start the Airbnb Agent
python -m airbnb_agentTerminal 7: Start the Host Agent
python -m host_agent --port 8083 --tenant-id tenant-abcOnce all agents are running, you can interact with the system via the Gradio UI for the host agent.
- Open your browser to http://localhost:8083
Now, try to access a secure agent. For example, ask:
What is the status of my order 123?
Since this is the first time you are accessing the horizon_agent for tenant-abc, the host_agent will initiate the OAuth 2.0 flow. You will be redirected to the IDP to log in. After you log in, you will be redirected back to the host agent, and your request will be automatically resumed and processed.