Qalab Hassnain AghaCo-Founder & CTO

AI · LLM · Research

PaperIntel

RAG Research Intelligence

FastAPIChromaDBSentence TransformersPyMuPDFNext.jsBM25OpenAI
PaperIntel (RAG Research Intelligence): System Architecture diagram
System Architecture

My roleI designed and built the retrieval architecture, the citation layer and the evaluation harness.

A researcher asks a question about a stack of papers and needs an answer they can cite, not a confident paragraph that might be invented.

Pure vector search kept missing exact terms: equation numbers, algorithm names, specific parameter values.

  • Every claim traceable to a source passage.
  • Research data kept on-premise.
  • Quality must not silently degrade between updates.
vectorstermstop-kResearch PDFsPyMuPDFAIChunk + embedBGE · Sentence TransformersVector storeChromaDBKeyword indexBM25Hybrid retrievalquery expansion · multi-hopAIRerankercross-encoderCited answercitation-aware generationevery claim sourced
  1. Research PDFsPyMuPDF
  2. Chunk + embedAIBGE · Sentence Transformers
  3. Vector storeChromaDB
  4. Keyword indexBM25
  5. Hybrid retrievalquery expansion · multi-hop
  6. RerankerAIcross-encoder
  7. Cited answercitation-aware generationevery claim sourced
Hybrid retrieval with reranking and cited answers
  1. D1Section-aware chunking with metadataChunk within paper sections, then by coherence (300 to 500 tokens, 50 overlap), and enrich each chunk with title, authors, year and section. Chunking is irreversible at scale, so I tested it on real queries first.
  2. D2Hybrid retrieval with rank fusionVector search (top 20) and BM25 (top 20) run in parallel and merge with Reciprocal Rank Fusion, so semantic matches and exact terms both surface.
  3. D3A cross-encoder rerankerFused candidates are reranked down to the best 5 to 8 chunks. It costs 100 to 200 ms and was the largest single accuracy gain.
  4. D4Citations and confidence as product featuresChunk IDs in the prompt map back to full citations at display time; low retrieval or generation confidence shows a visible warning.

The quality gate

  1. Golden set200 question-answer pairs with ground-truth citations run on every update.
  2. MeasureRetrieval recall@5, answer faithfulness, citation accuracy and completeness.
  3. BlockAn update that drops recall by more than 3% or faithfulness below 0.85 is held for review.
+23%Answer accuracy vs pure vector search
+14%Of that from the cross-encoder reranker alone
200Golden Q&A pairs run on every update
  • The retrieval ceiling is set by chunking; the trust ceiling is set by citation accuracy.
  • Build from the ground up. The LLM is the last piece, not the first.
What problem did PaperIntel solve?

Research teams drowning in PDFs needed grounded answers with sources, not hallucinated summaries.

Who built PaperIntel, and how does it work?

I did (Qalab Hassnain Agha). I designed and built the retrieval architecture, the citation layer and the evaluation harness. How it works: Hybrid BM25 and dense-vector retrieval over ChromaDB with cross-encoder reranking, multi-hop query decomposition and citation-aware generation. Stack: FastAPI, ChromaDB, Sentence Transformers, PyMuPDF, Next.js, BM25, OpenAI.

What results did PaperIntel achieve?

Every answer grounded and traceable to its source passage. Hybrid retrieval and reranking pipeline in production.

Can I hire Qalab to build something similar to PaperIntel?

Yes. Contracts from $25 an hour, full-time remote from $3,000 a month, fixed-price prototypes from $600 and builds from $2,000, and fractional CTO retainers from $800 a month. Book a free 30-minute call and I will tell you honestly whether and how I would build it.