FinRobot is an AI Agent platform tailored for financial applications, surpassing FinGPT's single-model approach. It unifies multiple AI technologiesβincluding LLMs, reinforcement learning, and quantitative analyticsβto power investment research automation, algorithmic trading strategies, and risk assessment, delivering a full-stack intelligent solution for the financial industry.
Concept of AI Agent: an AI Agent is an intelligent entity that uses large language models as its brain to perceive its environment, make decisions, and execute actions. Unlike traditional artificial intelligence, AI Agents possess the ability to independently think and utilize tools to progressively achieve given objectives.
π https://finrobot.ai/
A locally-deployed AI assistant that fetches financial data, runs multi-agent LLM analysis, and generates professional equity research reports.
1. Configure API Keys
cp finrobot_equity/core/config/config.ini.example finrobot_equity/core/config/config.iniEdit config.ini with your keys:
[API_KEYS]
fmp_api_key = YOUR_FMP_API_KEY # https://financialmodelingprep.com/developer
openai_api_key = YOUR_OPENAI_API_KEY # https://platform.openai.com/account/api-keys2. One-Command Deploy (Web Interface)
chmod +x deploy.sh
./deploy.sh start
#if deploy.sh not working then
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-equity.txt
python run_web_app.py Access at http://127.0.0.1:8001
| Command | Description |
|---|---|
./deploy.sh start |
Start the web app (auto-installs dependencies) |
./deploy.sh stop |
Stop the application |
./deploy.sh restart |
Restart the application |
./deploy.sh status |
Check running status |
3. Or Run via Command Line
# Step 1: Financial analysis
python finrobot_equity/core/src/generate_financial_analysis.py \
--company-ticker NVDA \
--company-name "NVIDIA Corporation" \
--config-file finrobot_equity/core/config/config.ini \
--peer-tickers AMD INTC \
--generate-text-sections
# Step 2: Generate report
python finrobot_equity/core/src/create_equity_report.py \
--company-ticker NVDA \
--company-name "NVIDIA Corporation" \
--analysis-csv output/NVDA/analysis/financial_metrics_and_forecasts.csv \
--ratios-csv output/NVDA/analysis/ratios_raw_data.csv \
--config-file finrobot_equity/core/config/config.iniPipeline:
- Fetch Financial Data: income statements, balance sheets, cash flows via FMP API
- Process & Forecast: 3-year financial projections, DCF valuation, peer comparison
- AI Agent Analysis: 8 specialized agents generate investment thesis, risk assessment, valuation overview, etc.
- Report Generation: professional multi-page HTML/PDF with 15+ chart types
For full documentation, see finrobot_equity/README.md.
FinRobot-Intro.mp4
FinRobot Pro is an AI-powered equity research platform that automates professional stock analysis using Large Language Models (LLMs) and AI Agents.
Key Features:
- Automated Report Generation β Generate professional equity research reports instantly
- Financial Analysis β Deep dive into income statements, balance sheets, and cash flows
- Valuation Analysis β P/E ratio, EV/EBITDA multiples, and peer comparison
- Risk Assessment β Comprehensive investment risk evaluation
The overall framework of FinRobot is organized into four distinct layers, each designed to address specific aspects of financial AI processing and application:
- Financial AI Agents Layer: The Financial AI Agents Layer now includes Financial Chain-of-Thought (CoT) prompting, enhancing complex analysis and decision-making capacity. Market Forecasting Agents, Document Analysis Agents, and Trading Strategies Agents utilize CoT to dissect financial challenges into logical steps, aligning their advanced algorithms and domain expertise with the evolving dynamics of financial markets for precise, actionable insights.
- Financial LLMs Algorithms Layer: The Financial LLMs Algorithms Layer configures and utilizes specially tuned models tailored to specific domains and global market analysis.
- LLMOps and DataOps Layers: The LLMOps layer implements a multi-source integration strategy that selects the most suitable LLMs for specific financial tasks, utilizing a range of state-of-the-art models.
- Multi-source LLM Foundation Models Layer: This foundational layer supports the plug-and-play functionality of various general and specialized LLMs.
-
Perception: This module captures and interprets multimodal financial data from market feeds, news, and economic indicators, using sophisticated techniques to structure the data for thorough analysis.
-
Brain: Acting as the core processing unit, this module perceives data from the Perception module with LLMs and utilizes Financial Chain-of-Thought (CoT) processes to generate structured instructions.
-
Action: This module executes instructions from the Brain module, applying tools to translate analytical insights into actionable outcomes. Actions include trading, portfolio adjustments, generating reports, or sending alerts, thereby actively influencing the financial environment.
The Smart Scheduler is central to ensuring model diversity and optimizing the integration and selection of the most appropriate LLM for each task.
- Director Agent: This component orchestrates the task assignment process, ensuring that tasks are allocated to agents based on their performance metrics and suitability for specific tasks.
- Agent Registration: Manages the registration and tracks the availability of agents within the system, facilitating an efficient task allocation process.
- Agent Adaptor: Tailor agent functionalities to specific tasks, enhancing their performance and integration within the overall system.
- Task Manager: Manages and stores different general and fine-tuned LLMs-based agents tailored for various financial tasks, updated periodically to ensure relevance and efficacy.
The main folder finrobot has three subfolders agents, data_source, functional.
FinRobot
βββ finrobot (main folder)
β βββ agents
β βββ agent_library.py
β βββ workflow.py
β βββ data_source
β βββ finnhub_utils.py
β βββ finnlp_utils.py
β βββ fmp_utils.py
β βββ sec_utils.py
β βββ yfinance_utils.py
β βββ functional
β βββ analyzer.py
β βββ charting.py
β βββ coding.py
β βββ quantitative.py
β βββ reportlab.py
β βββ text.py
β βββ toolkits.py
β βββ utils.py
β
βββ configs
βββ experiments
βββ tutorials_beginner (hands-on tutorial)
β βββ agent_fingpt_forecaster.ipynb
β βββ agent_annual_report.ipynb
βββ tutorials_advanced (advanced tutorials for potential finrobot developers)
β βββ agent_trade_strategist.ipynb
β βββ agent_fingpt_forecaster.ipynb
β βββ agent_annual_report.ipynb
β βββ lmm_agent_mplfinance.ipynb
β βββ lmm_agent_opt_smacross.ipynb
βββ setup.py
βββ OAI_CONFIG_LIST_sample
βββ config_api_keys_sample
βββ requirements.txt
βββ README.md
1. (Recommended) Create a new virtual environment
conda create --name finrobot python=3.10
conda activate finrobot2. download the FinRobot repo use terminal or download it manually
git clone https://github.com/AI4Finance-Foundation/FinRobot.git
cd FinRobot3. install finrobot & dependencies from source or pypi
get our latest release from pypi
pip install -U finrobotor install from this repo directly
pip install -e .
4. modify OAI_CONFIG_LIST_sample file
1) rename OAI_CONFIG_LIST_sample to OAI_CONFIG_LIST
2) remove the four lines of comment within the OAI_CONFIG_LIST file
3) add your own openai api-key <your OpenAI API key here>5. modify config_api_keys_sample file
1) rename config_api_keys_sample to config_api_keys
2) remove the comment within the config_api_keys file
3) add your own finnhub-api "YOUR_FINNHUB_API_KEY"
4) add your own financialmodelingprep and sec-api keys "YOUR_FMP_API_KEY" and "YOUR_SEC_API_KEY" (for financial report generation)6. start navigating the tutorials or the demos below:
# find these notebooks in tutorials
1) agent_annual_report.ipynb
2) agent_fingpt_forecaster.ipynb
3) agent_trade_strategist.ipynb
4) lmm_agent_mplfinance.ipynb
5) lmm_agent_opt_smacross.ipynb
Takes a company's ticker symbol, recent basic financials, and market news as input and predicts its stock movements.
- Import
import autogen
from finrobot.utils import get_current_date, register_keys_from_json
from finrobot.agents.workflow import SingleAssistant- Config
# Read OpenAI API keys from a JSON file
llm_config = {
"config_list": autogen.config_list_from_json(
"../OAI_CONFIG_LIST",
filter_dict={"model": ["gpt-4-0125-preview"]},
),
"timeout": 120,
"temperature": 0,
}
# Register FINNHUB API keys
register_keys_from_json("../config_api_keys")- Run
company = "NVDA"
assitant = SingleAssistant(
"Market_Analyst",
llm_config,
# set to "ALWAYS" if you want to chat instead of simply receiving the prediciton
human_input_mode="NEVER",
)
assitant.chat(
f"Use all the tools provided to retrieve information available for {company} upon {get_current_date()}. Analyze the positive developments and potential concerns of {company} "
"with 2-4 most important factors respectively and keep them concise. Most factors should be inferred from company related news. "
f"Then make a rough prediction (e.g. up/down by 2-3%) of the {company} stock price movement for next week. Provide a summary analysis to support your prediction."
)- [Stanford University + Microsoft Research] Agent AI: Surveying the Horizons of Multimodal Interaction
- [Stanford University] Generative Agents: Interactive Simulacra of Human Behavior
- [Fudan NLP Group] The Rise and Potential of Large Language Model Based Agents: A Survey
- [Fudan NLP Group] LLM-Agent-Paper-List
- [Tsinghua University] Large Language Models Empowered Agent-based Modeling and Simulation: A Survey and Perspectives
- [Renmin University] A Survey on Large Language Model-based Autonomous Agents
- [Nanyang Technological University] FinAgent: A Multimodal Foundation Agent for Financial Trading: Tool-Augmented, Diversified, and Generalist
- AutoGPT (183k stars): autonomous AI agent platform.
- Dify (134k stars): LLM app development platform with workflow orchestration and RAG.
- LangChain (130k stars): framework for building context-aware LLM applications.
- MetaGPT (65.6k stars): multi-agent framework with role-based collaboration.
- AutoGen (56k stars): framework for multi-agent LLM applications with tools and human interaction.
- CrewAI (46.6k stars): framework for orchestrating collaborative AI agents.
- ChatDev (31.7k stars): multi-agent framework for software development tasks.
- FastGPT (27.4k stars): knowledge-based LLM platform with workflow support.
- Langfuse (23.4k stars): open-source LLM observability and evaluation platform.
- BabyAGI (22.2k stars): task-driven experimental autonomous agent framework.
- SuperAGI (17.3k stars): developer-focused autonomous agent framework.
- CAMEL (16.4k stars): framework for cooperative and communicative AI agents.
- Bisheng (11.2k stars): enterprise open-source LLM application platform.
@inproceedings{
zhou2024finrobot,
title={FinRobot: {AI} Agent for Equity Research and Valuation with Large Language Models},
author={Tianyu Zhou and Pinqiao Wang and Yilin Wu and Hongyang Yang},
booktitle={ICAIF 2024: The 1st Workshop on Large Language Models and Generative AI for Finance},
year={2024}
}
@article{yang2024finrobot,
title={FinRobot: An Open-Source AI Agent Platform for Financial Applications using Large Language Models},
author={Yang, Hongyang and Zhang, Boyu and Wang, Neng and Guo, Cheng and Zhang, Xiaoli and Lin, Likun and Wang, Junlin and Zhou, Tianyu and Guan, Mao and Zhang, Runjia and others},
journal={arXiv preprint arXiv:2405.14767},
year={2024}
}
@inproceedings{han2024enhancing,
title={Enhancing Investment Analysis: Optimizing AI-Agent Collaboration in Financial Research},
author={Han, Xuewen and Wang, Neng and Che, Shangkun and Yang, Hongyang and Zhang, Kunpeng and Xu, Sean Xin},
booktitle={ICAIF 2024: Proceedings of the 5th ACM International Conference on AI in Finance},
pages={538--546},
year={2024}
}
Disclaimer: The codes and documents provided herein are released under the Apache-2.0 license. They should not be construed as financial counsel or recommendations for live trading. It is imperative to exercise caution and consult with qualified financial professionals prior to any trading or investment actions.




