These two papers showcase how it’s feasible to build an AI platform replacing a whole team of financial analysts: FinRobot: An Open-Source AI Agent Platform for Financial Applications using Large Language Models (github repo) and A First Look at Financial Data Analysis Using ChatGPT-4o.
Even these papers only provide prompts for reference purpose, the true gist is to dive deep to pyautogen package and figure out their financial data source, which can be augmented by my own extensive suite of data content.
First, pyautogen. The AutoGen package is a Python library designed to facilitate the development of applications involving large language models (LLMs). Its primary focus is on enabling complex multi-agent conversations, where multiple agents with specialized roles collaborate to perform tasks. For instance, agents handle different aspects of coding, debugging, or providing insights, reducing the manual effort typically required in these scenarios.
Core Components: Agents and Configuration Options
AssistantAgent: An AI assistant that can process natural language and generate responses
UserProxyAgent: Represents a human user, can execute code and provide feedback
GroupChatManager: Manages conversations between multiple agents
ConversableAgent: Base class for all agents
Configuration Options: llm_config: Configuration for language models code_execution_config: Settings for code execution human_input_mode: Controls when to ask for human input
Key functions include conversation management, code execution, memory and context management.
Official documentation: https://microsoft.github.io/autogen/
GitHub repository: https://github.com/microsoft/autogen
In ai4finance repo, research data source: it’s all publicly available for example, earnings
@retry(wait=wait_random_exponential(min=1, max=5), stop=stop_after_attempt(2))
def get_earnings_transcript(quarter: str, ticker: str, year: int):
"""Get the earnings transcripts
Args:
quarter (str)
ticker (str)
year (int)
"""
response = requests.get(
f"https://discountingcashflows.com/api/transcript/{ticker}/{quarter}/{year}/",
auth=("user", "pass"),
)
resp_text = json.loads(response.text)
# speakers_list = extract_speakers(resp_text[0]["content"])
corrected_date = correct_date(resp_text[0]["year"], resp_text[0]["date"])
resp_text[0]["date"] = corrected_date
return resp_text[0]
And filings
app = FastAPI(
title="Unstructured Pipeline API",
description="""""",
version="1.0.0",
docs_url="/sec-filings/docs",
openapi_url="/sec-filings/openapi.json",
)
And yahoo finance etc. all leveraging APIs.
in ai4finance github, it show cased 5 accomplishments achieved by agents:
- annual report writing
- stock movement prediction
- openbb?
- an agent that write trading strategy and refine it throught backtesting using the BackTrader library
- emulate human analyst who can provide visual charts
- a multimodal agent to optimize the current strategy
https://github.com/AI4Finance-Foundation/FinRobot, It’s cloned to local drive to apply further.