Skip to content

am101j/stocks-ai

Repository files navigation

OffsetAI: Autonomous Financial Research Agent

A next-generation autonomous agent that performs deep financial research, risk analysis, and hedge strategy validation in real-time.

License Python TypeScript Stack

stocks-demo-1769491413416.1.1.mp4

🚀 Features

  • Autonomous Agent Pipeline: Utilizes a Monitor -> Researcher -> Critic -> Strategist workflow using LangGraph.
  • Real-Time Progress: Watch the agent "think" live on the dashboard as it moves through analysis steps.
  • Deep Reasoning: Powered by Gemini 2.0 Flash for high-speed, reasoning-heavy financial analysis.
  • RAG Memory: Integrated Pinecone vector database to recall historical context and regulatory news.
  • Privacy-First MCP: Uses Model Context Protocol (MCP) to securely analyze your local portfolio (portfolio.csv) without uploading sensitive data to the cloud.
  • Live Market Data: Real-time stock quotes via Alpaca API.
  • Dynamic Dashboard: A premium, dark-mode UI built with Next.js 14 and Framer Motion.

🛠 Tech Stack

  • Frontend: Next.js 14 (App Router), TypeScript, Framer Motion, Lucid React.
  • Backend: FastAPI (Python), LangGraph (Agent Orchestration), Pydantic.
  • AI & Data: Google Gemini 2.0, Pinecone (Vector DB), Alpaca (Market Data).
  • Database: Supabase (PostgreSQL + Auth).
  • Security: MCP (Model Context Protocol) for local file access.

⚡ Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Api Keys: Supabase, Alpaca, Gemini, Pinecone.

1. Backend Setup

# Navigate to project root
cd stocks

# install dependencies
pip install -r backend/requirements.txt

# Run the backend server
python -m backend.app.main

Server runs on http://localhost:8000

2. Frontend Setup

# Open a new terminal
cd stocks

# Install packages
npm install

# Start the dashboard
npm run dev

UI runs on http://localhost:3000

🧠 Architecture

The system uses a State Graph architecture:

  1. Monitor: Detects price movements or user triggers.
  2. Researcher: Scrapes news and queries Vector DB (RAG) for context.
  3. Critic: Validates findings against Prediction Markets (Polymarket).
  4. MCP: Securely calculates risk exposure against your local portfolio file.
  5. Strategist: Synthesizes all data to generate a BUY/SELL/HEDGE signal.

🛡 Security

  • .env files are strictly git-ignored.
  • Portfolio data is processed locally via MCP where possible.
  • Auth is handled securely via Supabase.

Disclaimer: This project is for educational purposes only. Not financial advice.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors