This directory contains parsers that convert intermediate source formats into LlamaIndex Document objects with consistent metadata.
High-level pipeline:
- Parse source artifacts into an intermediate representation (for PDFs, typically LlamaParse JSON).
- Chunk and normalize content into
Documentobjects (with provenance metadata likesource,page_number,bbox). - Optionally emit specialized
Documenttypes (for exampletype="table"for CSV table chunks) that downstream KG extractors can consume.
For the knowledge-graph extraction step, see packages/src/ingestion/kg_extractors/README.md.
pdf_parser.py: generic LlamaParse JSON loader that emitsDocumentchunks with basic provenance metadata.form1040_parser.py: IRS Form 1040 instructions parser that creates section-level documents and emitstype="table"docs when a table is encountered.title26_parser.py: Title 26 parser that extracts legal hierarchy markers (section, subsection, paragraph, etc.) and writes hierarchy metadata used downstream byTitle26HierarchyExtractor.
Title 26 and Form1040 parsing is documented in-depth separately to avoid duplication:
tax_history_csv_parser.py: parsestax_data.csvinto row-level narrative documents and aggregated summary documents using strict Pydantic models (seepackages/src/ingestion/models/csv_data_model.py).