How gilgamish-hub/finreport-agent works
FinReport Agent takes an analyst’s question about a selected company filing and returns a grounded answer with cited pages, optionally routing direct lookups through plain RAG and calculations or comparisons through an agent loop. Filings are extracted into page-aware chunks for hybrid retrieval; the agent grades and may rewrite searches, reasons over full pages, uses a calculator, and verifies numerical support. Streamlit, FastAPI, and MCP expose the product. The README documents evaluation and routing capabilities; unsampled modules are represented conservatively, with uncertain wiring omitted.
Main entry points: graph.py Agent workflow · ingest.py PDF ingestion · retriever.py Hybrid retrieval · app.py Streamlit demo
Components 19
Filing ingestion
- PDF ingestion
finagent/ingest.py - Chroma index
finagent/ingest.py - Runtime configuration
finagent/config.py
Answering engine
- Hybrid retrieval
finagent/retriever.py - Agent workflow
finagent/graph.py - Agent prompts
finagent/prompts.py - Answer grounding
finagent/grounding.py - Safe calculator
finagent/tools.py - Model adapters
finagent/llm.py
User interfaces
- Streamlit demo
app.py - HTTP API
finagent/api.py - MCP server
finagent/mcp_server.py - Demo data
finagent/demo.py
Evaluation
- Plain RAG baseline
finagent/baseline.py - Benchmark evaluation
finagent/evaluate.py
Other components
- Analyst
- Filing PDFs
- LLM providers
- MCP client
Connections 24
- Analyst → Streamlit demo: asks questions
README.md - Analyst → HTTP API: asks questions
README.md - MCP client → MCP server: searches and asks
README.md - Filing PDFs → PDF ingestion: extracts pages
finagent/ingest.py - PDF ingestion → Chroma index: indexes chunks
finagent/ingest.py - Chroma index → Hybrid retrieval: supplies chunks
finagent/retriever.py - Hybrid retrieval → Chroma index: searches index
finagent/retriever.py - Agent workflow → Hybrid retrieval: retrieves evidence
finagent/graph.py - Agent workflow → Agent prompts: formats model tasks
finagent/graph.py - Agent workflow → Safe calculator: dispatches calculations
finagent/graph.py - Agent workflow → Answer grounding: checks support
finagent/graph.py - Agent workflow → Model adapters: invokes models
finagent/graph.py - Streamlit demo → Agent workflow: runs workflow
app.py - Streamlit demo → PDF ingestion: validates uploads
app.py - Streamlit demo → Demo data: loads examples
app.py - HTTP API → Agent workflow: runs workflow
finagent/api.py - HTTP API → PDF ingestion: lists indexed reports
finagent/api.py - MCP server → Agent workflow: exposes agent tools
- Model adapters → LLM providers: calls models
- Plain RAG baseline → Hybrid retrieval: uses retrieval
- Benchmark evaluation → Plain RAG baseline: compares baseline
- Benchmark evaluation → Agent workflow: evaluates answers
- PDF ingestion → Runtime configuration: reads settings
finagent/ingest.py - Hybrid retrieval → Runtime configuration: reads limits
finagent/retriever.py