How pranabesh14/esg_report_analyser works
This is a CLI/Python API multimodal PDF knowledge base. Users ingest year-tagged PDFs, then query for cited answers: parsing and chart extraction create units, entity resolution and relationship extraction connect cross-page content, and hybrid retrieval expands vector/BM25 matches through those links before evidence aggregation and answer generation. The README documents capability stages whose orchestration details are not fully shown in excerpts; those links are included only where the README or sampled caller supports them. Sampled storage is SQLite/Postgres relational data plus FAISS and BM25.
Main entry points: pipeline.py Pipeline orchestrator · llm_provider.py LLM provider factory · hybrid_retriever.py Hybrid graph retrieval · vision_extractor.py Chart extraction
Components 19
Document ingestion
- PDF layout parser
ingestion/pdf_parser.py - Chart extraction
ingestion/vision_extractor.py
Entity knowledge
- Mention extraction
entities/extraction.py - Canonical resolution
entities/resolution.py - Relationship extraction
relationships/extraction.py - Context summarization
entities/contextual_summarizer.py
Persistence
- Relational store
storage/relational_store.py - Dual vector index
storage/vector_store.py - BM25 index
storage/bm25_store.py
Retrieval and answers
- Hybrid graph retrieval
retrieval/hybrid_retriever.py - Evidence aggregation
retrieval/evidence_aggregator.py - Cited answer generation
generation/answer_generator.py
Shared services
- Pipeline orchestrator
pipeline.py - Shared data schemas
core/schemas.py - Runtime configuration
config/settings.py - LLM provider factory
core/llm_provider.py
Other components
- CLI/API user
- CLI
cli.py - Anthropic / Azure OpenAI
Connections 30
- CLI/API user → CLI: runs commands
README.md - CLI/API user → Pipeline orchestrator: calls API
README.md - CLI → Pipeline orchestrator: invokes
README.md - Pipeline orchestrator → PDF layout parser: parses PDFs
pipeline.py - Pipeline orchestrator → Chart extraction: processes images
pipeline.py - PDF layout parser → Chart extraction: yields images
ingestion/vision_extractor.py - Pipeline orchestrator → Mention extraction: extracts mentions
README.md - Pipeline orchestrator → Canonical resolution: resolves mentions
pipeline.py - Pipeline orchestrator → Relationship extraction: extracts links
pipeline.py - Pipeline orchestrator → Context summarization: summarizes units
pipeline.py - Canonical resolution → LLM provider factory: embeds, disambiguates
entities/resolution.py - Chart extraction → LLM provider factory: extracts chart data
ingestion/vision_extractor.py - Relationship extraction → LLM provider factory: infers relations
relationships/extraction.py - Context summarization → LLM provider factory: creates context
entities/contextual_summarizer.py - Pipeline orchestrator → Relational store: loads and saves
pipeline.py - Pipeline orchestrator → Dual vector index: indexes embeddings
pipeline.py - Pipeline orchestrator → BM25 index: indexes text
pipeline.py - Pipeline orchestrator → LLM provider factory: embeds units
pipeline.py - Hybrid graph retrieval → LLM provider factory: embeds query
retrieval/hybrid_retriever.py - Hybrid graph retrieval → Dual vector index: searches vectors
retrieval/hybrid_retriever.py - Hybrid graph retrieval → BM25 index: searches terms
retrieval/hybrid_retriever.py - Hybrid graph retrieval → Relational store: loads seeds, expands graph
retrieval/hybrid_retriever.py - Pipeline orchestrator → Hybrid graph retrieval: retrieves evidence
README.md - Pipeline orchestrator → Evidence aggregation: aggregates evidence
README.md - Pipeline orchestrator → Cited answer generation: generates answer
README.md - Evidence aggregation → Cited answer generation: provides evidence
generation/answer_generator.py - Cited answer generation → LLM provider factory: writes answer
generation/answer_generator.py - LLM provider factory → Anthropic / Azure OpenAI: dispatches provider calls
core/llm_provider.py - Runtime configuration → Pipeline orchestrator: configures runtime
pipeline.py - Shared data schemas → Pipeline orchestrator: models pipeline data
README.md