A sophisticated multi-agent workflow built with Google's Agent Development Kit (ADK) that demonstrates the power of specialized AI agents working together to solve complex travel planning tasks.
Instead of building one monolithic "super agent," this system employs a team of specialized AI agents, each expert in their domain:
All basic agents are consolidated in subagent.py:
-
FlightAgent - Flight booking specialist
- Handles flight searches and bookings
- Returns structured JSON with flight details
- Makes reasonable assumptions when details are missing
-
HotelAgent - Hotel booking specialist
- Manages hotel searches and reservations
- Provides accommodation details in JSON format
- Handles various room types and booking preferences
-
SightseeingAgent - Tourism specialist
- Recommends top 2 attractions per destination
- Provides timing and relevant details
- Focuses on must-see locations
-
TripSummaryAgent - Summary compilation specialist
- Compiles trip details into comprehensive itinerary
- Creates structured travel summaries
- Formats information for easy reading
Each orchestration agent has its own folder with a dedicated agent.py:
-
SimpleAgent (
simple/) - Basic trip coordinator- Simple sub-agent coordination pattern
- Direct management of flight, hotel, and sightseeing agents
- Perfect for straightforward trip planning
-
DispatcherAgent (
dispatcher/) - Intelligent request router- Analyzes requests and routes to appropriate specialists
- Uses agent tools for flexible coordination
- Handles simple to complex multi-step requests
-
ParallelAgent (
parallel/) - Efficiency optimizer- Runs flight and hotel agents in parallel for speed
- Sequential execution: sightseeing β parallel(flight+hotel) β summary
- Maximizes efficiency for independent flight and hotel tasks
-
SelfCriticAgent (
self_critic/) - Quality assurance specialist- Same parallel execution as ParallelAgent (flight+hotel in parallel)
- Adds quality control: trip summary reviewer and validator
- Ensures output meets quality standards before delivery
- Parallel Execution: Flight and hotel bookings run concurrently for efficiency
- Sequential Orchestration: Dependent tasks execute in logical order
- Feedback Loops: Built-in quality assurance and validation
- State Management: Agents communicate through shared session state
- Python 3.8+
- Google API Key for Gemini models
-
Clone and navigate to the project:
git clone <repository-url> cd adk_workflows
-
Create and activate virtual environment:
# Create virtual environment python -m venv venv # Activate virtual environment # On macOS/Linux: source venv/bin/activate # On Windows: # venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment:
# Copy environment template cp env.example .env # Edit .env and add your Google API key # Get your key from: https://aistudio.google.com/app/apikey
-
Launch the web interface:
adk web
This will open a web interface where you can choose and test any of the available agents.
# Required
GOOGLE_API_KEY=your_google_api_key_here
MODEL_NAME=gemini-2.0-flash
# Optional
ENVIRONMENT=development
LOG_LEVEL=INFOOnce you've completed the installation steps, simply run:
adk webThis opens a web interface where you can:
- Select any of the 4 orchestration agents (Simple, Dispatcher, Parallel, Self-Critic)
- Test different types of trip planning requests
- See how each agent handles various scenarios
- Simple: "Find me a flight to Paris"
- Complex: "Book a flight to Paris and find a hotel near the Eiffel Tower"
- Comprehensive: "Plan a 3-day trip to Tokyo with flights, accommodation, and sightseeing"
- Purpose: Specialized flight booking and information
- Input: Flight preferences, dates, destinations
- Output: JSON with flight details, prices, booking status
- Features: Intelligent assumptions for missing details
- Purpose: Hotel booking and accommodation management
- Input: Location, dates, room preferences
- Output: JSON with hotel details, pricing, availability
- Features: Room type optimization, location-based suggestions
- Purpose: Tourism recommendations and itinerary planning
- Input: Destination, interests, duration
- Output: JSON with top 2 attractions, timings, details
- Features: Curated recommendations, practical timing info
- Purpose: Quality assurance and trip compilation
- Components:
- TripSummaryAgent: Compiles comprehensive itinerary
- TripSummaryReviewer: Quality check and validation
- ValidateTripSummary: Final approval and feedback
- Output: Validated, complete travel itinerary
TripPlanner (root_agent) β Coordinates FlightAgent + HotelAgent + SightseeingAgent
DispatcherAgent β Analyzes request β Routes to appropriate tools β Compiles response
SightseeingAgent β FlightAgent + HotelAgent (parallel) β TripSummaryAgent
SightseeingAgent β FlightAgent + HotelAgent (parallel) β TripSummaryAgent β Reviewer β Validator
adk_workflows/
βββ subagent.py # All core agents (flight, hotel, sightseeing, trip_summary)
βββ simple/
β βββ agent.py # Basic trip coordinator
βββ dispatcher/
β βββ agent.py # Intelligent request router
βββ parallel/
β βββ agent.py # Parallel execution optimizer
βββ self_critic/
β βββ agent.py # Quality assurance workflow
βββ requirements.txt # Dependencies
βββ env.example # Environment template
βββ README.md # Documentation
βββ SETUP_INSTRUCTIONS.md # Setup guide
Core Agents:
- Add your new core agent to
subagent.py - Import and use in orchestration agents as needed
Orchestration Agents:
- Create a new folder:
new_orchestrator/ - Add
agent.pywith your orchestration logic - Import core agents from
subagent.py
- Specialization: Each agent excels in its specific domain
- Scalability: Easy to add new agents or modify existing ones
- Maintainability: Clear separation of concerns
- Efficiency: Parallel execution for independent tasks
- Quality: Built-in review and validation processes
- Flexibility: Modular design allows easy customization
- Fork the repository
- Create a feature branch
- Add your specialized agent or enhancement
- Update documentation
- Submit a pull request
[Add your license information here]
For issues and questions:
- Open an issue in the repository
- Check the Google ADK documentation
- Review the agent implementation examples
Built with Google Agent Development Kit (ADK) - Empowering intelligent multi-agent workflows with Gemini.