Part 1 covered how extract-rag reads a photo of a receipt and returns validated JSON. The name still owed a promise: the "rag". This part covers what came next: the chat that cites its sources, the decision not to use embeddings for totals, a public deployment that doesn't pay for anyone's usage, and a full redesign of the interface that ended, by my own choice, on the category standard.

The review screen after the redesign. The subtotal row explains why the numbers don't add up.
A chat that cannot make things up
Every extracted document is rendered into self-contained text chunks ("Document #5, transfer of 10,000 ARS to Mario Domingo Alvarez on 2026-09-23…"), embedded with text-embedding-3-small through OpenRouter, and stored in the document_chunks table that had pgvector waiting since day one. On a question, the question is embedded, pgvector returns the eight closest chunks, and the model answers only from those, tagging every fact with [#id]. The UI turns each tag into a chip that opens the document.
On my real receipts it worked first time: it summed September's transfers correctly, excluded October's one and said why, and when I asked about a rent payment that didn't exist it said there was no rent document and what might be missing.
Totals are queried, not guessed
The problem with asking a model to add things up is that it adds "roughly". For calculation questions (totals, averages, counts, filters by date or counterpart) the chat now generates SQL instead of reading chunks.
It doesn't query the raw JSON: I created flat views per document type (v_transfers, v_invoices, v_invoice_items…) with real dates and numeric amounts, and a planner that chooses the path and writes the queries. It always asks for a detail query with one row per document, so each can be cited, plus one for the aggregate.
The query runs inside a read-only transaction, as a role that can only read those views, with a five-second timeout and a 200-row cap. If the database rejects it, the planner gets the error and retries once; if it fails again, the question falls back to the semantic path.

A totals question: the model shows the SQL mode, cites the documents, and flags that the same invoice is duplicated.
Publishing it without paying for anyone's usage
The app runs on Seenode with a managed Postgres that, to my relief, ships pgvector. The first build failed on something silly: with NODE_ENV=production, npm ci skips devDependencies, and Tailwind lives there. A --include=dev fixed it.
The important part is the key. If I left my OpenRouter key on the server, every visitor would spend my credit. In production there is no key: each person pastes their own in the top-bar button, it stays in their browser, travels with each request, and the server never stores it. A document costs about 0.3 cents, billed to whoever uploads it.
I also moved uploads into Postgres, because the server disk is ephemeral, and I flatten transparent images onto white before sending them: a PNG with a transparent background reaches the model as black text on black and gets declared "blank". It happened to me with the test invoice.
The redesign: seven directions, a die, and a choice
The original interface was any template's: Tailwind greys, default blue, cards. To redesign it I used a process that forces me not to settle for the first idea.
First, a short product interview: who is it for? (portfolio visitors trying it with their own key), which language? (bilingual with a selector), what must it avoid? ("looking like a generic SaaS"). Then seven visual directions drawn from the world of Argentine paperwork, not from wallet apps: the carbon-copy receipt book, the accountant's ledger, the cheque with guilloché and MICR line, the green-bar continuous-form bank statement, the squared Rivadavia notebook, the split-flap board at Retiro station, and notarised folios with stamps.
A die assigned which one to build, so my favourite doesn't always win. It landed on the green-bar statement; my favourite was the carbon-copy book. Each was sketched as the real review screen.

The direction the die assigned: the continuous-form bank statement.

My pick: the carbon-copy receipt book.
I looked at them, thought about them, and chose neither. I asked for the category standard, executed at Notion's finish: warm, airy, soft controls, properties in rows, thin hairlines. For a tool people operate, familiarity is a virtue, and the process was exactly what let me choose it deliberately instead of by inertia.
What changed in the build
- Warm charcoal on white, dark mode following the system, and the document sheet always white. One blue for actions and citations; red, amber and green only as states.
- Geist for the UI and Geist Mono with tabular figures for amounts, dates, tax IDs and SQL.
- The form as property rows: borderless inputs until hover, the invalid row tinted red with its reason underneath.
- Honest waiting: three steps with elapsed seconds, because a photo can take a minute.
- Spanish and English with a toggle, down to the validation messages.

The three steps of the wait, with elapsed time.
An independent reviewer, working from desktop, mobile and dark-mode captures, returned eight material fixes: the line-item table clipped on mobile, disabled buttons were illegible, textareas showed the resize grip, ids weren't in mono. I applied them in one batch, recaptured, and the verdict closed on "ship". The system was recorded in a DESIGN.md with tokens, so the next screen comes out the same.

On mobile, each item is a property group.
Try it, or ask me for the code
The app is at extract-rag.seenode.app: you need an OpenRouter key and a receipt at hand. The repository is private while the project matures, but if you'd like to see inside, the Request code access button on the project card drafts an email with what I need: your GitHub username and why you're interested. I reply and add you as a read-only collaborator.
Next up: a list of processed documents, exporting everyone's JSON at once, and measuring how much a larger model improves extraction on the cases that fail today.