How nirbar1985/ai-travel-agent works
Main Components
a) User Interface Layer:
• Streamlit frontend application (from app.py)
• User input/output handling
• HTML email preview interface
b) Agent Core Layer:
• LangGraph-based agent system (in agents/agent.py)
• State management system
• LLM orchestration
c) Tools Layer:
• Flights finder module (agents/tools/flights_finder.py)
• Hotels finder module (agents/tools/hotels_finder.py)
d) External Services Layer:
• OpenAI API
• Google Flights API (via SERPAPI)
• Google Hotels API (via SERPAPI)
• SendGrid Email Service
• LangChain API (for observability)
┌─────────────────────────────────────────────────┐
• User Interface │
• (Streamlit Frontend) │
• ┘
• ↕
┌─────────────────────────────────────────────────┐
• Agent Core System │
• ┌───────────────┐ ┌────────────────────────┐ │
• LangGraph │←→│ State Management │ │
• ┘ └────────────────────────┘ │
• ┌───────────────┐ ┌────────────────────────┐ │
• LLM Router │←→│ Human-in-Loop Control │ │
• ┘ └────────────────────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────────┐
• Tools Layer │
• ┌──────────────┐ ┌──────────────┐ │
• Flights Finder│ │Hotels Finder │ │
• ┘ └──────────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────────┐
• External Services │
• ┌────────┐ ┌───────┐ ┌────────┐ ┌─────────┐ │
• OpenAI │ │SERPAPI│ │SendGrid│ │LangChain│ │
• ┘ └───────┘ └────────┘ └─────────┘ │
• ┘
Important Elements to Highlight
• The stateful nature of the agent using LangGraph
• The human-in-the-loop decision points
• The multiple LLM usage pattern
• The email generation and preview workflow
• The integration points with external APIs
Key Interactions
• User input → Agent Core → Tools → External Services
• Agent Core ↔ State Management
• Human-in-Loop Control points
• Email preview and confirmation flow
• API integration points