Financial AI Agent
Ask a question about a stock, get a sourced, structured answer. A local NLP pipeline (NER, intent classification, sentiment) analyses each question first, then an LLM agent with live market-data, web-search, charting, Excel and RAG tools streams the answer into a React chat UI.
Overview
What it does
Classifies each question, picks intent-specific answer rules, then lets an agent call market-data, search, chart, Excel and RAG tools to produce a sourced answer.
Built as
A CSE495B (Natural Language Processing) course project, shipped with evaluation tooling: a gold-standard test set, an ablation study, calibration and bootstrap confidence intervals.
Note
An educational project — not financial advice.
Every request streams over Server-Sent Events: the NLP analysis arrives first, then the answer, a structured research card and which model answered. A fresh agno agent runs per request and only sees the last 10 messages of its own session; conversations are tied to an anonymous per-browser id.
Key Features
Streaming answers
Staged progress messages, a stop button, visible retry notices when rate-limited, plus Copy and Regenerate on every answer.
NLP pre-processing
spaCy NER with a company→ticker map, an 8-class intent classifier (TF-IDF + logistic regression) and VADER sentiment, shown in a collapsible panel.
Intent-aware prompting
Each intent gets its own response rules; price, news and recommendation questions also get headline sentiment.
Agent tools
Yahoo Finance prices, fundamentals, ratings and news; DuckDuckGo search; inline matplotlib charts; Excel reports; RAG over a financial-concepts base with citations.
Provider fallback
OpenRouter, Groq or local Ollama chosen by one environment variable, with an automatic backup chain when the primary is busy.
Saved conversations
SQLite history with rename, delete and reload, plus dark/light theme and voice input.
Tech Stack
| LLM | OpenRouter openai/gpt-oss-120b (default), Groq, or Ollama qwen2.5:3b; backup google/gemini-2.5-flash |
|---|---|
| Agent framework | agno |
| API | FastAPI + uvicorn, SSE streaming, SQLite |
| NLP | spaCy en_core_web_sm, VADER, scikit-learn TF-IDF + logistic regression |
| RAG | sentence-transformers all-MiniLM-L6-v2 (TF-IDF fallback) |
| Frontend | React 19, Vite 7, react-markdown, Recharts, Vitest |