Personal document Q&A using RAG with Ollama.
# Activate environment
source .venv/bin/activate
# Run with a document
python rag_agent.py document.txt# Single file
python rag_agent.py notes.txt
# Multiple files
python rag_agent.py *.txt report.pdf
# PDF support (install first)
pip install pypdf
python rag_agent.py document.pdf📄 Loading documents...
✓ antiaging.txt
✓ 22 chunks created
🧠 Creating embeddings...
✓ Ready!
==================================================
RAG Agent - Ask questions about your documents
Type 'quit', 'exit', or 'bye' to stop
==================================================
You: What is this document about?
Agent: This document describes GPT-4b micro, a model for protein engineering...
You: quit
Goodbye!
- Python 3.10+
- Ollama with
qwen2.5:7bmodel - Dependencies:
pip install -r requirements.txt
# 1. Create virtual environment
python -m venv .venv
source .venv/bin/activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# 4. Download model
ollama pull qwen2.5:7b- ✅ TXT and PDF support
- ✅ Conversation memory
- ✅ Multiple file loading
- ✅ 100% local (no API keys)