Skip to content

About

A Retrieval-Augmented Generation (RAG) starter project using LangChain, Chroma, HuggingFace embeddings, and Streamlit. Learn how to build and run RAG pipelines on your own documents.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📖 Mini RAG (LangChain)

Ask-Your-Docs (Tiny RAG):
Load a handful of local files, build a vector index, and answer questions grounded in those files with short citations.

This repo is designed as a minimal, educational project so you can learn how Retrieval-Augmented Generation (RAG) works using LangChain.


🔍 What is RAG?

Retrieval-Augmented Generation (RAG) is a simple but powerful pattern:

  1. Ingest your documents → split them into chunks → embed them into a vector database.
  2. Retrieve the most relevant chunks for a user query.
  3. Generate an answer with an LLM using only the retrieved context.

This makes LLMs factual and grounded in your own data.


🛠 What we use

  • Chroma for the vector store (persists locally).
  • HuggingFace embeddings (all-MiniLM-L6-v2) – works offline, no API key needed.
  • OpenAI LLM for generation by default (configurable to Ollama if you want local models).
  • Python scripts:
    • app/ingest.py → load, split, embed, and index your docs
    • app/rag.py → retrieve + generate pipeline
    • app/streamlit_app.py → simple UI to ask questions

⚡ Quickstart

Clone the repo and set up your environment:

git clone https://github.com/yourusername/mini-rag-langchain.git
cd mini-rag-langchain

# Create venv
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Copy config
cp .env.example .env   # Add your OPENAI_API_KEY if you want to use OpenAI

 # Prepare your docs: Drop some .pdf, .md, or .txt files into data/raw/
mkdir -p data/raw

# Run data ingestion - Build the index
python app/ingest.py

# Run Streamlit UI to query dB
streamlit run app/streamlit_app.py

Streamlit UI

Streamlit UI

About

A Retrieval-Augmented Generation (RAG) starter project using LangChain, Chroma, HuggingFace embeddings, and Streamlit. Learn how to build and run RAG pipelines on your own documents.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages