Skip to main content
Anuraag Mishra

Document Intelligence & RAG

Grounded answers over your own documents

Ingestion and retrieval that make an uploaded file useful in stages, and keep every answer inside the files the user chose.

Role
Senior Associate, Technology (AI/ML) at Synechron
Context
Client engagement with a global investment bank, 2025–now
RAGHybrid RetrievalDocument ParsingEmbeddings

In this product, users create workspaces and folders, upload their own documents, and ask questions about them. The answer has to come from those documents, point to where it came from, and say so plainly when the files don’t contain it.

I designed and built the ingestion and retrieval pipelines behind that, within a larger product: parsing that follows the document’s structure, metadata and provenance on every passage, parent and child context, source scoping, and a split between background ingestion and live queries so a file becomes useful step by step instead of all at once.

The problem with “upload, then wait”

Turning a file into something you can ask questions about takes several steps: converting and parsing it, summarizing it, splitting it into passages, embedding them and indexing them. The slowest of those decides when a simple pipeline lets the user do anything at all. For a large file that means a long wait for a document the user can already see in the list.

The second problem was quality. Splitting text every N characters is easy, but it cuts tables in half, separates a heading from the paragraph it introduces, and produces passages that mean little on their own. Retrieval then returns fragments, and the citation points at a fragment too.

A file becomes useful in stages

I separated ingestion, which runs in the background, from query handling, which has to be fast. Each ingestion stage unlocks more of the file as soon as it finishes:

What works, and when
  1. 1Right after upload

    The file is listed and can be found by name, including fuzzy matches.

  2. 2After a fast first pass

    A short summary and the main entities and topics make it searchable by what it is about.

  3. 3After chunking and embedding

    Passage-level search and grounded questions with citations.

  4. 4Later, in the background

    Deeper analysis of the file, without holding anything above back.

Because the stages are separate, one failing doesn’t take the whole file down. If embedding fails, the file can still be found by name and by its summary.

Keep the document’s shape

Chunking follows the document’s own structure: headings, sections, pages and tables. Tiny fragments such as cover pages and contents lists are merged into their neighbors instead of becoming passages of their own, and oversized sections are split.

Every passage keeps a link to the section it sits in and the page it came from. Retrieval can match a precise passage, then bring in the surrounding section when the passage alone is too thin to answer from, and the citation still points at a real page:

Quarterly report.pdf
└─ Section 4: Risk factors
   parent section, pages 12–14
   └─ "Concentration of suppliers…"
      child passage, page 13

Scope is a filter, not a hint

When a user asks about a folder or a set of files, only those files are eligible. That check happens before retrieval, as a hard filter, rather than as one more score that a strong match elsewhere could outweigh. The model only ever sees context from the files the user selected, so it can’t cite something they didn’t choose.

Within that scope, retrieval combines exact-term matching with semantic search and metadata such as entities and dates, so a question can find a passage by the words it uses or by what it means.

For a handful of short files, reading them whole is simpler and often works better. Passage-level retrieval is what lets the same product handle folders far too large to read in one go.

What changed

A file is useful a short time after upload instead of after its slowest step, and it gets more useful as processing continues. Answers come from passages that still carry their section and page, so they can be checked. Retrieval never looks outside what the user selected.

The quality checks I would hold this to are simple to state: did retrieval find the passage that actually answers the question, does the answer stay within what that passage says, and does the system decline when the files don’t contain the answer.