Skip to content

Repository files navigation

Trip Planner Agent

A multi-agent travel planning system built with LangChain + LangGraph + RAG + Vectorless RAG + Guardrails + Evals, running locally on Ollama, with a Streamlit UI.

What it does

Given a destination, number of days, budget, and preferences (e.g. "beaches and food, no water sports"), a LangGraph supervisor coordinates three specialized agents:

  1. Booking agent — a ReAct agent with search_flights/search_hotels tools that decides what to look up and picks a flight + hotel that fit the budget and preferences, not just the cheapest option (Vectorless RAG — SQL search, tool-driven)
  2. Activity agent — a ReAct agent with a search_activities tool that retrieves and curates activity/food recommendations from local travel-guide docs, respecting excluded activities (RAG — vector search, tool-driven)
  3. Budget critic — reviews the drafted itinerary and gives specific, actionable feedback (not just pass/fail) that steers the next attempt if the plan needs revision, up to a retry limit (LangGraph conditional loop)

A hard numeric budget check always backstops the critic's LLM judgment, and separate input/output guardrails check the request and final plan for safety/constraint violations. The whole pipeline can be scored against a test set of scenarios (Evals).

Project structure

trip-planner-agent/
├── app.py                # Streamlit UI (run this)
├── graph.py               # LangGraph supervisor (booking agent → activity agent → generate → budget critic → finalize)
├── agents.py               # Booking agent, activity agent, budget critic (ReAct agents + reasoning)
├── tools.py                 # LangChain tool wrappers around rag.py / vectorless_rag.py
├── rag.py                 # Vector RAG over travel guide markdown docs
├── vectorless_rag.py      # SQL-based retrieval over flights/hotels
├── guardrails.py          # Input + output guardrail checks
├── evals.py                # Eval harness with test scenarios
├── setup_data.py           # Creates the mock SQLite DB + sample travel guides
├── requirements.txt
└── data/
    ├── travel.db            # created by setup_data.py
    └── travel_guides/*.md   # sample docs for RAG

Setup

  1. Install Ollama and pull the models used:

    ollama pull llama3
    ollama pull nomic-embed-text
  2. Install Python dependencies:

    cd trip-planner-agent
    pip install -r requirements.txt
  3. Generate the mock data (SQLite DB + sample travel guide docs):

    python setup_data.py
  4. Run the app:

    streamlit run app.py
  5. Run evals (separately, from the command line):

    python evals.py

Notes

  • Swap llama3 / nomic-embed-text for any Ollama models you already have pulled — just update the model names in graph.py, rag.py.
  • The SQLite flights/hotels data and the travel guide markdown docs are all placeholder/mock data — replace with real data or a real API as a next step.
  • guardrails.py uses simple rule-based checks to keep the demo fast/offline. Swap in an LLM-as-judge guardrail for stricter checking.

About

A local, multi-agent travel planning system — LangChain + LangGraph (booking agent, activity agent, budget critic) + RAG + Vectorless RAG + guardrails + evals, running entirely offline on Ollama.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages