Skip to content

Own build

Grounded Document Research Assistant

An agentic RAG system that searches your PDFs with hybrid retrieval and reranking, checks its own evidence and citations, and answers with document and page sources, or an honest “I don’t know”.

Redrawn product screen. Names, businesses, people and prices are fictional sample data.

Verified in the code

step agent workflow
10step agent workflow
passages reranked
20 → 5passages reranked
automated tests
33automated tests
self-correcting retries
2self-correcting retries

The problem

Teams buried in reports, contracts and papers need answers they can verify. A tool that cites the wrong page, or invents a source, is worse than no tool.

What we built

A ten-step agent workflow analyses the question, rewrites it with chat context, searches, grades the evidence and retries with a refined query when coverage is weak. After answering, it checks every citation against the passages it actually retrieved and regenerates once if any are invalid.

Capabilities

What it does

  • Answers cite the exact document and page
  • Hybrid search: semantic vectors plus keyword BM25, fused, then a cross-encoder reranks the top 20 to 5
  • Grades its own evidence and retries up to twice with a refined query
  • Strips invalid citations and regenerates the answer
  • Says it cannot answer confidently instead of guessing
  • Follow-ups like “which page says that?” are answered from stored sources
  • Treats document text as data, not instructions, to resist prompt injection

Under the hood

Agent workflow

  1. 1Analyse question
  2. 2Rewrite with context
  3. 3Hybrid search + rerank
  4. 4Grade evidence
  5. 5Retry if weak
  6. 6Answer with citations
  7. 7Validate citations

Stack

LangGraphLangChainChromaDBBM25Cross-encoder rerankingGroq / OpenAIFastAPIStreamlitDocker

Want something like this for your business?

Book a free call. We’ll look at how your business runs and tell you honestly what’s worth automating, and what isn’t.