Drop PDFs in, ask a question, get an answer with the exact page it came from — every answer is cited, or it isn't returned at all.
Status: MVP (v0.1, text-only) · last shipped 2026-09-07 Built by: Kartik Aneja — AI/ML Platform Engineer
See PRODUCT.md for the full user/problem/solution writeup. TL;DR:
- Who: Ops/knowledge lead at a small law firm, insurance broker, or clinic with thousands of PDFs and no time to search them by hand.
- Pain: ChatGPT can't ingest the whole corpus, generic RAG demos ignore document structure, and an answer without a page citation isn't trustworthy in a legal/compliance context.
- Why now: RAG is everywhere, but almost none of it is built to point back at a specific page a human can open and check.
- PDF ingestion with per-page text extraction (PyMuPDF) — chunking never crosses a page boundary
- Pluggable embeddings: a dependency-free
StubEmbedder(no API key, deterministic) and anOpenAIEmbedderfor production use - Cosine-similarity search over ingested chunks
ask()always returns anAnswerwith at least one cited page — there is no code path that returns an uncited answer (enforced at the data-model level, not just by convention)- FastAPI service (
/ingest,/ask,/documents,/healthz) demo.py— runs end-to-end against a bundled sample contract with zero API keys- 24 passing tests, all of them running against the zero-API-key path
Local in under a minute:
git clone https://github.com/anejakartik/docubrain.git
cd docubrain
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python3 demo.pyOr run the API:
uvicorn server.main:app --reload
# then: curl -F file=@sample_data/sample_contract.pdf http://localhost:8000/ingestSee docs/architecture.md. Stack: Python + PyMuPDF + FastAPI, pluggable embedding/generation backends, in-memory vector search for v0.1 (Qdrant planned for the persistent/production backend).
See ROADMAP.md — the biggest post-MVP item is real layout-aware page-region highlighting (not just a page number), which is the original full product vision.
This is a personal portfolio project but PRs welcome. See AGENTS.md if you're an AI coding agent working on this repo.
MIT. See LICENSE.