Pipeline: filing → passage → citation
- Resolve issuer, form, filing date, report period and accession.
- Separate the primary document from exhibits and inline XBRL artifacts.
- Parse headings, Items, paragraphs and tables without flattening structure.
- Chunk within meaningful sections and attach source metadata.
- Retrieve with filters, lexical search and semantic search; rerank the candidate set.
- Return the exact filing URL, section and passage with every answer.
Chunk record shape
{
"cik": "0000320193", "form": "10-K",
"accession": "0000320193-25-000079",
"section": "Item 1A. Risk Factors",
"text": "...", "source_url": "https://www.sec.gov/Archives/..."
}Retrieval is not one vector query
Filter by issuer, form and reporting period before ranking. Combine exact language with semantic similarity, then rerank. Test whether citations actually entail the generated answer rather than merely sharing keywords.
Keep numbers structured
Retrieve narrative and XBRL separately. Use structured facts for reported values and prose for explanation; reconcile period, unit and filing before presenting both.
Common failure modes
- Indexing navigation, repeated headers and exhibit lists as meaningful prose.
- Splitting tables from headings or units.
- Combining amendments with the original without version rules.
- Citing a whole 10-K rather than an anchored passage.
- Letting retrieved historical statements answer a current-period question.
Form-aware parsing starts with the SEC forms guide. Compare explicit retrieval platforms in the API field report, including Bigdata.com and ingestion-focused sec-api.io.