Chat with your documents. Runs fully offline. Zero API costs.
Librarium is a fully offline document Q&A system built on a RAG (Retrieval-Augmented Generation) pipeline. Upload PDFs, Word docs, text files, or paste any URL — then ask questions in plain English and get accurate, cited answers powered by a local LLM.
No API keys. No cloud dependency. No cost.
![]() |
![]() |
![]() |
![]() |
| Feature | Description |
|---|---|
| Hybrid Search | Combines BM25 keyword search and vector search for better retrieval |
| Multi-format Support | PDF, DOCX, TXT, and web URLs |
| OCR | Extracts text from image-based and scanned PDFs automatically |
| Conversation Memory | Ask follow-up questions — the system remembers context |
| Citations | Every answer shows the exact source file and page number |
| Query Rewriting | Vague questions are automatically rewritten for better retrieval |
| Auto Summary | Generates a document summary on load |
| URL Support | Fetch and index any webpage mid-session |
| Chat Export | Export your Q&A session as a formatted PDF |
| Eval Dashboard | Live grounding score, response time, and retrieval stats per query |
| Streaming | Answers stream word-by-word for a responsive feel |
| Persistent Storage | Vector DB saves to disk and reloads instantly on future runs |
| Layer | Technology |
|---|---|
| Orchestration | LangChain |
| LLM | Ollama (llama3.2, llama3.2:1b) — runs locally |
| Embeddings | Ollama (nomic-embed-text) |
| Vector DB | ChromaDB |
| Keyword Search | BM25 (rank-bm25) |
| OCR | Tesseract + pdf2image |
| Web Scraping | BeautifulSoup + Requests |
| UI | Streamlit |
- Python 3.10+
- Ollama installed and running
- Tesseract OCR (Windows installer)
- Poppler (Windows)
1. Clone the repository
git clone https://github.com/keya115251/document-qna.git
cd document-qna2. Create and activate a virtual environment
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Mac/Linux3. Install dependencies
pip install -r requirements.txt4. Pull the Ollama models
ollama pull llama3.2
ollama pull llama3.2:1b
ollama pull nomic-embed-text5. Update paths in app.py
TESSERACT_PATH = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
POPPLER_PATH = r"C:\poppler\poppler-26.02.0\Library\bin"6. Run
streamlit run app.py- Upload a PDF, DOCX, or TXT file via the sidebar
- Or paste any URL to index a webpage
- Ask questions in the chat input
- Type
load url <url>in chat to add more sources mid-session - Toggle the Eval Dashboard to see retrieval metrics
- Export your session as a PDF from the sidebar
- Hybrid search (BM25 + vector)
- Multi-document support
- OCR for image-based PDFs
- Query rewriting
- Citations with source and page attribution
- Conversation memory
- URL support with mid-session loading
- Auto document summary
- Chat history export as PDF
- Streamlit Web UI
- Evaluation dashboard
Built by Keya Chembuli



