FinBot is a full-stack, AI-powered financial research application designed to act as an institutional-grade investment analyst. Built with LangGraph, FastAPI, and Next.js, it autonomously fetches live financial statements, analyzes market news sentiment, and generates comprehensive, data-driven investment memoranda.
- Agentic Workflow: Powered by LangGraph, the AI acts as a state machine—fetching data, evaluating tool outputs, summarizing financials, and drafting reports in a structured pipeline.
- Real-Time Market Data: Integrates
yfinanceto pull quarterly income statements, balance sheets, and cash flow data, alongside real-time news via Google Serper and Yahoo Finance. - Streaming Responses: The Next.js frontend consumes a chunked FastAPI stream, displaying real-time agent progress logs (e.g., "✅ Completed calculation step: data_fetch") before seamlessly rendering the final Markdown report.
- Institutional Output: Uses NVIDIA's Llama-3.1-70b-instruct to generate hedge-fund style reports complete with financial matrices, risk assessments, and price target justifications.
- Beautiful UI: A responsive, polished interface built with Tailwind CSS, Lucide icons, and React Markdown (with GFM support for rendering financial tables).
Backend:
- Python 3.10+
- FastAPI & Uvicorn (Server & Streaming)
- LangChain & LangGraph (LLM Orchestration)
- Llama-3.1-70b-instruct (via NVIDIA API)
- yfinance, Google Serper API (Tools)
Frontend:
- Next.js (React)
- Tailwind CSS
- React Markdown & remark-gfm
- Lucide React (Icons)
data_fetch: LLM determines which tools to call based on the user's ticker.tools: Executes asynchronous calls to Yahoo Finance and Google Search.process_tools: Parses raw JSON/strings into structural data.sum_fin_report: Generates a digestible summary of raw financial tables.sentiment_analysis: Classifies recent news as Bullish, Bearish, or Neutral.report_analyst: Synthesizes all context into the final institutional Markdown report.
- Node.js (v18+)
- Python (v3.10+)
- API Keys for NVIDIA and Serper.dev
Navigate to your backend directory and set up a virtual environment:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtNVIDIA_API_KEY=your_nvidia_api_key_here
SERPER_API_KEY=your_serper_api_key_hereuvicorn main:app --host 0.0.0.0 --port 8000 --reloadOpen a new terminal, navigate to your frontend directory, and install dependencies:
cd frontend
npm installCreate a .env.local file in the frontend directory to link your backend:
NEXT_PUBLIC_API_URL=http://localhost:8000
Start the Next.js development server:
npm run devThe frontend is now running at http://localhost:3000
-
Open your browser and navigate to http://localhost:3000.
-
Enter a valid stock ticker (e.g., NVDA, AAPL, MSFT) into the search bar.
-
Watch the progress logs as the LangGraph agent executes its research steps.
-
Review the final Markdown-formatted investment report!
This application is built for educational and portfolio purposes only. The outputs generated by the AI do not constitute actual financial advice. Always conduct your own due diligence before making investment decisions.