A minimal, production-style Retrieval-Augmented Generation (RAG) Implementation
This repository provides a lightweight but fully functional RAG pipeline to build a vector-searchable knowledge base and ask questions grounded in documents.
It uses:
- Embeddings to convert documents into vector form = semantic representation of words/sentences/documents
- Vector DB to index and retrieve relevant chunks
- LLM to generate answers using the retrieved context
- Python (3.10+)
- Chroma — open-source vector database
- Langchain — open-source framework to build Agents and Applications powered by LLMs
- Ollama - open-source tool allows to run LLM's on on local machines ( I've personally used : llama2:13b 13B parameter model in my local macOS )
RAG-Implementation/
├─ data/ ← put your raw document files here
├─ my_embedding_functions.py ← custom embedding logic
├─ generateVectorDB.py ← builds the vector DB using custom embedding logic
├─ queryRAG.py ← Python script to query the stored vector DB .
├─ requirements.txt ← install required dependencies
├─ .gitignore
git clone https://github.com/NaveenKumar-Marupalli/RAG-Implementation.git
cd RAG-Implementation
2. ( Optional ) Create a Python virtual environment (or) Conda Environment
pip install -r requirements.txt
( I've personally kept my Resume as .pdf file inside "data/" folder .
python generateVectorDB.py
python queryRAG.py "Your-Custom-Query based on data ?"
$ python queryRAG.py "Your-Custom-Query based on data ?"
Answer:
... [answer with citations like – Sources: ['data/file-1.pdf:{page-id}:{chunk-index}', 'data/file-2.pdf:{page-id}:{chunk-index}']] ...