How shivamrai009/finance-graph-rag works
This repository is an SEC-filings ingestion and financial question-answering product. Its main workflow fetches filings, processes them into sections and embeddings, stores them in a Neo4j graph, then retrieves relevant evidence to answer user questions with citations. The graph preserves separate ingestion entry points and specialized insider-trading processing. Some connections are supported only by the README or SOURCE INDEX; unsampled implementation details are not assumed.
Main entry points: enhanced_sec_pipeline.py Enhanced Pipeline · neo4j_retrieval_engine.py Hybrid Retrieval · secio_client.py SECIO Wrapper · neo4j_client.py Graph Client
Components 20
Ingestion
- Comprehensive Ingest
comprehensive_sec_ingest.py - Ingestion Engine
data_ingestion_engine.py - Enhanced Pipeline
src/data/enhanced_sec_pipeline.py - Ticker Ingest
ingest_all_tickers.py - Ingest CLI
scripts/enhanced_ingest_cli.py - Research Collector
scripts/assignment_collector.py - Research Scope
config/assignment_strategy.py - EDGAR Client
src/data/sec_edgar_client.py - SECIO Wrapper
src/data/secio_client.py
Document Processing
- Filing Processor
src/data/document_processor.py - Insider Forms
src/data/forms_345_processor.py - Embedding Ensemble
src/core/embedding_ensemble.py
Question Answering
- SEC QA System
sec_qa_system.py - Question Answering
question_answering_system.py - Hybrid Retrieval
src/core/neo4j_retrieval_engine.py
Knowledge Graph
- Graph Client
src/storage/neo4j_client.py - Neo4j Graph
Other components
- Researcher
- SEC EDGAR
- GPT-4o
Connections 25
- Researcher → SEC QA System: asks questions
README.md - Researcher → Question Answering: asks questions
README.md - SEC QA System → Hybrid Retrieval: retrieves evidence
- Question Answering → Hybrid Retrieval: retrieves evidence
question_answering_system.py - Hybrid Retrieval → Embedding Ensemble: embeds queries
src/core/neo4j_retrieval_engine.py - Hybrid Retrieval → Graph Client: searches graph
src/core/neo4j_retrieval_engine.py - Hybrid Retrieval → GPT-4o: supplies evidence
README.md - GPT-4o → Researcher: returns cited answers
README.md - Comprehensive Ingest → EDGAR Client: fetches filings
- Comprehensive Ingest → SECIO Wrapper: gets filing content
comprehensive_sec_ingest.py - Comprehensive Ingest → Filing Processor: processes filings
comprehensive_sec_ingest.py - Ingestion Engine → SECIO Wrapper: gets filing content
data_ingestion_engine.py - Ingestion Engine → Filing Processor: extracts sections
data_ingestion_engine.py - Ingestion Engine → Enhanced Pipeline: delegates ingestion
data_ingestion_engine.py - Enhanced Pipeline → Filing Processor: chunks documents
src/data/enhanced_sec_pipeline.py - Enhanced Pipeline → Insider Forms: processes insider forms
src/data/enhanced_sec_pipeline.py - Enhanced Pipeline → Embedding Ensemble: generates embeddings
src/data/enhanced_sec_pipeline.py - Enhanced Pipeline → Graph Client: stores records
src/data/enhanced_sec_pipeline.py - Ticker Ingest → SECIO Wrapper: fetches filings
ingest_all_tickers.py - Ingest CLI → Enhanced Pipeline: runs ingestion
scripts/enhanced_ingest_cli.py - Research Collector → Research Scope: uses research scope
scripts/assignment_collector.py - SECIO Wrapper → EDGAR Client: wraps client
src/data/secio_client.py - EDGAR Client → SEC EDGAR: requests filings
README.md - Embedding Ensemble → Graph Client: stores vectors
- Graph Client → Neo4j Graph: reads and writes
src/storage/neo4j_client.py