An open-source AI Agent platform for financial analysis using LLMs, featuring automated stock research, report generation, and trading strategy development. Built by AI4Finance Foundation with multi-agent collaboration via AutoGen framework.
Project Overview#
FinRobot is an open-source AI Agent platform developed by AI4Finance Foundation, specifically tailored for financial applications. It goes beyond FinGPT's single-model approach by unifying multiple AI technologies—including LLMs, reinforcement learning, and quantitative analysis—to power automated investment research, algorithmic trading strategies, and risk assessment.
Four-Layer Architecture#
Financial AI Agents Layer: Contains Financial Chain-of-Thought (CoT) prompting, Market Prediction Agent, Document Analysis Agent, and Trading Strategy Agent.
Financial LLMs Algorithms Layer: Configures and uses domain-specific tuned models, supporting global market analysis.
LLMOps and DataOps Layers: Implements multi-source integration strategies, selecting the most appropriate LLM for specific financial tasks.
Multi-source LLM Foundation Models Layer: Supports plug-and-play functionality for various general and specialized LLMs.
Agent Cognitive Architecture#
Perception: Captures and interprets multimodal financial data from market data sources, news, and economic indicators.
Brain: Processes data using LLMs, generating structured instructions through Financial CoT processes.
Action: Executes Brain module instructions, transforming analytical insights into actionable results.
Core Application Scenarios#
- Automated Investment Research: Auto-generate professional stock research reports
- Algorithmic Trading Strategies: Develop and optimize trading strategies
- Risk Assessment: Comprehensive investment risk evaluation
- Market Prediction: Predict stock price movement directions
- Financial Analysis: Deep analysis of income statements, balance sheets, and cash flow statements
Agent Workflow Examples#
Market Prediction Agent: Predicts stock trends based on company ticker, recent fundamental financial data, and market news, analyzing positive developments and potential concerns to forecast next week's price movement.
Financial Report Generation Agent: Generates stock research reports based on company 10-K forms, financial data, and market data, outputting professional PDF format.
Trading Strategy Agent: Trading strategy formulation with multimodal capabilities, supporting chart analysis and technical indicator optimization.
Smart Scheduler#
- Director Agent: Orchestrates task allocation processes
- Agent Registration: Manages agent registration and availability tracking
- Agent Adaptor: Customizes agent capabilities for specific tasks
- Task Manager: Manages and stores different LLM-based agents
Installation & Configuration#
# Create virtual environment
conda create --name finrobot python=3.10
conda activate finrobot
# PyPI installation
pip install -U finrobot
# Or source installation
git clone https://github.com/AI4Finance-Foundation/FinRobot.git
cd FinRobot
pip install -e .
Configuration requires setting OAI_CONFIG_LIST (OpenAI API keys) and config_api_keys (financial data APIs: FINNHUB, FMP, SEC_API).
Data Source Integration#
- Finnhub: Real-time financial data
- Financial Modeling Prep (FMP): Financial statements and macroeconomic data
- SEC API: Official US stock regulatory filings (10-K, 10-Q)
- Yahoo Finance: General market data
Core Dependencies#
Agent framework based on pyautogen>=0.2.19, supporting OpenAI GPT-4 and other models. Data analysis uses pandas, numpy, scikit-learn; visualization uses matplotlib, mplfinance; report generation uses reportlab, pyPDF2; trading backtesting uses backtrader.