Skip to content

whitebumblebee/chakshu_travels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 AI Travel Agent - Chakshu

A Google ADK travel planning agent with multi-agent orchestration, following official ADK patterns and best practices.

πŸ—οΈ Architecture

Root Agent Orchestrator Pattern

TravelPlanningOrchestrator (Root Agent)
β”œβ”€β”€ ItineraryPlanningAgent (Child Agent)
β”‚   └── Tools: ActivitySearch, DestinationInfo, TravelTips
β”œβ”€β”€ DataAggregationAgent (Child Agent)
β”‚   └── Tools: FlightSearch, HotelSearch, ActivitySearch
└── Coordination Logic & Workflow Management

ADK Project Structure

exchange/
β”œβ”€β”€ agent.py                    # Root agent entry point
β”œβ”€β”€ adk.yaml                   # ADK configuration
β”œβ”€β”€ agents/
β”‚   β”œβ”€β”€ __init__.py            # Base agent classes
β”‚   β”œβ”€β”€ orchestrator.py        # Root orchestrator agent
β”‚   β”œβ”€β”€ itinerary_agent.py     # Itinerary planning child agent
β”‚   └── data_aggregator.py     # Data aggregation child agent
β”œβ”€β”€ tools/
β”‚   └── __init__.py            # SerpApi tool implementations
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── settings.py            # Configuration management
β”œβ”€β”€ requirements.txt           # Minimal ADK dependencies
β”œβ”€β”€ test_adk_agent.py         # ADK agent testing
└── README.md                 # This file

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Google ADK installed: pip install google-adk
  • SerpApi account (free tier)
  • Google AI Studio API key (free)

1. Setup Environment

cd <dir>/exchange

# Install dependencies
pip install -r requirements.txt

# Set required API keys
export SERPAPI_KEY="your_serpapi_key_here"
export GOOGLE_AI_API_KEY="your_google_ai_key_here"

2. Verify Setup

# Test ADK agent structure and functionality
python test_adk_agent.py

3. Run with ADK Commands

# Start web interface (recommended)
adk web

# Or run in terminal mode
adk run

# Or run specific queries
adk run "Plan a 5-day trip to Tokyo for 2 people"

πŸ€– Agent Architecture Details

Root Orchestrator Agent

The TravelPlanningOrchestrator is the root agent that:

  • Parses user intent and requirements
  • Plans optimal workflows using child agents
  • Coordinates multi-agent execution
  • Synthesizes results into coherent responses
  • Maintains conversation state and context

Child Agent Coordination

  • ItineraryPlanningAgent: Creates detailed day-by-day travel plans
  • DataAggregationAgent: Aggregates data from multiple sources in parallel
  • Tool Integration: Each agent uses specialized tools for specific tasks

ADK Patterns Used

βœ… LlmAgent inheritance with proper initialization
βœ… Tool classes extending ADK Tool base class
βœ… Agent coordination through the orchestrator pattern
βœ… Async workflow execution with proper error handling
βœ… Configuration management following ADK conventions
βœ… Project structure matching ADK standards

πŸ› οΈ How It Works

1. User Request Processing

# User: "Plan a week in Paris for art lovers"
intent = await orchestrator._parse_travel_intent(message)
# β†’ {type: "plan_trip", destination: "Paris", duration: "1 week", interests: ["culture", "art"]}

2. Workflow Planning

workflow = await orchestrator._plan_agent_workflow(intent)
# β†’ Determines which child agents to use and in what order

3. Agent Coordination

# Orchestrator coordinates child agents:
data_result = await data_aggregator.aggregate_travel_data(travel_request)
itinerary_result = await itinerary_agent.create_itinerary(params)

4. Response Synthesis

response = await orchestrator._synthesize_response(results, intent)
# β†’ Creates comprehensive, personalized travel plan

🎯 Example Interactions

Complete Trip Planning

User: "Plan a 5-day trip to Tokyo for 2 people interested in culture and food"

Agent Response:
🌍 I've created a comprehensive travel plan for Tokyo!
πŸ“… Duration: 5 days for 2 travelers

πŸ“‹ Your Itinerary:
Day 1 - Culture:
  β€’ Morning: Explore Tokyo - Traditional temples and shrines
  β€’ Afternoon: Main cultural attraction visit
  β€’ Evening: Local dining and culture

Day 2 - Food:
  β€’ Morning: Tokyo food markets and street food
  β€’ Afternoon: Cooking class or food tour
  β€’ Evening: Traditional restaurant experience

[...continues with full itinerary...]

πŸ’‘ Recommendations:
β€’ ✈️ Flight options are available - book early for better prices
β€’ 🏨 Multiple accommodation options found - compare amenities
β€’ 🎯 Great activities available - plan 2-3 per day for best experience

Specific Searches

User: "Find flights from NYC to Tokyo"

Agent Response:
πŸ” Here's what I found for flights in Tokyo:
✈️ JetBlue Airways - New York to Tokyo
   Compare prices across 500+ travel sites to find...
   πŸ”— https://www.jetblue.com/...

✈️ American Airlines - JFK to NRT
   Find the best deals on flights from New York to Tokyo...
   πŸ”— https://www.aa.com/...

Plan Modifications

User: "Add more museums to my Tokyo itinerary"

Agent Response:
βœ… I've updated your travel plan based on your request!
πŸ”„ Modification: museums

[Updated itinerary with more cultural attractions...]

πŸ§ͺ Testing & Validation

Run Tests

# Complete system test
python test_adk_agent.py

# Expected output:
🌍 ADK Travel Agent - System Tests
=====================================
βœ… Environment: PASS
βœ… Project Structure: PASS
βœ… Imports: PASS
βœ… Agent Functionality: PASS
βœ… Child Agent Coordination: PASS

🎯 Overall: 5/5 tests passed
πŸš€ All tests passed! Your ADK Travel Agent is ready.

Manual Testing

# Test with various queries
adk run "What are the best activities in Barcelona?"
adk run "Find budget hotels in Rome for next week"
adk run "Create a cultural itinerary for Prague"

πŸ“Š ADK Configuration

adk.yaml

name: ai-travel-agent
version: 1.0.0
description: Intelligent travel planning assistant using Google ADK

agent:
  module: agent
  class: agent

environment:
  python_version: ">=3.8"

env_vars:
  - SERPAPI_KEY
  - GOOGLE_AI_API_KEY

web:
  port: 8000
  host: "0.0.0.0"

πŸ”§ Development

Adding New Agents

# 1. Create new agent class
class NewTravelAgent(TravelLlmAgent):
    def __init__(self):
        super().__init__(
            name="new_agent",
            description="Specialized agent for X"
        )

# 2. Add to orchestrator
self.new_agent = NewTravelAgent()

# 3. Include in workflow coordination

Adding New Tools

# 1. Extend SerpApiSearchTool
class NewSearchTool(SerpApiSearchTool):
    def __init__(self):
        super().__init__()
        self.name = "new_search"

    async def execute(self, query: str) -> str:
        # Tool implementation
        pass

# 2. Add to relevant agent's tools list

🚨 Troubleshooting

Common Issues

"Configuration Error" on startup:

# Ensure API keys are set
export SERPAPI_KEY='your_key_here'
export GOOGLE_AI_API_KEY='your_key_here'

"Module not found" errors:

# Ensure ADK is installed
pip install google-adk

# Check project structure
python test_adk_agent.py

Agent not responding:

# Verify agent structure
adk validate  # If available

# Check logs
adk run --debug "test message"

Debug Mode

# Run with verbose logging
adk web --debug --log-level=debug

# Test individual components
python -c "from agent import agent; print(agent.name)"

πŸŽ–οΈ Good Stuff about the implementation

Follows ADK Best Practices

βœ… Proper agent inheritance using LlmAgent base class
βœ… Tool pattern with ADK Tool base class
βœ… Root agent orchestrator coordinates child agents
βœ… Async patterns for proper workflow execution
βœ… Configuration structure matching ADK conventions
βœ… Project layout following ADK standards

Multi-Agent Coordination

βœ… Clear separation of concerns between agents
βœ… Workflow orchestration through the root agent
βœ… Parallel execution of independent tasks
βœ… State management and conversation context
βœ… Error handling and graceful degradation

Production Ready Features

βœ… Proper testing and validation framework
βœ… Configuration management with environment variables
βœ… Comprehensive documentation and examples
βœ… ADK command support (adk web, adk run)
βœ… Extensible architecture for adding new capabilities


About

An ai agent to plan your travel for you

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published