An AI analyst that has to show its work.
Two 10-Ks, hundreds of pages each. It finds what changed, says why it matters, and never shows a quote it can't prove.
The architecture
Heavy work runs offline. Visitors never trigger a model bill.
Eight decisions
Prove quotes with code
No quote ships unless it's in the filing.
Every quote is checked as a substring of the filing, with whitespace, curly quotes and dashes folded. Only quotes that pass reach the second, skeptical model. 169 of 236 findings are proven; the rest are shown as unproven, never hidden.
src/quotes.pyDiff first, then pay for tokens
The model reads the edit, not the 10-K.
Sections are paired across years by meaning, then a line diff keeps only what changed plus two lines of context. Results are cached by a hash of their inputs, so an unchanged rerun costs nothing.
diffing.pyMeasure accuracy on real filings
94% precision, 94% recall.
A golden set of 6 real 10-K pairs, 24 hand-labelled section judgments, against free baselines that flag every section or flag by diff size.
EVAL_REPORT.mdPrice every model call
A ledger of tokens and exact dollars.
Every chat and embedding call goes through one OpenRouter client and lands in llm_calls with tokens, cost, provider and errors. It caught a run where half the calls were silently rate-limited.
llm/client.pyOverlap chunks by exactly 500
Proving a quote is one SQL call.
Passages are 2,400 characters and overlap by exactly 500, so any quote up to 500 characters sits inside one passage. A property test checks 300 random substrings.
chunking.pySearch by meaning and keyword
Two rankings, fused.
pgvector cosine distance and Postgres full-text rank, merged with reciprocal rank fusion in one statement. Ignoring company-wide words (the company's own name) took keyword hits from 21% to 46%.
search.pyReturn passages, not answers
The asker's model writes the answer.
search_filings returns sources; verify_quote proves them for free. The server's only model call is one query embedding, capped at 2,000 a day, falling back to keyword search.
mcp_server.pyThree free services, not five on AWS
Supabase, Render, Vercel.
It started on Lambda, API Gateway, S3 and CloudFront with an export step. One database is now the source of truth, and responses were checked byte for byte before the switch.
render.yamlThe numbers
| Search mode | Right passage in top 5 | Questions in the filing's words | Reworded questions | MRR |
|---|---|---|---|---|
| Meaning only (vector) | 46% | 50% | 42% | 0.23 |
| Keyword only | 46% | 67% | 25% | 0.24 |
| Hybrid (both, fused) | 50% | 58% | 42% | 0.31 |
| Action | Cost | Paid by |
|---|---|---|
| Visiting this site, sample answers, checking a quote | $0 | nobody |
| An MCP search (one query embedding) | ≈ $0.0000002 | the owner, capped at 2,000 a day |
| The answer written from the passages | their model | the asker |
| Embedding all 3,374 passages, once | ≈ $0.05 | the owner |