Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG-Implementation

A minimal, production-style Retrieval-Augmented Generation (RAG) Implementation

Project Overview

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

Tech Stack & Dependencies Used :

  • 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 )

📂 Repository Structure

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  

Usage & Setup

1. Clone the repo

git clone https://github.com/NaveenKumar-Marupalli/RAG-Implementation.git
cd RAG-Implementation

2. ( Optional ) Create a Python virtual environment (or) Conda Environment

3. Install dependencies

pip install -r requirements.txt

4. Place the "pdf" files (or) documents inside "data/" folder

( I've personally kept my Resume as .pdf file inside "data/" folder .

5. Ingest documents and build vector DB

python generateVectorDB.py

6. Query the RAG system

python queryRAG.py  "Your-Custom-Query based on data ?"

💡 Example

$ 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}']] ...
  • LLM's response ( WITHOUT RAG & context data ) :

image
  • After implementing RAG , Query response retrieved from stored vector DB :

image

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages