An open-source, local-first Retrieval-Augmented Generation (RAG) chatbot built with LangChain, Groq, and Streamlit.
It enables you to chat with your custom documentation (e.g., PostHog Handbook) using state-of-the-art LLMs like Llama 3 for free, with a focus on privacy and speed.
- ⚡ Blazing Fast Generation: Powered by Groq API (Llama 3 70B) for near-instant responses.
- 🔍 Hybrid Search: Combines Semantic Search (ChromaDB + Sentence Transformers) and Keyword Search (BM25) for high-precision retrieval.
- 📄 Document Ingestion: Automatically parses and chunks Markdown/text documentation.
- 💬 Conversational UI: Clean, responsive interface built with Streamlit.
- 🛡️ Privacy-First: Runs locally (except for the LLM API call), keeping your vector index on your machine.
- 📚 Verifiable Answers: Citations and source references for every response.
- Python 3.10+
- Groq API Key (Free)
-
Clone the repository
git clone https://github.com/yourusername/rag-chatbot.git cd rag-chatbot -
Create a virtual environment
python -m venv .venv # Windows .venv\Scripts\activate # Mac/Linux source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Configure Environment Create a
.envfile in the root directory:# .env GROQ_API_KEY=your_groq_api_key_here # Configuration CHUNK_SIZE=500 CHUNK_OVERLAP=50 TOP_K=5 EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
-
Ingest Data (First run only) Place your markdown files in
data/rawor use the default loader.python src/ingestion/loader.py
-
Run the App
python -m streamlit run src/ui/app.py
Your browser should open at
http://localhost:8501.
- Architecture Overview: Deep dive into the RAG pipeline and system design.
- API Reference: Details on the internal modules.
- LLM Provider: Groq (Llama-3.3-70b-versatile)
- Orchestration: LangChain
- Vector Store: ChromaDB
- Embeddings:
sentence-transformers/all-MiniLM-L6-v2 - Retrieval:
rank_bm25(Sparse) + Chroma (Dense) -> Ensemble - UI: Streamlit
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.