A fully local, private PDF question-answering bot. No cloud. No data leaks. Everything runs on your machine.
Download from https://ollama.com and install it.
Then pull the required models:
ollama pull llama3
ollama pull nomic-embed-textpip install -r requirements.txtstreamlit run app.py- Upload a PDF using the sidebar
- Click "Index Document" — this embeds it into ChromaDB locally
- Ask questions in the chat box
- Get answers with page citations ✅
securedoc/
├── app.py ← Streamlit UI
├── rag_engine.py ← ChromaDB + Ollama RAG logic
├── pdf_loader.py ← PDF reading & chunking
├── requirements.txt ← Python packages
└── chroma_db/ ← Auto-created vector database (local)
In rag_engine.py you can change:
| Variable | Default | Description |
|---|---|---|
LLM_MODEL |
llama3 |
Any model you've pulled in Ollama |
EMBED_MODEL |
nomic-embed-text |
Embedding model |
TOP_K |
5 |
Number of chunks retrieved per query |
- ChromaDB stores all vectors locally in
./chroma_db/ - Ollama runs the LLM on your GPU — no API calls
- Zero internet traffic after initial model download