Skip to content

This project consists of an AI Chatbot which follows a standard RAG architecture, enhanced with Hybrid Search for better retrieval accuracy.

Notifications You must be signed in to change notification settings

ananthram-g/rag-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Chatbot

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.

Streamlit UI LangChain Groq Python

✨ Features

  • ⚡ 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.

🚀 Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/rag-chatbot.git
    cd rag-chatbot
  2. Create a virtual environment

    python -m venv .venv
    # Windows
    .venv\Scripts\activate
    # Mac/Linux
    source .venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure Environment Create a .env file 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

Usage

  1. Ingest Data (First run only) Place your markdown files in data/raw or use the default loader.

    python src/ingestion/loader.py
  2. Run the App

    python -m streamlit run src/ui/app.py

    Your browser should open at http://localhost:8501.

📂 Documentation

🛠️ Tech Stack

  • 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

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This project consists of an AI Chatbot which follows a standard RAG architecture, enhanced with Hybrid Search for better retrieval accuracy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages