Skip to content
1GROUNDED·RAG
GitHub
Private, grounded document answers

Ask questions of any PDF.

Answers grounded in the document itself, with every claim cited back to the page it came from. Structure-aware chunking, hybrid retrieval, Flashrank reranking, and a quality gate keep the answer tied to the source.

2
retrieval indexes: dense + sparse
0.65 / 0.35
RRF fusion weighting
±1
neighbour chunks expanded
100%
answers carry citations
The problem

A plain LLM will confidently invent what your document says.

It has never read your file. Ask it about a 200-page report and it produces something plausible, unattributable, and occasionally wrong in the exact places that matter.

The approach

Retrieve first. Answer only from what was retrieved. Cite it.

The document is split around its own structure, scored for quality, and indexed twice: dense vectors and sparse keywords. Every question is rewritten against recent chat, fused, reranked, and handed only the surviving chunks.

How it works

Illustrative view of the backend pipeline, not measured telemetry.Hover a stage for a plain-language explanation.
Question
JWT + prompt guardrails
Query rewrite
Dense · bge-m3 embedding
Sparse · BM25 keywords
Qdrant filtered search
Reciprocal Rank Fusion
Chunk quality-gate weighting
Flashrank reranker → top-K
Neighbour context expansion ±1
gpt-5-mini → cited answer
Parser router

Security by default

The boundaries around the pipeline matter as much as the models.
Account-scoped access
JWT authentication is required for ingest, query, documents, and chat history.
Document isolation
Every vector search is filtered by the signed-in owner and selected document.
Untrusted-data boundary
Document text is context, never instructions; guardrails keep retrieved content from steering the system.
Abuse controls
Per-user rate limits protect the expensive ingest and query paths.
Key handling
The optional BYO OpenAI key is sent in a request header and is never persisted by the backend.

Architecture

API
FastAPI
Ingest, query, health and collection endpoints. Every response carries an X-Request-ID.
Vectors
Qdrant
Qdrant Cloud stores document-scoped vectors with owner and document filters.
Keywords
BM25
Sparse index running alongside the vectors, catching exact terms embeddings miss.
Reranker
Flashrank
Re-scores the fused candidate set before anything reaches the model.
Models
Azure + BYO
Azure-hosted gpt-5-mini by default; an optional OpenAI key is used only for your request.
Runtime
Azure Container Apps
Scale-to-zero hosted runtime; Docker Compose remains available for local development.

What's in the pipeline

Structure-aware chunking
Splits around headings and sections, falling back to recursive chunks only when a section is oversized.
Chunk quality gate
Scores chunks and applies a soft retrieval penalty; every non-empty chunk remains indexed.
Hybrid retrieval
Dense vectors and sparse keywords searched in parallel.
RRF fusion
Reciprocal Rank Fusion merges both rankings (0.65 dense, 0.35 sparse).
Reranking
Flashrank re-orders candidates by true relevance to the question.
Neighbour expansion
Pulls adjacent chunks so answers keep their context.
Inline citations
Every claim tagged with its file and page, rendered as linked chips.
Parser router
Routes PDF, Office, image and CSV files through local and OCR adapters with fallback tiers.
JWT + guardrails
Every document route is account-scoped and retrieved text is treated as untrusted data.
RAGAS harness
Faithfulness and relevancy measured offline, not guessed at.
Where your data goes

Your account keeps its own documents and chat history; the default model runs through our Azure deployment.

Retrieval uses Qdrant Cloud and self-hosted bge-m3 embeddings. Generation uses Azure-hosted gpt-5-mini by default. If you provide an OpenAI key, it is sent per request and never stored on the backend.

Frequently asked

Is my data private?

Yes. Every document, embedding, and chat history is scoped to your account — retrieval is filtered by owner on every query, so another user can never see or search your documents.

Do you use my documents to train any model?

No. Documents are used only to answer your own questions about them. Nothing you upload is used for training.

What happens when I delete a document?

Deleting a document removes its database record, its vectors from storage, and its retrieval index — it isn't just hidden from the list.

Which file types are supported?

PDF, TXT, Markdown, CSV, JSON, Word, PowerPoint, Excel, and common image formats (PNG, JPG, WEBP), routed through local parsing or an OCR fallback depending on the file.

Can I use my own OpenAI key?

Yes, from the workbench. It swaps the model that generates answers; retrieval always uses the same embedding model a document was indexed with. Your key is sent with the request and never stored on the backend.