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.
Retrieval-Augmented Generation (RAG) is a simple but powerful pattern:
- Ingest your documents → split them into chunks → embed them into a vector database.
- Retrieve the most relevant chunks for a user query.
- Generate an answer with an LLM using only the retrieved context.
This makes LLMs factual and grounded in your own data.
- 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 docsapp/rag.py→ retrieve + generate pipelineapp/streamlit_app.py→ simple UI to ask questions
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