This project demonstrates a sophisticated multi-agent system built with the Google ADK framework. The main agent acts as a friendly food ordering concierge that orchestrates specialist sub-agents to help users browse menus, place orders, and process payments.
For a detailed breakdown of the agent's conversation, see the following documents:
- Dialogue Transcript: A detailed transcript of the conversation.
- Sequence Diagram: A Mermaid sequence diagram visualizing the interactions between the user and the agents.
The system is composed of several key components:
- Orchestrator Agent (
agent.py): The main agent that manages the overall conversation and delegates tasks to the appropriate sub-agent. - Menu Agent (
menu_agent.py): A specialist sub-agent for browsing restaurant menus and managing a food order. - Payment Agent (
payment_agent.py): A specialist sub-agent for handling credit card payments. - RAG Ingestion Engine (
rag_ingestion_engine/): A modular system for loading and processing data. In this project, it's used to load a list of contacts fromnumbers.json. - Centralized Configuration:
- Prompts (
prompts.py): All agent instructions are centralized in this file for easy maintenance. - Models (
config.py): The Gemini model names used by the agents are defined here, allowing for easy switching and configuration.
- Prompts (
This project demonstrates several key concepts in building sophisticated, multi-agent systems:
- Agent Orchestration: The
root_agentacts as an orchestrator, delegating tasks to specialized sub-agents (menu_agent,payment_agent). This is a powerful pattern for building complex, maintainable agents. - RAG (Retrieval-Augmented Generation): The agent uses a RAG engine to retrieve restaurant and menu information from a JSON file, demonstrating how to ground an agent's responses in external data.
- Payment Processing: The
payment_agentshowcases how to integrate with external systems (in this case, a mock Square API) to perform actions like processing payments. - State Management: Agents maintain persistent state throughout conversations using
ToolContext. Themenu_agenttracks order items, quantities, and totals, while thepayment_agentmanages payment status (pending, completed, failed) and transaction details. - Automatic Upselling: The menu system proactively suggests relevant combos and upsell items after each menu item is added to the order, encouraging customers to spend more without being asked.
- Centralized Prompts and Configuration: All prompts and model configurations are stored in dedicated files, making the system easy to maintain and update.
Follow these steps to set up and run the agent.
This project uses Poetry for dependency management. To install the required libraries, run:
poetry installYou need to provide a Google API key for the agent to function correctly.
- Create a file named
.envin themulti-tool-agentdirectory. - Add your API key to the file like this:
GOOGLE_API_KEY="your_gemini_api_key_here"
- Load the environment variables into your shell session by running:
source multi-tool-agent/.envThe Google ADK framework provides a web server to interact with the agent. To run the agent, use the following command:
make runThis will start a local web server. You can open the provided URL in your browser to chat with the agent.
If you encounter issues with outdated cached files, you can clean the project by running the make clean command. This will remove all __pycache__ directories.
make clean