How rajdeepofgithub/sec-filings-rag works
SEC Filings RAG ingests filings and earnings-call transcripts, structures their content into section-aware chunks, indexes them for dense and sparse search, and answers questions with cited evidence. The principal query path combines retrieval, deduplication, rank fusion, reranking, grounded generation, citation checks, and a confidence signal. Separate evaluation and baseline artifacts measure behavior. The graph includes documented capabilities even where implementation excerpts are absent; those links cite the README, and unsampled implementation details are not inferred.
Main entry points: generator.py Grounded Answer Generator · loader.py Document Loader · pipeline.py Search Orchestrator · indexer.py Index Builder
Components 22
Document Ingestion
- Document Loader
src/loader.py - Document IR
src/ir.py - Table Profiler
src/table_profile.py - Table Converter
src/table_convert.py - Section Detection
src/sections.py - Structure-aware Chunker
src/chunker.py
Corpus and Indexing
- Corpus Builder
src/corpus.py - Text Embedder
src/embedder.py - Index Builder
src/indexer.py
Hybrid Search
- Search Orchestrator
src/pipeline.py - Dense and Sparse Retrieval
src/retriever.py - Dedup and Rank Fusion
src/fusion.py - Cross-encoder Reranker
src/reranker.py
Answer and Verification
- Grounded Answer Generator
src/generator.py - Citation Verifier
src/verify.py
Evaluation
- Answer Grader
src/grading.py - Baseline Runs
baseline
Other components
- Questioner
- Filings and Transcripts
- ChromaDB
- BM25 Index
- OpenAI API
Connections 25
- Filings and Transcripts → Document Loader: loads
src/loader.py - Document Loader → Document IR: builds blocks
src/loader.py - Document Loader → Table Profiler: profiles tables
src/loader.py - Document Loader → Table Converter: converts tables
src/loader.py - Corpus Builder → Document Loader: loads documents
src/corpus.py - Corpus Builder → Section Detection: attributes sections
src/corpus.py - Corpus Builder → Structure-aware Chunker: chunks documents
src/corpus.py - Structure-aware Chunker → Document IR: reads blocks
src/chunker.py - Index Builder → Corpus Builder: builds from
src/indexer.py - Index Builder → Text Embedder: embeds chunks
src/indexer.py - Index Builder → ChromaDB: writes vectors
src/indexer.py - Index Builder → BM25 Index: builds index
src/indexer.py - Questioner → Search Orchestrator: submits query
src/pipeline.py - Search Orchestrator → Dense and Sparse Retrieval: runs searches
src/pipeline.py - Dense and Sparse Retrieval → Text Embedder: embeds query
src/retriever.py - Dense and Sparse Retrieval → ChromaDB: queries vectors
src/retriever.py - Dense and Sparse Retrieval → BM25 Index: queries terms
src/retriever.py - Search Orchestrator → Dedup and Rank Fusion: deduplicates and fuses
src/pipeline.py - Search Orchestrator → Cross-encoder Reranker: reranks candidates
src/pipeline.py - Grounded Answer Generator → Search Orchestrator: retrieves context
src/generator.py - Grounded Answer Generator → OpenAI API: generates answer
README.md - Grounded Answer Generator → Citation Verifier: checks citations
README.md - Grounded Answer Generator → Questioner: returns cited answer
README.md - Answer Grader → Grounded Answer Generator: grades answers
src/grading.py - Baseline Runs → Answer Grader: provides eval cases
README.md