Filings Analyst
A research workspace over SEC filings that separates structured financial facts from narrative retrieval, checks generated claims against their sources, and makes missing evidence visible.
Role: Independent builder
AI stack
text-embedding-3-small · 1,536 dimensions · pgvector + PostgreSQL full-text · Section-aware parent / child chunks · LangGraph + numeric verification
Filings Analyst is a research workspace over SEC filings: 10-Ks, 10-Qs, and earnings releases filed as 8-K exhibits. Numeric questions use structured financial facts. Narrative questions retrieve filing passages. The design separates writing an answer from checking its evidence.

Product preview


The problem
A useful financial answer needs more than a plausible number. The reader needs to know which company, filing, period and unit it describes, and how a derived figure was calculated. Filings Analyst keeps that context attached to the evidence rather than asking the language model to reconstruct it from prose.
Structured facts for financial questions
Numeric questions route to SEC company facts, where values carry taxonomy concepts, units and periods. Narrative retrieval serves a different purpose: finding the passages that explain the business and its disclosures.
Periods are resolved from the fact's dates, and canonical occurrences are selected among repeated disclosures. For additive measures, a fourth quarter can be derived from an annual total minus the three eligible quarters inside the same fiscal year. Missing quarters and non-additive measures do not support that calculation. Derived values retain their inputs and formula.
Press-release extraction uses exact source spans and stores eligible figures as provisional evidence for reconciliation against later XBRL facts. Source coverage can differ between financial facts and indexed filing text.

Verification before the filing answer
The filing-answer pipeline checks generated claims against cited evidence before publishing its answer event. The verifier binds supported claim types to company, metric subject, period, duration, unit and value, and recomputes derived figures from their inputs. It also checks supported count and attribution cases. Unsupported or ambiguous claims can be withheld, with a reason shown to the reader.
This is a defined set of checks, not a guarantee that every possible factual mistake is detected. Citation membership, numerical agreement and semantic correctness are different properties. The product keeps a missing source, an unsuccessful retrieval and a rejected draft distinguishable so the reader can understand the limit.
Under the hood
Flow: rewrite and resolve filing scope → structured facts, narrative retrieval or statement analysis → draft → verify and bounded repair → checked answer → separately labelled web background.
The model names and numeric settings below are current source defaults, not a fresh check of the deployed environment. Generation defaults to gpt-5.4; rewriting, fast analysis and the narrative judge default to gpt-5.4-mini.
Embeddings, parsing and chunking
OpenAI text-embedding-3-small produces explicitly configured 1,536-dimensional embeddings. The checked-in vector schema enforces that width. An optional local HuggingFace adapter exists, but changing models requires reembedding; an existing index cannot be relabelled as another model.
HTML/inline-XBRL parsing removes hidden material, retains table rows and identifies filing Items and Parts. Section-aware children default to 350 tokens with up to fifty-token overlap; parent windows are about 1,500 tokens and do not cross section boundaries. The tokenizer is cl100k_base. Paragraphs, subsection headings and repeated table headers survive splitting. Company, form, reporting period, Item and subsection accompany each embedded chunk.
The documented decision is to use small children for matching and larger parents for reading context. Context headers distinguish similar statements across issuers and periods. Structured XBRL facts remain separate from prose chunks, carrying metric identity, period, unit and filing provenance.
Retrieval, rank fusion and optional reranking
Dense search uses pgvector cosine distance with SQL scope constraints; lexical search uses PostgreSQL full-text ranking, not BM25. A long question with too few AND matches can top up from an OR query while retaining filing scope and removing duplicates.
Dense and lexical searches run concurrently on separate connections, each contributing up to thirty candidates by default. Deterministic reciprocal-rank fusion uses a rank constant of sixty. The project documents this choice as avoiding incompatible raw-score scales and protecting exact names and Item identifiers that semantic search can blur.
Cross-encoder reranking with BAAI/bge-reranker-v2-m3 is optional and disabled by default. It avoids a mandatory heavyweight dependency. The narrative path requests twelve reranked candidates and expands the first ten into deduplicated parents. Its nominal parent-context budget is 6,000 tokens, but an initial oversized window and other evidence additions mean this is not a universal request cap. Whole-Item reading has a separate 16,000-token path.
Agent flow, facts and verification
The public answer path is a fixed LangGraph workflow: rewrite, analyze, gather evidence, generate, verify and finish. Scope resolves company, form and period before retrieval. Statement analysis constructs financial cells and derived inputs before finding explanatory passages.
Financial claims bind company, metric subject, period/duration, canonical unit, value and filing identity. Derived results keep their formula and complete input chain. Exact-span earnings-release figures are provisional until reconciled with compatible XBRL facts. Unsupported claims can be repaired within bounded limits, removed or shown as an evidence gap. Only the checked filing answer is delivered; optional web background follows separately.
A model-sequenced LangGraph tool loop and CrewAI workflow are separate experiments. They do not replace the fixed public graph or establish better performance. The experimental tools are read-only and include metric lookup, filing search, comparison and whole-section reading.
Evaluation and operational limits
The checked-in datasets contain sixty-eight numeric, thirty narrative, thirty unanswerable, thirty-one analysis and six conversation records. Those counts describe evidence scope, not release accuracy. Retrieval grading includes MRR and nDCG; the measure called recall in the code is an any-relevant-anchor hit rate, not the fraction of all relevant passages recovered.
Numeric grading checks value and evidence identity. Statement grading recomputes cells and formulas; a separate model prompt judges narrative faithfulness, citations and readability. The runner records code, configuration, corpus and model provenance. Blind human grading remains unfinished, and no new paid release benchmark or superiority claim follows from this review.
Demo/live modes prevent synthetic fallback from masquerading as live results. Question, queue, concurrency, provider, token and call limits bound work. SEC access uses shared rate limiting, bounded retries and integrity-checked caches. Public ingestion is disabled by default. Retention is operator-managed, and browser-provided keys are separate from institutional identity. Missing or incompatible evidence remains unavailable; the workspace explains filings rather than providing investment advice.
Operational boundaries
Demo and live modes are explicit. Live-mode failures do not trigger a synthetic-data substitution. Web background and delayed quotes are presented separately from the filing-grounded answer. Session allowances, concurrency and queue limits bound runtime work; operator-funded calls use estimated spend reservations. These controls do not replace provider billing limits.
Ingestion distinguishes exhausted provider quota from a transient rate limit. Quota exhaustion stops a batch rather than spending the remaining retry budget on an error that waiting cannot fix. Corpus readiness and missing narrative coverage are separate signals: having financial facts does not establish that the relevant filing text is indexed.
The workspace explains filings. It is not investment advice.
Capstone continuation and verification
The Financial Research Coordinator capstone folder contains this Filings Analyst codebase, rather than a separate product. Its continuation includes deterministic statement analysis, exact filing selection and operational controls in the same research workspace.
The checked-in evaluation sets cover numeric, narrative, unanswerable and statement-analysis questions. The runner records code, model, configuration and corpus provenance. Those artifacts support reproducible evaluation; they do not establish current release accuracy on their own.
For this portfolio update, twenty selected offline tests in the financial-fact and analytical-review suites passed. They check cases such as fiscal-period selection, withholding unsupported fourth-quarter derivations and recomputing review figures. The update did not rerun the full verifier, API, ingestion-recovery, database-integration or provider-backed evaluation suites.
Blind human grading remains unfinished. Historical development results are not current release benchmarks, and this case study makes no superiority or latency claim against another tool or execution strategy.
Status and limits
The project has a working research application and a documented Fly.io deployment at the link above. This portfolio review did not recheck the hosted service or its current corpus. Local implemented behavior, tested behavior and the deployed version should be assessed separately.
Financial-fact and narrative coverage are incomplete and differ by company, form and period. Earnings-call transcripts are outside the filing corpus. Missing or incompatible inputs remain unavailable rather than supporting an invented figure. This is an independent research project, with broader evaluation and production-validation work remaining.
Related writing: Book notes: the RAG chapter of AI Engineering, on hybrid retrieval and document-aware chunking, and What a risk desk taught me about evaluating AI agents.