How faiyazazam/agentic-travel-planner works
1. Overall shape
- This is a Python travel-planning system built around two paths: an offline content/indexing path and an online planning path.
- The runtime user experience is a Streamlit app that calls an agentic planner backed by a local FAISS vector store and city/domain markdown content.
2. User-facing boundary
- planner_app.py is the presentation layer.
- It gathers user inputs such as destination, dates, interests, and budget, then hands those inputs to the planning logic.
- The app is the only obvious UI boundary; everything else is backend logic or data.
3. Core orchestration layer
- travel_agent_task.py is the main orchestration module.
- It likely coordinates the LLM/agent workflow, decides what information to retrieve, and assembles the final itinerary or travel report.
- This is the main “brain” of the system and the point where retrieval, prompt construction, and response generation meet.
4. Retrieval layer and knowledge base
- The project uses RAG with a local FAISS index stored under data/faiss_index/.
- The corpus being embedded comes from data/rag_docs/ plus the city-specific folders like Bangkok/, Milan/, New York/, Paris/, Prague/, Rome/, and Tokyo/.
- These files act as the grounded knowledge source for itinerary generation and travel guidance.
5. Indexing / ingestion pipeline
- build_vector_store.py builds the FAISS store from the local markdown content.
- sample_db_creation.py appears to initialize or populate a sample RAG dataset, likely for demos or first-time setup.
- This preprocessing step is separate from runtime so the app can work with a local, prebuilt retrieval index.
6. Content organization
- The data/rag_docs/ folder contains reusable travel knowledge such as cuisine guidance, safety tips, itinerary templates, and top destinations.
- The city folders contain city-specific reports, guides, and travel plans that function as localized reference material and/or sample outputs.
- This makes the knowledge base hierarchical: general travel guidance + destination-specific documents.
7. Formatting and plan composition
- travel_plan_utils.py likely handles structure, formatting, and normalization of the generated itinerary.
- This is where raw agent output is turned into a readable travel plan or report with consistent sections.
- It acts as the post-processing boundary between generation and final presentation.
8. Data flow at runtime
- User input enters the Streamlit app.
- The app passes the request to the agent layer.
- The agent retrieves relevant context from the FAISS index.
- Retrieved context plus user preferences are sent to the LLM/agent backend.
- The response is formatted into the final travel plan and returned to the UI.
9. External dependency boundary
- The repo suggests an external model/API integration configured through .env for credentials and environment settings.
- The retrieval system is local, but text generation depends on an external LLM service or model runtime.
- That split is important architecturally: local knowledge + external reasoning/generation.
10. Persistence and artifacts
- data/faiss_index/index.faiss and index.pkl are persistent runtime artifacts that make retrieval fast and repeatable.
- The generated markdown files in the city folders also serve as durable outputs or source material.
- This means the system is not purely ephemeral; it has a stored knowledge and output layer.
11. Operational model
- The application is designed to work largely offline for retrieval, with a local corpus and vector index.
- The main online dependency is the model call, not the search/index layer.
- That makes the architecture suitable for low-latency, repeatable planning workflows.
12. Architecture summary for a diagram
- Draw four main blocks: Streamlit UI, Agent/Planner Core, FAISS Retrieval + Local Docs, and LLM/API Backend.
- Surround them with two supporting blocks: Indexing/Build Scripts and Stored Travel Content/Artifacts.
- The key flow is: user request → agent orchestration → retrieval from local corpus → generation via model → formatted travel plan output.
Main entry points: travel_agent_task.py Travel Agent · build_vector_store.py Build Index · rag_docs General Docs · faiss_index FAISS Index
Components 16
User Interface
Streamlit entrypoint for trip planning.
- Planner App · Collects trip preferences and starts the planning flow.
planner_app.py
Planning Core
Agent orchestration and output shaping.
- Travel Agent · Coordinates retrieval, prompting, and itinerary generation.
travel_agent_task.py - Plan Utils · Normalizes and formats raw agent output into a readable plan.
travel_plan_utils.py
Knowledge Base
Local documents and vector index used for retrieval.
- General Docs · Reusable travel guidance such as cuisine, safety, and itinerary templates.
data/rag_docs - FAISS Index · Persistent local retrieval index for similarity search.
data/faiss_index - City Content · City-specific guides, reports, and travel plans across destination folders.
- Bangkok · Bangkok guide, report, and travel plan artifacts.
Bangkok - Milan · Milan guide, report, and travel plan artifacts.
Milan - New York · New York guide, report, and travel plan artifacts.
New York - Paris · Paris guide, report, and travel plan artifacts.
Paris - Prague · Prague guide, report, and travel plan artifacts.
Prague - Rome · Rome guide, report, and travel plan artifacts.
Rome - Tokyo · Tokyo guide, report, and travel plan artifacts.
Tokyo
Indexing Pipeline
Offline build and sample data preparation.
- Build Index · Builds the FAISS store from local travel content.
build_vector_store.py - Sample Data · Populates or initializes demo RAG content and index data.
sample_db_creation.py
External Services
Model or API dependency used for generation.
- LLM Backend · External generation service or model runtime used by the agent.
Connections 18
- Planner App → Travel Agent: user request · Trip preferences flow from the UI into the planner core.
- Travel Agent → FAISS Index: retrieve · Agent queries the local vector store for relevant context.
- Travel Agent → General Docs: grounding · Agent uses reusable travel guidance as shared context.
- Travel Agent → City Content: destination context · Agent pulls destination-specific material for the chosen city.
- Travel Agent → LLM Backend: generate · Agent sends prompts and retrieved context to the model backend.
- Travel Agent → Plan Utils: format · Generated content is normalized into the final travel plan.
- Build Index → General Docs: ingest · General travel docs are embedded into the index build.
- Build Index → City Content: ingest · City folders contribute destination-specific content to the index.
- Build Index → FAISS Index: persist · The indexing pipeline writes the reusable FAISS artifacts.
- Sample Data → General Docs: seed · Sample setup draws from reusable travel documents.
- Sample Data → FAISS Index: initialize · Sample setup can populate or refresh the local index artifacts.
- City Content → Bangkok: includes · Destination corpus includes Bangkok artifacts.
- City Content → Milan: includes · Destination corpus includes Milan artifacts.
- City Content → New York: includes · Destination corpus includes New York artifacts.
- City Content → Paris: includes · Destination corpus includes Paris artifacts.
- City Content → Prague: includes · Destination corpus includes Prague artifacts.
- City Content → Rome: includes · Destination corpus includes Rome artifacts.
- City Content → Tokyo: includes · Destination corpus includes Tokyo artifacts.