A local Retrieval-Augmented Generation (RAG) system that accepts CSV, processes the content, and enables contextual question answering using LLaMA 3.2 via Ollama, Ollama Embeddings, and ChromaDB, all through an interactive Gradio interface.
- 🔍 Contextual Q&A: Ask questions about the document and get accurate, grounded responses from the local LLM.
- 💡 Fully Local Pipeline: No internet or API calls required—runs entirely offline using Ollama and ChromaDB.
- ⚡ Fast Retrieval: Vector similarity search ensures fast and relevant document chunk matching.
- 🖥️ Interactive UI: Clean Gradio interface for uploading files and querying them in real-time.
- Language Model: LLaMA 3.2 via Ollama
- Embeddings: Ollama Embeddings
- Vector Store: ChromaDB
- Frontend: Gradio
- Programming Language: Python
CSV Upload → Text Extraction & Chunking → Ollama Embeddings (Vectorization) → ChromaDB (Vector Store for Retrieval) → User Query → Relevant Chunks Retrieved → LLaMA 3.2 (Local LLM Inference) → Answer (Context-Aware Response)
- Clone the repository
git clone https://github.com/your-username/local-pdf-rag-agent.git
cd local-pdf-rag-agent
- Install Dependencies
pip install -r requirements.txt
- Start Ollama and download the model
First you need to download Ollama from their official website. Now open your terminal or command prompt
ollama run llama3.2
Before running the project make sure Ollama is running in the background.
To run the project, from the root directory :
uv run python src/main.py # for running on terminal
uv run python src/gradio_app.py # for running the gradio app
If you encounter the following warning:
Warning
Mismatched Virtual Environment
This typically means the current Python environment doesn't match the expected .venv
.
- Create a fresh virtual environment with
uv
(recommended)
uv venv .venv
uv pip install -r requirements.txt
Then run the app with
uv run python src/main.py
or
uv run --active python src/main.py
-
Upload a research paper and ask for summaries or definitions.
-
Upload a policy document and ask for specific clauses.
-
Upload a user manual and ask how a feature works.
-
Upload financial statements and ask key insights.