Skip to content

About

A RAG-powered travel assistant giving hyper-local recommendations with source-attributed answers. Python, LangChain, Groq (llama-3.1-8b-instant), ChromaDB, and Streamlit — runs offline-first with custom PDF/TXT upload.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

🧭 Local Tourism Bot

A hyper-local AI cultural guide for travelers — powered by RAG (Retrieval-Augmented Generation), Groq LLM, ChromaDB, and Streamlit.


✨ Features

Feature Description
💎 Hidden Gems Off-the-beaten-path spots locals love
🙏 Cultural Etiquette Dress codes, customs, behavior tips
🚌 Transit Guide Metro, bus, auto, cab navigation
🍜 Local Food Street food, must-try dishes, best spots
🌅 Time-Based Tips Morning, afternoon, evening, night experiences
📂 Document Upload Upload your own PDF/TXT travel guides
💬 Chat Memory Session-based conversation history
🎨 Theme Toggle Dark and Light UI modes
📚 Source Display Expandable source attribution per answer
♻️ Reset Button Clear vector store and re-index

🧱 Tech Stack

  • LLM: Groq API (llama-3.1-8b-instant) — fast, free tier
  • Embeddings: TF-IDF (built-in, zero downloads, works offline)
  • Vector DB: ChromaDB (persisted to ./chroma_db/)
  • Framework: LangChain + Streamlit
  • Document Loaders: PyPDF + TextLoader

📁 Project Structure

local_tourism_bot/
├── app.py                        ← Main Streamlit app (entry point)
├── requirements.txt
├── .env                          ← Your API key (never commit this)
├── README.md
│
├── core/
│   ├── rag_pipeline.py           ← Full RAG pipeline
│   ├── embeddings.py             ← TF-IDF embedding (zero-download)
│   ├── retriever.py              ← ChromaDB vector store manager
│   └── llm_client.py             ← Groq LLM client (swappable)
│
├── ui/
│   ├── components.py             ← Chat bubbles, buttons, expanders
│   └── styles.py                 ← Dark/Light CSS themes
│
├── utils/
│   ├── file_loader.py            ← PDF/TXT loaders + upload handler
│   └── text_splitter.py          ← Chunking logic
│
└── data/
    └── sample_docs/
        ├── bangalore_guide.txt   ← Pre-loaded Bangalore guide
        └── delhi_guide.txt       ← Pre-loaded Delhi guide

🚀 Setup — Step by Step

Step 1 — Prerequisites


Step 2 — Navigate to project folder

cd local_tourism_bot

Step 3 — Create virtual environment (recommended)

# Create
python -m venv venv

# Activate — Windows
venv\Scripts\activate

# Activate — macOS / Linux
source venv/bin/activate

Step 4 — Install dependencies

pip install -r requirements.txt

✅ No model downloads. All dependencies install in under a minute.


Step 5 — Set your API key

Edit .env in the project root:

GROQ_API_KEY=your_actual_key_here

Get a free key at: https://console.groq.com/keys


Step 6 — Run

streamlit run app.py

Opens at: http://localhost:8501


🖱️ UI Guide — Every Button Explained

Button / Control Location What it does
🌙 Dark / ☀️ Light Sidebar → Theme Switches between dark and light CSS themes
Region selector dropdown Sidebar Prepends city context to every query
📂 Upload files Sidebar Uploads PDF/TXT and indexes instantly
🗑️ Clear Chat History Sidebar Clears all chat messages
♻️ Reset Vector Store Sidebar Deletes ChromaDB, clears index, ready to re-index
💎 Hidden Gems Main quick buttons Asks for hidden/off-beat spots
🍜 Local Food Main quick buttons Asks for must-try local dishes
🙏 Cultural Tips Main quick buttons Asks for etiquette and customs
🚌 Transit Guide Main quick buttons Asks for transport and navigation tips
🌅 Morning Tips Main quick buttons Asks for morning-specific activities
🌃 Evening & Night Main quick buttons Asks for evening and night experiences
📚 View Sources Under bot replies Expands to show retrieved document passages
Chat input box Bottom of page Type any custom question

⚙️ Swap the LLM

Edit core/llm_client.py:

# Options (all free on Groq):
"llama-3.1-8b-instant"      # Fast, default
"llama-3.3-70b-versatile"   # More capable
"mixtral-8x7b-32768"        # Strong reasoning

🔧 Troubleshooting

Problem Solution
GROQ_API_KEY not found Check .env file exists with your key
No module named 'chromadb' Run pip install -r requirements.txt
Answers seem off-topic Click ♻️ Reset Vector Store, restart app
Port in use streamlit run app.py --server.port 8502
Quick buttons not responding Reload page (F5) and try again

🌍 Adding More Cities

Drop any .txt or .pdf into data/sample_docs/. The bot auto-indexes it on the next startup. Or use the Upload button to add files without restarting.

About

A RAG-powered travel assistant giving hyper-local recommendations with source-attributed answers. Python, LangChain, Groq (llama-3.1-8b-instant), ChromaDB, and Streamlit — runs offline-first with custom PDF/TXT upload.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages