FinRobot: An Open-Source AI Agent Platform for Financial Applications using Large Language Models

Hongyang Yang, Boyu Zhang, Neng Wang, Cheng Guo, Xiaoli Zhang, Likun Lin, Junlin Wang, Tianyu Zhou, Mao Guan, Runjia Zhang, Christina Dan WangarXiv 2024

Abstract

As financial institutions and professionals increasingly incorporate Large Language Models (LLMs) into their workflows, substantial barriers, including proprietary data and specialized knowledge, persist between the finance sector and the AI community. These challenges impede the AI community's ability to enhance financial tasks effectively. Acknowledging financial analysis's critical role, we aim to devise financial-specialized LLM-based toolchains and democratize access to them through open-source initiatives, promoting wider AI adoption in financial decision-making. In this paper, we introduce FinRobot, a novel open-source AI agent platform supporting multiple financially specialized AI agents, each powered by LLM. Specifically, the platform consists of four major layers: 1) the Financial AI Agents layer that formulates Financial Chain-of-Thought (CoT) by breaking sophisticated financial problems down into logical sequences; 2) the Financial LLM Algorithms layer dynamically configures appropriate model application strategies for specific tasks; 3) the LLMOps and DataOps layer produces accurate models by applying training/fine-tuning techniques and using task-relevant data; 4) the Multi-source LLM Foundation Models layer that integrates various LLMs and enables the above layers to access them directly. Finally, FinRobot provides hands-on for both professional-grade analysts and laypersons to utilize powerful AI techniques for advanced financial analysis.

Introduction

Despite the rapid advancement of Large Language Models (LLMs), the financial sector remains a challenging domain for AI integration. Financial analysis requires more than simple text generation; it demands deep domain expertise, the ability to interpret nuanced market trends, and access to real-time, often proprietary, data.

Most existing AI tools in this space are limited to single-task functions, such as sentiment analysis or basic price prediction. They often lack the multi-step reasoning capabilities required to build a comprehensive investment thesis. Furthermore, the "black box" nature of many AI models is at odds with the financial industry's requirement for transparency and logical justification. FinRobot addresses these issues by providing an open-source framework that mimics the collaborative workflow of human financial analysts through a modular, agentic architecture.

System Architecture

FinRobot employs a hierarchical, four-layer architecture designed to handle the complexities of financial data and reasoning effectively.

The four-layer architecture of FinRobot, spanning from foundation models to specialized financial agents.
  1. Financial AI Agents Layer: This layer serves as the system's cognitive core. It utilizes Financial Chain-of-Thought (CoT) to decompose complex financial queries into logical sequences. It employs a multi-agent workflow consisting of roles such as a Director (orchestrator), LLM Analyst (textual analysis), Assistant (data management), and Financial Analysts (quantitative analysis).
  2. Financial LLM Algorithms Layer: This layer houses specialized models and strategies, including FinGPT for financial text processing, FinRL for reinforcement learning in trading scenarios, and FinML for traditional machine learning tasks.
  3. LLMOps and DataOps Layer: This operational layer features a Smart Scheduler that dynamically selects the optimal LLM for a specific task based on performance metrics. It also manages Retrieval-Augmented Generation (RAG) to ensure agents have access to the latest market news and regulatory filings.
  4. Multi-source LLM Foundation Models Layer: A plug-and-play layer supporting various base models, including Llama 3, GPT-4, Falcon, and ChatGLM, allowing the platform to adapt to different languages and regional market requirements.

Agentic Workflow and Perception

The platform's agents interact with the real world through a sophisticated perception-action loop. To bridge the gap between natural language and technical execution, FinRobot utilizes Text2Params (converting natural language into API calls for data sources like Finnhub) and Text2Code (generating custom Python scripts for complex calculations).

The FinRobot agent workflow, illustrating the interaction between the 'Brain' (LLM), Perception (tools/APIs), and Action (agent roles).

This workflow allows the "Brain" (the LLM) to utilize structured instructions, memory, and planning to drive actions across a suite of specialized analysts. By mimicking a human research team hierarchy, the system ensures that different aspects of a financial problem—from data retrieval to visual perception of charts—are handled by specialized components.

Key Insights

  • Financial CoT: Standard LLM prompting is often insufficient for the precision required in finance. By enforcing a financial-specific logic chain, FinRobot improves both the accuracy and the explainability of its outputs.
  • Smart Scheduling: Rather than relying on a single model, FinRobot uses a "mixture of experts" approach at the platform level. It ranks different LLMs for specific tasks (e.g., sector analysis vs. sentiment extraction), optimizing for both cost and performance.
  • Democratization: By open-sourcing these toolchains, the platform enables both professional analysts and laypersons to access advanced AI techniques previously reserved for high-tech financial institutions.

Applications and Results

The efficacy of FinRobot has been demonstrated through two primary applications:

  • Market Forecaster: The system successfully synthesized news and financial data to provide weekly price movement predictions for major stocks. It provides qualitative insights (e.g., "Positive Developments") alongside quantitative forecasts.
  • Document Analysis & Generation: FinRobot is capable of generating professional-grade Equity Research Reports. These reports cover income summarization, business highlights, risk assessments, and a full suite of financial metrics (PE Ratio, ROE, etc.), mirroring the output of top-tier investment banks.

Conclusion and Future Work

FinRobot represents a significant step toward bridging the gap between the AI community and the financial sector. While currently focused on market forecasting and document analysis, future iterations aim to expand into automated portfolio allocation and comprehensive risk assessment. The authors emphasize that while the system is highly autonomous, it remains an academic tool intended to augment, rather than replace, professional human oversight in live trading environments.

Summary updated

BibTeX
@misc{yang2024finrobot,
  author = {Hongyang Yang and Boyu Zhang and Neng Wang and Cheng Guo and Xiaoli Zhang and Likun Lin and Junlin Wang and Tianyu Zhou and Mao Guan and Runjia Zhang and Christina Dan Wang},
  title = {{FinRobot: An Open-Source AI Agent Platform for Financial Applications using Large Language Models}},
  year = {2024},
  eprint = {2405.14767},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.14767},
}
Figure