Retrieval pipeline
How uploaded documents become grounded context for answers.
Indexing
Indexing prefers Mistral OCR blocks and falls back to parsing page Markdown into structural units. It assembles chunks around a 450-word target with roughly 75 words of overlap at whole-unit boundaries where possible. Tables remain intact even above the target; oversized prose alone is split at paragraph, sentence, then word boundaries. Exact page spans map chunk offsets back to citation pages. Page and document summaries are generated alongside the chunks.
From question to answer
At query time the pipeline rewrites the question and applies its scope. Document-scoped questions route to summaries or hybrid search; current-page questions load only overlapping page chunks. The selected evidence then feeds a streamed, cited answer.
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.