fastrag.retrieval.sections#
Database-independent exact source context for structural retrieval hits.
Classes
|
Original retained section syntax, with document-scoped provenance. |
|
Keep source parents outside vector chunks and resolve merged sections. |
- class fastrag.retrieval.sections.SectionContext(document_id, section_id, content, source_spans, heading_path)[source]#
Bases:
objectOriginal retained section syntax, with document-scoped provenance.
- class fastrag.retrieval.sections.SectionIndex(documents=())[source]#
Bases:
objectKeep source parents outside vector chunks and resolve merged sections.
- Parameters:
documents (Iterable[NormalizedDocument])
- add(document)[source]#
Register a validated parent; conflicting document IDs are rejected.
- Parameters:
document (NormalizedDocument)
- Return type:
None