Back to portfolio GitHub

Reliable multi-tool financial AI

Agentic RAG for Financial Intelligence

A LangGraph system that routes SEC filing questions to semantic retrieval, structured SQL analysis, live EDGAR search, or a combined workflow—then validates numeric answers before returning them.

100% routing accuracy across 19 evaluation questions
LangGraphOpenAIChromaDBSQL ServerSEC EDGARPython

Why this problem needed a different architecture

Standard RAG is effective for qualitative questions but can silently fail on exact financial figures by retrieving narrative passages instead of authoritative structured values.

How I approached it

I designed a routing layer that classifies each query and dispatches it to the right retrieval method. Numeric and cross-document answers pass through an additional validator grounded in SQL data.

  1. Router classifies narrative, numeric, current, and cross-document queries
  2. ChromaDB retrieves 10-K narrative sections
  3. SQL Server answers exact financial and comparison questions
  4. SEC EDGAR handles filing recency
  5. Synthesis produces grounded responses with source context
  6. Validator checks generated figures against structured ground truth
  • 19/19 evaluation questions routed correctly
  • 5/5 validator stress tests handled correctly
  • Cross-document answers combine management narrative with financial evidence