How aasthajjw/tripmate_ai works
TripMate AI turns a user's travel request into a combined travel plan through a FastAPI web app and a LangGraph agent workflow. The implemented workflow runs flight research, hotel research, itinerary generation, and final response generation in sequence; this differs from the README's illustrative parallel-agent diagram. Flight and hotel research use external services, while Groq supports itinerary and final-response generation. PostgreSQL stores graph checkpoints. The frontend also retains a conversation thread ID and offers copy and PDF-download actions. Unsampled template and styling details are not expanded here.
Main entry points: app.py FastAPI routes · script.js Request and results · backend.py LangGraph workflow · index.html Travel interface
Components 16
Web experience
- Travel interface
templates/index.html - Request and results
static/script.js - FastAPI routes
app.py
Travel workflow
- LangGraph workflow
backend.py - Flight agent
backend.py - Hotel agent
backend.py - Itinerary agent
backend.py - Final response agent
backend.py
Research integrations
- Flight search
tools/flight_tool.py - Hotel search
tools/tavily_tool.py
Conversation persistence
- Postgres checkpointer
backend.py
Other components
- Traveler
- AviationStack
- Tavily search
- Groq LLM
- PostgreSQL
Connections 19
- Traveler → Travel interface: enters request
README.md - Travel interface → Request and results: uses interface logic
- Request and results → FastAPI routes: POST /api/travel
static/script.js - FastAPI routes → Travel interface: renders page
app.py - FastAPI routes → LangGraph workflow: runs request
app.py - LangGraph workflow → Flight agent: starts workflow
backend.py - Flight agent → Hotel agent: dispatches next
backend.py - Hotel agent → Itinerary agent: dispatches next
backend.py - Itinerary agent → Final response agent: dispatches next
backend.py - Flight agent → Flight search: searches flights
backend.py - Flight search → AviationStack: requests flight data
README.md - Hotel agent → Hotel search: searches hotels
backend.py - Hotel search → Tavily search: searches web
tools/tavily_tool.py - Itinerary agent → Groq LLM: generates itinerary
backend.py - Final response agent → Groq LLM: generates response
backend.py - LangGraph workflow → Postgres checkpointer: configures checkpoints
backend.py - Postgres checkpointer → PostgreSQL: persists state
README.md - FastAPI routes → Request and results: returns plan
app.py - Request and results → Traveler: displays plan
static/script.js