This project implements a stateful, multi-agent system using Google ADK and exposes selected capabilities via an MCP server so multiple users (or agents) can interact with each other’s agents.
The system supports:
- Recipe recommendation
- Ingredient shopping planning
- Wallet-based checkout simulation
- Agent-to-agent access using MCP
- RootAgent is a pure orchestrator (no tools)
- Sub-agents own tools and logic
- Stateful tools manage selections, pantry, and wallet
- Stateless tools handle extraction, search, ranking
- SequentialAgent is used where execution order matters (checkout)
| Agent | Responsibility |
|---|---|
| RootAgent | Routes user intent to the correct sub-agent |
| RecipeAgent | Extracts preferences, searches & recommends recipes |
| ShoppingAgent | Computes missing ingredients & shopping plans |
| WalletPayAgent | Simulates wallet payment lifecycle |
| CheckoutFlow | Sequential flow: Shopping → Wallet |
your_project/
├── agents/
│ ├── root_agent.py
│ ├── recipe_agent.py
│ ├── shopping_agent.py
│ ├── wallet_agent.py
│ └── checkout_flow.py
│
├── tools/
│ ├── recipe_tools.py
│ ├── state_tools.py
│ ├── shopping_tools.py
│ └── wallet_tools.py
│
├── state/
│ └── session_store.py
│
├── mcp/
│ └── mcp_server.py
│
├── requirements.txt
└── README.md
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activatepip install -r requirements.txtCreate a .env file:
OPENAI_API_KEY=your_openai_key_here
RECIPE_CSV_PATH=recipes_db.csvDepending on how you run ADK (CLI / web / custom runner), ensure:
# agents/root_agent.py
agent = root_agentRootAgent will automatically route requests to sub-agents.
Stateless tools
- Pure computation
- Safe to retry
- No memory
Examples:
extract_ingredients_from_textsearch_recipesrank_recipes
Stateful tools
- Read/write session state
- Affect future behavior
Examples:
select_recipeupdate_pantrywallet_authorize_purchasewallet_capture_purchase
Rule: Stateless tools compute facts. Stateful tools change reality.
The MCP server allows:
- Your friend to call your agent’s tools
- Your RootAgent to call your friend’s agent
python -m mcp.mcp_serverServer runs at:
http://localhost:8000/mcp
npx -y @modelcontextprotocol/inspector- Each user runs their own MCP server
- RootAgent can treat remote MCP tools as external capabilities
- Enables collaborative agent ecosystems
This MCP setup is for development only.
If exposed publicly:
- Add authentication headers
- Use a reverse proxy
- Never expose wallet endpoints without auth
- In-memory session state (resets on restart)
- Mock shopping inventory
- Simulated wallet (no real payments)
- Single-process concurrency only
- No private ADK internals used
- RootAgent does orchestration only
- SequentialAgent used only where order matters
- Clean separation of tools vs agents
- MCP isolated from agent logic
Standard MIT License