How ro5f6/finai_agent works
FinAI-Agent is an investment-research assistant: a user query is planned by a LangGraph agent, answered with filing, market, or portfolio tools, and numerically verified before return. Separately, an ingestion command fetches and prepares SEC 10-K content for retrieval. The graph preserves README-documented capabilities, including structured financial history and portfolio-risk measures, though their implementations were not sampled. API routers appear empty in the tree; edges for unsampled runtime behavior are included only where the README or source index supports them.
Main entry points: ingest.py Ingestion runner · nodes.py LangGraph planner · agent_tools.py Agent tool wrappers · portfolio.py Portfolio analytics
Components 21
Research agent
- LangGraph planner
src/finai/agent/nodes.py - Research prompt
src/finai/agent/prompts.py - Agent state
src/finai/agent/state.py - Number verifier
src/finai/guardrails
Research tools
- Agent tool wrappers
src/finai/tools/agent_tools.py - 10-K search
src/finai/tools/filings.py - Financial history
src/finai/tools/filings.py - Live market data
src/finai/tools/market_data.py - Portfolio analytics
src/finai/tools/portfolio.py
Filing ingestion
- Ingestion runner
src/finai/ingestion/ingest.py - SEC fetch/archive
src/finai/ingestion/fetch.py - 10-K extraction
src/finai/ingestion/parse.py - Filing cleanup
src/finai/ingestion/clean.py - Table-aware chunks
src/finai/ingestion/chunk.py
Data services
- Embedding and reranking
src/finai/ingestion/embed.py - Vector search
src/finai/ingestion/store.py - Qdrant
- Voyage AI
- Finnhub
- Alpaca bars
Other components
- Research user
Connections 25
- Research user → LangGraph planner: asks
README.md - LangGraph planner → Research prompt: uses prompt
src/finai/agent/nodes.py - LangGraph planner → Agent state: uses state
src/finai/agent/nodes.py - LangGraph planner → Agent tool wrappers: dispatches tools
src/finai/agent/nodes.py - Agent tool wrappers → 10-K search: calls
src/finai/tools/agent_tools.py - Agent tool wrappers → Live market data: calls
src/finai/tools/agent_tools.py - Agent tool wrappers → Portfolio analytics: calls
src/finai/tools/agent_tools.py - Agent tool wrappers → Financial history: provides
README.md - 10-K search → Embedding and reranking: embeds query
src/finai/tools/filings.py - 10-K search → Vector search: searches
src/finai/tools/filings.py - Financial history → Research user: returns statements
README.md - Live market data → Finnhub: fetches quotes
src/finai/tools/market_data.py - Portfolio analytics → Alpaca bars: gets daily bars
README.md - LangGraph planner → Number verifier: checks numbers
README.md - Number verifier → Research user: returns answer
README.md - Ingestion runner → SEC fetch/archive: fetches filings
src/finai/ingestion/ingest.py - Ingestion runner → 10-K extraction: extracts items
src/finai/ingestion/ingest.py - Ingestion runner → Filing cleanup: cleans items
src/finai/ingestion/ingest.py - Ingestion runner → Table-aware chunks: builds chunks
src/finai/ingestion/ingest.py - Ingestion runner → Embedding and reranking: embeds chunks
src/finai/ingestion/ingest.py - Ingestion runner → Vector search: upserts chunks
src/finai/ingestion/ingest.py - Embedding and reranking → Voyage AI: embeds and reranks
src/finai/ingestion/embed.py - Vector search → Qdrant: reads and writes
src/finai/ingestion/store.py - Portfolio analytics → Research user: reports holdings
README.md - Portfolio analytics → Research user: computes risk metrics
README.md