How q-fis/finforge-vanilla works
Vanilla RAG answers questions about Indian companies’ annual reports. A run loads configuration and the report registry, processes PDFs into searchable chunks, retrieves evidence for each question, builds a tagged context, generates an answer, checks citations, and scores and traces results. Retrieval supports dense and TF-IDF search; the README also documents evaluation and run comparison. The run excerpt is partial, so stage links also rely on its indexed references and README workflow; unsampled implementations are not inferred beyond those documented relationships.
Main entry points: run.py Run orchestrator · retrieve.py Retrieval coordinator · registry.py Report registry · chunking.py Chunking
Components 26
Corpus preparation
- Report registry
src/rag/registry.py - Annual report PDFs
data/pdfs - PDF parser
src/rag/rep/parse.py - Text cleaning
src/rag/rep/clean.py - Chunk metadata
src/rag/rep/metadata.py - Chunking
src/rag/rep/chunking.py - Token counting
src/rag/rep/tokens.py
Retrieval
- Text embeddings
src/rag/rep/embed.py - Retrieval coordinator
src/rag/ret/retrieve.py - Dense index
src/rag/ret/retrieve.py - TF-IDF index
src/rag/ret/tfidf.py - Hit deduplication
src/rag/ret/filters.py
Answer generation
- Context builder
src/rag/gen/context.py - Answer generator
src/rag/gen/generate.py - Language model
src/rag/gen/llm.py - Citation validation
src/rag/gen/citations.py
Evaluation
- Run orchestrator
src/rag/run.py - Run configuration
src/rag/config.py - Answer scoring
src/rag/score.py - Retrieval metrics
src/rag/ret/metrics.py - Failure tracing
src/rag/failure_trace.py - Run comparison
src/rag/compare.py - Run outputs
src/rag/run.py - Evaluation questions
eval/questions.jsonl - Pipeline data types
src/rag/schema.py
Other components
- Questioner
Connections 27
- Questioner → Run orchestrator: starts run
README.md - Run orchestrator → Run configuration: loads settings
src/rag/run.py - Run orchestrator → Report registry: loads registry
src/rag/run.py - Report registry → Annual report PDFs: locates PDFs
src/rag/registry.py - Run orchestrator → PDF parser: parses reports
README.md - Run orchestrator → Text cleaning: cleans text
README.md - Run orchestrator → Chunk metadata: adds metadata
README.md - Run orchestrator → Chunking: chunks documents
src/rag/run.py - Chunking → Token counting: counts tokens
src/rag/rep/chunking.py - Run orchestrator → Text embeddings: embeds chunks
src/rag/run.py - Run orchestrator → Dense index: builds index
src/rag/run.py - Run orchestrator → TF-IDF index: builds index
src/rag/run.py - Run orchestrator → Retrieval coordinator: retrieves evidence
src/rag/run.py - Retrieval coordinator → Text embeddings: embeds query
src/rag/ret/retrieve.py - Retrieval coordinator → Dense index: searches dense
src/rag/ret/retrieve.py - Retrieval coordinator → TF-IDF index: searches terms
src/rag/ret/retrieve.py - Retrieval coordinator → Hit deduplication: deduplicates hits
src/rag/ret/retrieve.py - Run orchestrator → Context builder: builds context
src/rag/run.py - Run orchestrator → Answer generator: generates answer
src/rag/run.py - Answer generator → Language model: requests completion
src/rag/gen/generate.py - Run orchestrator → Citation validation: checks citations
src/rag/run.py - Run orchestrator → Answer scoring: scores answer
src/rag/run.py - Run orchestrator → Retrieval metrics: measures retrieval
src/rag/run.py - Run orchestrator → Failure tracing: labels failures
src/rag/run.py - Run orchestrator → Evaluation questions: loads questions
src/rag/run.py - Run orchestrator → Run outputs: writes results
src/rag/run.py - Run comparison → Run outputs: compares runs