A memory-aware agentic travel planning system built on LangGraph โ combining real-time weather data, web search, LLM reasoning, self-evaluation, and conditional re-search to generate personalized, visually enriched travel itineraries.
Main Streamlit dashboard โ destination input, traveler preference sidebar, and the Generate Travel Plan trigger.
Generated itinerary with live weather metrics, traveler profile cards, and the full personalized day-by-day plan.
Curated sightseeing locations enriched with real images from the Pexels API.
Local culinary recommendations with images and descriptions, filtered by diet preference.
Live state machine execution log โ reflection cycles, confidence scores, identified gaps, and research sources.
Click the thumbnail above to watch a full walkthrough of the agentic workflow.
System architecture โ LangGraph StateGraph workflow with conditional reflection loop, external tool integrations, and Streamlit presentation layer.
User Input (Destination + Preferences)
โ
โผ
[LangGraph StateGraph]
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ Initial Collection โ
โ โโ WeatherAPI โ โ Current temperature, humidity, wind, condition
โ โโ Tavily Search โ โ Attractions, local foods, travel tips
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Reflection โ โ LLM evaluates information completeness
โ Engine โ Scores confidence (0โ100%)
โ โ Identifies specific knowledge gaps
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโดโโโโโโโโโ
โ โ
SUFFICIENT INSUFFICIENT (cycle < 2)
โ โ
โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโ
โ โ Query Generator โ โ LLM generates targeted search queries
โ โ + Researcher โ โ Tavily fills identified gaps
โ โโโโโโโโโโโโฌโโโโโโโโโโโ
โ โ
โ โโโโโ loops back to Reflection
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Image Enrichment โ โ Pexels API attaches photos to attractions & foods
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Response Generation โ โ LLM synthesizes personalized Markdown travel guide
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
Streamlit Presentation Layer
โโโ Weather Dashboard
โโโ Traveler Profile Cards
โโโ AI Travel Guide (downloadable)
โโโ Attractions Gallery
โโโ Foods Gallery
โโโ Agent Insights (reflection history + execution log + sources)
- Reflective agentic loop โ the agent evaluates its own information quality before generating a response; if gaps are found, it re-searches automatically
- Confidence scoring โ every reflection cycle produces a 0โ100% confidence score derived from identified knowledge gaps, displayed as a live badge in the UI
- Reflection history timeline โ each cycle's status, confidence, and specific gaps are logged and surfaced in the Agent Insights tab as collapsible expanders
- Memory-aware personalization โ diet, travel style, budget, and transport preferences are stored in session memory and enforced at the prompt level
- Multi-tool data collection โ WeatherAPI for real-time conditions, Tavily Search for discovery and re-research, Pexels API for visual enrichment
- Deduplicated research merging โ research items from multiple cycles are deduplicated before being passed to the LLM, preventing repeated facts
- Clean prompt construction โ only text-relevant fields (name, description) from travel data are sent to the LLM; image URLs and metadata are stripped to reduce token noise
- Downloadable itinerary โ generated Markdown guide can be saved locally with one click
- Session state persistence โ results survive sidebar interactions without re-running the agent
- Research source transparency โ all Tavily sources used across research cycles are listed in the Agent Insights tab
| Component | Technology |
|---|---|
| Frontend | Streamlit |
| Workflow Orchestration | LangGraph (StateGraph) |
| Agent Framework | LangChain |
| Primary LLM | Gemini Flash Lite |
| Secondary LLM | Groq (LLaMA Models) |
| Weather Data | WeatherAPI |
| Web Search & Research | Tavily Search API |
| Image Retrieval | Pexels API |
| Language | Python 3.10+ |
| Environment | Python Virtual Environment |
reflective_travel_assistant/
โ
โโโ streamlit_app.py # Streamlit dashboard โ UI, session state, result rendering
โโโ main.py # CLI entry point
โโโ env # Environment variables (API keys)
โโโ requirements.txt # Python dependencies
โ
โโโ agents/
โ โโโ langgraph_workflow.py # LangGraph StateGraph โ nodes, edges, conditional router
โ โโโ response_generator.py # LLM prompt builder and final guide generator
โ
โโโ tools/
โ โโโ weather_tool.py # WeatherAPI integration โ temperature, humidity, wind
โ โโโ discovery_tool.py # Tavily-powered destination discovery
โ โโโ image_tool.py # Pexels API image enrichment for attractions & foods
โ
โโโ reflection/
โ โโโ reflector.py # LLM-based information evaluator โ status + gap detection
โ
โโโ research/
โ โโโ query_generator.py # LLM generates targeted queries for identified gaps
โ โโโ researcher.py # Executes Tavily searches for additional information
โ
โโโ memory/
โ โโโ session_memory.py # In-session traveler preference store
โ
โโโ llms/
โ โโโ router.py # LLM provider selector
โ
โโโ utils/
โ โโโ parser.py # LLM response text extractor
โ
โโโ assets/
โ โโโ styles.css # Custom Streamlit CSS
โ โโโ architecture.png # System architecture diagram
โ โโโ screenshots/ # README screenshots
โ
โโโ README.md
git clone https://github.com/your-username/reflective-travel-assistant.git
cd reflective-travel-assistantpython -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txtCreate a file named env in the project root and add your API keys:
GEMINI_API_KEY=your_gemini_api_key_here
GROQ_API_KEY=your_groq_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
WEATHER_API_KEY=your_weatherapi_key_here
PEXELS_API_KEY=your_pexels_api_key_herestreamlit run streamlit_app.pyOpen http://localhost:8501 in your browser.
| Service | Free Tier | Link |
|---|---|---|
| Gemini | Yes (generous limits) | aistudio.google.com |
| Groq | Yes (fast inference) | console.groq.com |
| Tavily | Yes (1,000 searches/month) | tavily.com |
| WeatherAPI | Yes (1M calls/month) | weatherapi.com |
| Pexels | Yes (unlimited, rate-limited) | pexels.com/api |
This is the core distinguishing feature of the system. Unlike a standard single-pass assistant:
- Initial collection โ weather and destination data are fetched in parallel via tool calls.
- Reflection โ the LLM reads all collected data and answers: "Is this enough to generate a complete, personalized travel guide?" It produces a
SUFFICIENTorINSUFFICIENTverdict along with a list of specific missing topics (e.g.,transportation options,seasonal events,winter packing advice). - Conditional branch โ if
INSUFFICIENTand the cycle count is below the limit, the agent generates targeted search queries for exactly the missing topics and re-searches. - Cycle cap โ the loop runs at most 2 reflection cycles to prevent runaway API consumption. If the cap is hit, the agent proceeds with whatever it has and notes this in the execution log.
- Confidence score โ each cycle emits a
0โ100%confidence score (1.0 โ gaps ร 0.2) so the UI can signal data quality to the user.
This means the final guide is always grounded in verified, sufficiently complete data โ not a best-guess single-pass output.
The Agent Insights tab exposes the full internal execution trace, making the system auditable rather than a black box:
| Section | What it shows |
|---|---|
| Reflection History | Every cycle's verdict, confidence %, and specific gaps found โ as collapsible expanders |
| Execution Log | Chronological step-by-step log of every node that ran |
| Research Sources | All Tavily source URLs gathered across re-search cycles |
The generated Markdown travel guide includes:
- Traveler Profile โ recap of all active preferences
- Destination Overview โ culturally grounded introduction
- Current Weather & Packing Tips โ conditions + practical clothing advice
- Top Attractions โ grounded in discovered data, not invented
- Must-Try Local Foods โ filtered by diet preference where applicable
- Transportation Advice โ tailored to the selected transport preference
- Seasonal Highlights โ month-specific events and conditions
- Suggested Itinerary โ realistic day-by-day plan scaled to trip duration
- Travel Tips & Warnings โ safety, customs, health, and scam awareness
- Persistent long-term memory (ChromaDB) for cross-session preference recall
- Hotel and restaurant recommendation sub-agents
- Budget estimation tool with cost breakdowns per day
- Interactive map integration (Folium / Google Maps embed)
- PDF itinerary export with images
- Multi-agent architecture โ separate researcher, critic, and formatter agents
- Structured tracing with Langfuse or OpenTelemetry
- LangGraph StateGraph design โ typed state, annotated reducers, conditional edges, and loop-back patterns
- Reflective agentic reasoning โ self-evaluation and conditional re-search from first principles
- Multi-tool orchestration โ three independent external APIs coordinated within a single graph
- Memory-aware personalization โ session state driving prompt-level behavior, not just UI display
- Production-grade prompt engineering โ separated prompt builder, text-only serialization of structured data, and explicit personalization rules
- Modular Python architecture โ each concern (reflection, research, images, LLMs) is an isolated module with a single responsibility
- Transparent AI systems โ full execution trace and confidence scoring surfaced to the end user
This project is intended for educational and portfolio purposes.





