Skip to content

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 FinBot: Institutional AI Investment Analyst

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.

✨ Features

  • 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 yfinance to 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).

🛠️ Tech Stack

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)

🧠 Architecture / Graph Flow

  1. data_fetch: LLM determines which tools to call based on the user's ticker.
  2. tools: Executes asynchronous calls to Yahoo Finance and Google Search.
  3. process_tools: Parses raw JSON/strings into structural data.
  4. sum_fin_report: Generates a digestible summary of raw financial tables.
  5. sentiment_analysis: Classifies recent news as Bullish, Bearish, or Neutral.
  6. report_analyst: Synthesizes all context into the final institutional Markdown report.

🚀 Getting Started

Prerequisites

  • Node.js (v18+)
  • Python (v3.10+)
  • API Keys for NVIDIA and Serper.dev

1. Backend Setup (FastAPI)

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\activate

Install dependencies:

pip install -r requirements.txt

Create a .env file in the backend directory:

NVIDIA_API_KEY=your_nvidia_api_key_here
SERPER_API_KEY=your_serper_api_key_here

Start the FastAPI server:

uvicorn main:app --host 0.0.0.0 --port 8000 --reload

2. Frontend Setup (Next.js)

Open a new terminal, navigate to your frontend directory, and install dependencies:

cd frontend
npm install

Create 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 dev

The frontend is now running at http://localhost:3000

💻 Usage

  1. Open your browser and navigate to http://localhost:3000.

  2. Enter a valid stock ticker (e.g., NVDA, AAPL, MSFT) into the search bar.

  3. Watch the progress logs as the LangGraph agent executes its research steps.

  4. Review the final Markdown-formatted investment report!

⚠️ Disclaimer

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.

About

An agent that: Scrapes financial news + quarterly reports Runs sentiment analysis Combines with stock fundamentals Generates investment theses (bullish/bearish) Integrate with Yahoo Finance API for real-time data.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages