<!-- Building GotNoticed: Why a Document Copilot Needs a Two-Stage Pipeline — by Bhagya Rana -->
<!-- Canonical: https://bhagyarana.in/blog/building-gotnoticed-two-stage-pipeline -->
---
title: "Building GotNoticed: Why a Document Copilot Needs a Two-Stage Pipeline"
publishedAt: "2026-10-11"
summary: "Notes from building GotNoticed, a copilot that explains Indian government and bank documents. Why I split extraction from reasoning, and what the first real test documents broke."
status: "wip"
series: "Building with AI"
---

> **Work in progress.** GotNoticed is not finished. This post covers only what exists today: ingestion and extraction. The understanding engine, the UI, and the voice loop are still ahead, and I'll extend this post as they land.

## The problem

Someone opens a tax intimation, an electricity bill, or a hospital discharge summary and cannot tell whether they are in trouble. The document is dense, often in a language they read less comfortably than English, and the deadline is buried in a paragraph.

I wanted GotNoticed to do more than summarise. The goal is an *action copilot*: what the document means, how urgent it is, and what to do next. It is not an OCR tool, and it is not a PDF chatbot.

I'm building it for the Sarvam Epoch Buildathon, on Sarvam's APIs.

## Decision 1: two stages, because the chat model cannot see

The first thing I verified, before writing any product code, was what the APIs actually accept. Sarvam's chat endpoint has no vision input. I cannot hand it a photo of a notice.

So the pipeline has two stages:

```
Upload (image / PDF / camera / paste)
   ↓
Document digitization       → markdown text
   ↓
Understanding engine        → structured JSON
```

Digitization turns the upload into text. The chat model reasons over that text. This was a constraint first and a design choice second, but it has a benefit: each stage can be tested on its own. When an answer is wrong, I can tell whether extraction or reasoning failed.

## Decision 2: one JSON contract drives the whole UI

The design for the understanding stage is a single structured analysis that every surface reads from. The UI never re-derives meaning from raw text. If the verdict, the urgency, and the draft reply all come from one object, they cannot disagree with each other on screen.

The plan is to request that object with a JSON schema as the response format, so the output is validated against the contract instead of parsed with hope. This stage is not built yet, so treat it as a design, not a result.

## Decision 3: two test corpora, on purpose

I keep two sets of documents, and they test different things.

- **Synthetic fixtures** are clean PDFs for everyday categories that have no publicly licensed real scans: an electricity bill, a tax intimation, a discharge summary. They have a clean text layer, so they make good golden tests.
- **Real samples** are eight public documents, licence-checked, chosen to break things: a Kannada gazette page, a Malayalam ration card, a Devanagari and Latin gazette, a creased RTI reply photographed on a phone, a skewed and faded photocopy.

None of them contains a real private individual's data.

## What I measured

On the current build, using live API calls:

| Corpus | Result | Extraction time |
|---|---|---|
| 3 synthetic fixtures | 3 of 3 pass | about 6.8 to 7.4 s |
| 8 real documents | 8 of 8 pass | about 7 to 18 s |

"Pass" here means the extracted text contains the key tokens I told the test to look for (the dates and amounts the later analysis will depend on), with tables preserved as HTML. It does not mean the document was *understood*, because that stage does not exist yet. I'm calling that out so the numbers are not read as more than they are.

The real documents were the useful ones. They include pure Kannada and Malayalam, a phone photo, and a faded photocopy, and all of them extracted with no preprocessing on my side.

## A constraint worth knowing

Digitization is rate-limited to 10 requests per minute, and each document costs 6 calls. So my test scripts run sequentially on purpose. A parallel test run would just get rate-limited and look like a bug in my code.

## What's next

1. The understanding engine: the structured analysis (verdict, urgency, next action, evidence quotes).
2. The analysis UI, with progressive disclosure so a frightened user sees the verdict first and the detail second.
3. Conversation and language switching.
4. A voice loop for people who would rather listen than read.

I'll measure the understanding stage against the same fixtures before I say it works, and update this post with the results, including the failures.
