Retrieval pipeline
How uploaded documents become grounded context for answers.
Indexing
Indexing transforms OCR-extracted pages into overlapping chunks, attaches page-span metadata, and creates embeddings. Page and document summaries are generated alongside the chunks. The goal is to preserve enough page context for citations while keeping retrieval precise.
From question to answer
At query time the pipeline routes the question, retrieves evidence with hybrid search, fuses the rankings, and streams a cited answer. Each stage is shown below.
Hybrid search
Hybrid retrieval combines semantic similarity with keyword matching. Vector search finds related meaning, while Convex full-text search protects exact terms such as clause names, product names, dates, and abbreviations. The Retrieval ranking page covers the exact weights and fusion math.
Answer generation
- Retrieved chunks are passed to the model as bounded, labeled sources.
- The answer must stay inside the evidence provided by the document.
- Citations are validated against source text and keep the answer page-linked.