Case study
10-K / 10-Q research knowledge base
A knowledge base and entity graph over 973 SEC filings from 186 companies: mostly 10-Ks, plus 44 10-Qs and some 20-Fs, filed 2022–2026. It is in daily use as part of my portfolio manager.
- 394,913 text chunks, embedded with Qwen3-Embedding-0.6B and stored in ChromaDB
- 45,791 entities and 70,458 relationships
- 40,910 claims extracted by an LLM into 9 claim types, including risks, material events, capital structure, legal proceedings and guidance
Query traces
The traces come from a public rewrite of the pipeline, run on a sample of 61 filings: 12 companies, five fiscal years each, plus one 10-K/A.
For each question, retrieval takes the top 20 chunks per filing and section. Passages that score under a display cutoff of 0.35 are not shown to the model. The rest, up to 40, go to claude-sonnet-4-6, which answers in single sentences, each one citing the passages behind it. A trace shows that answer, every passage with its score and SEC link, up to 10 of the best rejected candidates (some traces have none), and the claims behind it.
Thirteen questions were run. A UNH question passed the automated checks but failed my own review on three weak sentences, so it was dropped. Twelve are exported, and eight of those are featured in the demo.
Sample: 12 companies · 61 filings | Full private system: 186 companies · 973 filings.
Deterministic replay of real pipeline runs: zero live API latency or cost.
Traces exported at commit 4fc371f.
Verification & Evals Ledger
Checks already run on the private pipeline and the public sample.
| Eval | What it tested | Result | Status |
|---|---|---|---|
| Extraction model A/B (119 sections) | Private pipeline: Claude Sonnet 4.6 against Sonnet 5 on entity extraction | Kept Sonnet 4.6. Sonnet 5 found 84% fewer company entities. | Measured |
| Open-model extraction benchmark | Private pipeline: open models from 7B to 70B on high-yield filing sections | Rejected. The best reached about 48% recall, and one hallucinated facts. | Measured |
| Noise floor and cheaper effort setting | Private pipeline: the same model run against itself, as the bar for judging a cheaper setting | The cheaper setting would cut cost per section about 56%, from $0.300 to $0.133. Not adopted. | Measured |
| Pipeline audit | Private pipeline: dropped entity links and empty filing-years | Found 7 tickers with dropped entity links and 12 of 126 filing-years that were empty table-of-contents stubs. Both fixed to zero. | Measured |
| Section-text fidelity | Public sample: whether the public section detector produces the same text as the private pipeline | 681 of the 682 comparable sections match (99.9%). Coverage: only 682 of 824 sections could be compared (82.8%). | Measured |
| Per-sentence citation, number and scale checks | Public sample: every sentence cites a passage, and every number appears in a passage it cites, at the same scale | 12 traces, 0 problems. 8 of the 144 numbers appear in their passage without a scale, such as a table cell under an "in millions" header, and go to a human audit list. | Measured |
| SEC links | Public sample: each distinct SEC link in the traces is requested once | 19 of 19 returned HTTP 200. | Measured |
| Human audit | Public sample: my own review, on top of the automated checks | 13 questions run. One passed the automated checks but failed my review on three weak sentences and was dropped; 12 are exported. | Measured |
Planned for v2: retrieval recall@k, citation faithfulness, a claim-extraction audit, and cost per 10-K ingested. They get numbers when they are measured.
Failure Mode Caught #1 — Invalid Eval Control
A prompt revision, v4b, first looked like an improvement because it was scored against a control run on a different prompt. Rerunning the control on the same prompt reversed the conclusion: v4b made nearly every entity type worse (mean gap across types 3.2 vs. 1.8 for v4a) and caused extra timeouts. Rule adopted: never score a prompt change against a control on a different prompt.
Failure Mode Caught #2 — Silent MD&A Truncation
Long MD&A sections (often 5–10K tokens, sometimes 20–60K) were silently truncated by the earlier embedding model's 8,192-token limit, dropping late portions where year-over-year changes often appear. Fix: sentence-boundary chunking of long sections.
Why not a simpler solution?
Every cell is tagged. Measured means counted or tested in my system. Built means the system has it, which says nothing about how well it works. Design rationale is a reasoned argument I have not tested. Not tested means exactly that.
| Approach | Cross-company and multi-year questions | Extraction quality | Provenance and auditability | Cost and latency at 973 filings | Where it wins |
|---|---|---|---|---|---|
| 1. Human analyst only | High judgment, slow across 186 companies (Design rationale) | The reference standard for judgment, but it does not scale to a corpus (Design rationale) | A full audit trail, if the notes are kept (Design rationale) | Prohibitive for routine sweeps across the corpus (Design rationale) | Deep judgment on one or two high-conviction names (Design rationale) |
| 2. Keyword or lexicon search | Fast exact matches; misses paraphrased risks (Design rationale) | None: it finds strings, not claims (Design rationale) | Exact string offsets (Design rationale) | Near zero (Design rationale) | Known ticker, statute or covenant lookups (Design rationale) |
| 3. FinBERT sentiment only | Fast section-level scoring (Design rationale) | None: a score per chunk, no claims (Design rationale) | Section level only, with no claim-level explanation (Design rationale) | Very low (Design rationale) | A cheap directional screen (Design rationale). In this system FinBERT runs only as a shadow signal (Built) |
| 4. Generic LLM with basic RAG | Retrieves top-k chunks; weak on multi-hop entity links and point-in-time state (Design rationale) | With open 7B–70B models as the extractor in my extraction pipeline, the best reached about 48% recall on high-yield sections, and one hallucinated facts (Measured, open models only) | Chunk-level provenance, if it is enforced (Design rationale) | Moderate (Design rationale) | Fast Q&A over a small, fixed set of documents (Design rationale) |
| 5. Long-context frontier LLM with prompt caching | Strong within one to three filings (Design rationale); across 973 filings it runs into context and cost limits (Not tested) | (Not tested) | Quotes need checking afterwards to confirm they weren’t paraphrased (Design rationale) | Expensive to re-read 186 companies’ filings for every question (Design rationale) | Wins outright for ad-hoc deep dives into one or two filings, where building an index isn’t worth the setup (Design rationale) |
| 6. Hybrid RAG with a bitemporal graph (this system) | Semantic search (Qwen3-Embedding-0.6B) plus SQL and graph traversal (Built) over 45,791 entities and 40,910 claims (Measured: counts); retrieval quality is a planned v2 eval (Not tested) | Claude Sonnet 4.6 kept over Sonnet 5 after a 119-section A/B in which Sonnet 5 found 84% fewer company entities (Measured) | Bitemporal versioning, the filing and section on all 394,913 chunks, and a manual-review queue (Built) | Upfront extraction cost of about $0.300 per section (Measured); per-query cost (Not tested) | Repeatable cross-company questions, year-over-year diffs and point-in-time research that can be audited (Design rationale) |
Separate from the private system above: the public sample's query traces (61 filings, 12 companies), produced by the public rewrite.
How the private pipeline works
- Section detection for 10-K and 10-Q items, then sentence-boundary chunking of long sections.
- Claude extraction into a closed vocabulary of claim and entity types.
- Identifier-first entity linking: ticker or CIK first, then a fuzzy name match. Ambiguous matches go to a manual-review queue.
- Time-decayed confidence on extracted facts.
- A query layer with semantic vector search, graph and SQL lookups and traversal, a read-only FastAPI and React explorer, and agent skills that query it.
Operational controls
- Bitemporal versioning. Prior versions are closed out, never deleted, so a query sees what was known at that time.
- Provenance on every chunk. Each chunk carries its filing and section, for example Item 1A Risk Factors.
- Closed extraction vocabulary. Extraction is limited to a fixed set of claim and entity types.
- Manual-review queue. Ambiguous entity matches go to a queue for a person to review.
Filing signals (shadow mode only)
Three signals compare a filing with the prior year’s: tone shift (embedding drift between a section and the same section a year earlier), FinBERT sentiment shift, and an LLM claim-by-claim diff between the two filings. The tone-shift idea comes from the Lazy Prices paper. That paper is the motivation only; I did not replicate it and make no claim about returns.
The signals run in shadow mode. They are computed but switched off for trading, so the knowledge base does not drive trades.
FinBERT reads at most 512 tokens. In the public sample, 747 of the 2,898 chunks scored (25.8%) were longer and were truncated, so their sentiment reflects only their first 512 tokens.
The public rewrite
The public repository is a rewrite of the private pipeline: the code is rewritten, not copied. Two things come over unchanged, the v3 extraction prompt and the extractions it produced, which are committed. make traces-from-cache rebuilds every trace from the committed answers with no API key and no network. make sample-refresh re-runs extraction live, with your own API key and at your cost.
My role
I was the architect, product manager and engineering team lead; AI coding agents worked like my staff engineers and wrote most of the code.
Known limits & sample caveats
Known limits
Private system
- Filing signals run in shadow mode only.
- The corpus is mostly 10-Ks: 44 10-Qs, some 20-Fs and no 8-Ks.
- About 25,000 entity-resolution reviews are still open.
- Ingests ran as manual batches through mid-November 2026.
Public sample
- Sample size. 12 companies, 61 filings and 12 traces, one run and one model each. They show how the pipeline works; they don’t evaluate it.
- Fidelity coverage. The section-text fidelity check covers 682 of 824 sections. Sections the private pipeline split, and sections the public detector did not find, are not in it.
- Sentiment truncation. FinBERT truncated 747 of the 2,898 chunks it scored (25.8%). 4 of the 96 signal rows have no sentiment or tone value.
- Same-day amendment. AMD filed its FY2025 10-K and 10-K/A on the same day (2026-02-04), so a date-based point-in-time query can’t show the 17 superseded claims. The AMD trace shows them from their close-out record instead.
- Missing MD&A. No Item 7 is detected in Intel’s 10-Ks, and CVX, JPM and XOM incorporate theirs by reference, so the questions avoid Item 7 for those four companies.
- Table figures. A number that a cited passage holds only as a bare table cell is checked by a person, not by code. 8 of the 144 numbers in the 12 answers are on that audit list.
- Reproducing extractions. The committed extractions come from the private pipeline. A new model run will not reproduce them exactly.