AlphaSage AI: AI-Powered Trading & Investment Platform
Gen AI

AlphaSage AI: AI-Powered Trading & Investment Platform

FinTech
TradingView
Yahoo Finance API
Google Gemini
Groq
LLaMA
AI
Backtesting

Project Overview

AlphaSage AI is a comprehensive trading and investment platform designed to provide users with advanced tools for market analysis, strategy development, and informed decision-making. Leveraging the power of artificial intelligence, the platform aims to democratize access to sophisticated research capabilities and backtesting functionalities traditionally reserved for institutional traders.

This project was built with a focus on real-time data processing, robust backtesting infrastructure, and an innovative AI-driven pipeline for fundamental and sentiment analysis.

Watch the video below for a complete walkthrough of the AlphaSage AI application and its features. Detailed explanations and screenshots follow.

Key Features

  • Real-Time Charting and Technical Analysis: Professional-grade charting tools offering support for multiple ticker symbols, timeframes, and custom-calculated technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands).
  • Python-Powered Strategy Backtesting: An integrated editor allowing users to write and test their own trading strategies using historical data, providing detailed performance metrics.
  • Advanced AI-Powered Report Generation: A sophisticated pipeline utilizing Google's Gemini for in-depth company analysis and Groq's LLaMA model for dynamic HTML report formatting.
  • Configurable Settings: Allows users to customize API keys, default chart settings, risk tolerance levels, and notification preferences.

How It Works

AlphaSage AI employs a multi-layered architecture to deliver its comprehensive suite of trading tools:

  1. Data Ingestion & Frontend Presentation: The user interface, built with Next.js and TypeScript, interacts with the backend to request and display real-time and historical OHLC and Volume data, primarily sourced from the Yahoo Finance API.
  2. Technical Analysis & Charting: The frontend integrates robust charting libraries like TradingView to render dynamic market charts. Technical indicators are calculated using custom-written formulas and overlaid on these charts.
  3. Strategy Backtesting Engine: Users input trading strategies, which are then processed by a Python-based backend engine, leveraging Python's extensive libraries for efficient historical data processing and strategy simulation.
  4. AI-Powered Report Generation Pipeline (Core Innovation):
    • Deep Analysis with Gemini: A detailed prompt guides Google's Gemini 2.5 Pro model to perform comprehensive company analysis (fundamentals, sentiment, outlook).
    • Structured Output & Parsing:Gemini returns a rich, text-based report, which is then programmatically parsed by the backend.
    • Dynamic HTML Conversion with LLaMA on Groq: Each parsed text section is converted into well-formatted, visually appealing HTML by the LLaMA 3.2 model via the Groq API.
    • Report Stitching & Delivery: HTML sections are combined into a complete, multi-page report, presented to the user and available for PDF download.

This pipeline effectively automates complex research, delivering deep insights in a polished format.

Technologies Used

Core Stack

  • Frontend: Next.js (React framework), TypeScript
  • Charting: TradingView library
  • Backend (Backtesting & AI Orchestration): Python (e.g., Flask/FastAPI)
  • Data Source: Yahoo Finance API

AI & Infrastructure

  • AI Models & APIs: Google Gemini 2.5 Pro, Groq API (LLaMA 3.2)
  • Indicator Calculation: Custom-written formulas
  • Database & Auth: Supabase (PostgreSQL) for user authentication, settings, strategies, and cached data.
  • Deployment: Vercel for frontend, Python backend on a cloud service (e.g., AWS Lambda, Google Cloud Run).

Screenshots & Walkthrough

Key moments from the demo video showcasing AlphaSage AI's functionality:

AlphaSage AI Landing Page

Landing Page

The clean and modern landing page, highlighting the platform's core value proposition of AI-driven trading insights.

Real-Time Chart Analysis

Interactive chart analysis interface showing candlestick data, technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands, Volume), and options for ticker symbol, time range, interval, and chart style.

AlphaSage AI Chart Analysis with Indicators
AlphaSage AI Strategy Editor

Strategy Editor & Backtesting

The Strategy Editor allows users to write custom Python trading strategies. The backtesting engine then provides performance charts, key metrics (Initial Investment, Final Value, Total Return %, Annual Return, Sharpe Ratio, Total Trades, Win Rate, Max Drawdown), and a log of recent trades.

AI Research Assistant

The AI Research Assistant takes user prompts to generate in-depth company reports. The system fetches financial data, processes it through Gemini for analysis, and then uses LLaMA via Groq to format a comprehensive, multi-page HTML report.

AlphaSage AI Research Report Section
AlphaSage AI Settings Page

Customizable Settings

Users can personalize their experience by toggling dark/light mode, configuring API keys for AI services (Groq, Google Gemini), and adjusting platform settings like default chart timeframes, risk tolerance, and notification preferences.

Learnings & Challenges

Developing AlphaSage AI was a journey through modern web development, backend processing, and cutting-edge AI integration. Key challenges included:

  • AI Pipeline Orchestration: Designing and implementing the multi-step AI pipeline (Gemini for analysis, parsing, then LLaMA via Groq for HTML) required careful prompt engineering, error handling, and ensuring data flow integrity.
  • Real-Time Data Handling: Efficiently and reliably ingesting and displaying market data from the Yahoo Finance API, while managing potential rate limits and data inconsistencies.
  • Python Backtesting Integration: Seamlessly connecting the Next.js frontend with the Python backtesting engine involved designing APIs or inter-process communication for strategies and results.
  • Custom Indicator Logic: Developing and validating custom formulas for technical indicators to ensure accuracy mirroring industry standards.

Future Scope

Future enhancements for AlphaSage AI are envisioned to further expand its capabilities and user experience:

  • Implementing live trading capabilities by integrating with brokerage APIs.
  • Developing a more advanced strategy builder with a visual, no-code/low-code interface.
  • Expanding AI report generation to include more dynamic visualizations and interactive elements.
  • Increasing the sophistication of market sentiment analysis by incorporating more diverse data sources.
  • Creating a community feature for users to share strategies, AI report prompts, and insights.

Conclusion

AlphaSage AI stands as a testament to the power of combining modern web technologies like Next.js and TypeScript with specialized backend processing in Python and the transformative capabilities of advanced AI models like Google's Gemini and LLaMA via Groq.

The platform's innovative AI-driven report generation pipeline, in particular, offers users a significant edge by automating complex research tasks and delivering professional-grade insights. It aims to provide a robust, intuitive, and intelligent toolkit for traders and investors navigating the financial markets.