Building your first agent

Building your first agent
Photo by Steve Johnson / Unsplash

Introduction

FinanceBench.ai is a platform to benchmark the power of AI agents to make probabilistic predictions about financial outcomes. In this post, we will walk you through a small start agent that can use google search and python to try to predict the Nvidia's earnings.

Building your first agent

We want agent that can use different tools e.g. google search, python, etc. to make predictions about the future. The tasks in financebench.ai are structured such that there is multiple potential scenarios and the agent has to attribute different likelihood to these scenarios. Here is the text that we use to prompt our financial analyst agent:

Will Nvidia's Earnings Per Share (EPS) for its next reported fiscal quarter meet or exceed analyst expectations, and if so, by how much?. Provide the probability of the following scenarios:

1) Yes, Nvidia will beat earnings expectations by more than 10%.,
2) Yes, Nvidia will beat earnings expectations by less than 10%.,
3) No, Nvidia will miss earnings expectations by less than 10%.,
4) No, Nvidia will miss earnings expectations by more than 10%.

Note that the answer is not known yet, and you must make assumptions and reason probabilistically to successfully accomplish the task.

You can see that the agents has to attribute probabilities to 4 potential scenarios here: 1) beat earnings expectation by 10%, 2) beat earnings expectation by less than 10%, 3) miss earnings by less than 10% and 4) miss earnings by more than 10%.

Agent overview

Inspired by the smolagents open research agent[1], we build a multi agent system with 3 components: orchestrator, websearch and data scientist. For this example, we use Claude 3.5 haiku, but you could use any model. We provide here an abridge version of the agent's work.

1) Orchestrator

Sequential overview of the task

First, the orchestrator creates a plan on how to accomplish the prediction task. It submits facts to look up

### 1. Facts given in the task
- The task involves predicting Nvidia's upcoming earnings performance
- Need to provide probabilities for four specific scenarios of earnings performance
- The actual outcome is not yet known

### 2. Facts to look up
- Current analyst consensus EPS expectations for Nvidia's next fiscal quarter
- Nvidia's most recent quarterly financial performance
- Historical earnings beat/miss rates for Nvidia
- Current market conditions in the semiconductor/tech industry
- Recent performance of Nvidia's key product lines (GPUs, data center solutions)
- Macroeconomic factors affecting tech earnings
- Potential sources:
  1. Financial websites (Yahoo Finance, Bloomberg)
  2. Nvidia's investor relations page
  3. Earnings call transcripts
  4. Semiconductor industry reports
  5. Economic forecasting publications

### 3. Facts to derive
- Probability calculations based on:
  1. Historical earnings performance trend
  2. Current market momentum
  3. Technological developments (AI, data center growth)
  4. Supply chain conditions
  5. Competitive landscape analysis
- Potential scenario probability weightings
- Confidence intervals for earnings predictions
- Comparative analysis with similar tech companies' recent performance

2) Web browsing

Web browsing overview.

The web browsing agent starts by searching necessary facts to accomplish the task.

### 1. Facts given in the task
- The task is to find Nvidia's most recent analyst consensus EPS (Earnings Per Share) estimate
- Specific quarter and year need to be identified
- The estimate is for an upcoming fiscal quarter

### 2. Facts to look up
- Current financial sources for Nvidia's analyst estimates
  - Potential sources:
    1. Financial websites (Yahoo Finance, Google Finance)
    2. Analyst consensus platforms
    3. Investor relations websites
    4. Financial databases (Bloomberg, Reuters)
  - Specific information needed:
    - Exact fiscal quarter being estimated
    - Current consensus EPS estimate
    - Date of the most recent estimate
    - Number of analysts contributing to the consensus

### 3. Facts to derive
- Verification of the most recent estimate
- Calculation of consensus by averaging individual analyst predictions
- Contextualizing the EPS estimate within Nvidia's recent financial performance
- Understanding the potential impact of the estimate on market expectations

The agent writes the following search queries:

Nvidia latest analyst consensus EPS estimate upcoming fiscal quarter

and

Nvidia fiscal Q4 2025 EPS estimate official details

The agent receive the search results in its context:

## Search Results
0. [Nvidia's Q4 FY2025 Earnings: A Detailed Analysis - Nasdaq](https://www.nasdaq.com/articles/nvidia-q4-fy2025-earnings-detailed-analysis)
Date published: 4 hours ago

Analyst consensus projects record quarterly revenue of $38.32 billion for Q4 FY2025, reflecting a 73% year-over-year increase. This figure ...

1. [NVIDIA Corporation (NVDA) Analyst Ratings, Estimates & Forecasts](https://finance.yahoo.com/quote/NVDA/analysis/)

See NVIDIA Corporation (NVDA) stock analyst estimates, including earnings and revenue, EPS, upgrades and downgrades.

2. [NVIDIA Corporation Common Stock (NVDA) Earnings Report Date](https://www.nasdaq.com/market-activity/stocks/nvda/earnings)

According to Zacks Investment Research, based on 14 analysts' forecasts, the consensus EPS forecast for the quarter is $0.79. The reported EPS for the same ...

3. [NVIDIA Corp. Analyst Estimates - NVDA - MarketWatch](https://www.marketwatch.com/investing/stock/nvda/analystestimates)

NVIDIA Corp. ; Next Fiscal Year Estimate, 2.91 ; Median PE on Next FY Estimate, N/A ; High, $220.00 ; Median, $175.00 ; Low, $135.00.

and then summarize the search results for the orchestrator as:

1. Task outcome (short version):\nNvidia's upcoming fiscal Q4 2025 analyst consensus EPS estimate is $0.79-$0.85.

2. Task outcome (extremely detailed version):
- Fiscal Quarter: Q4 Fiscal Year 2025
- Earnings Date: Wednesday, February 26, 2025 (after market close)
- Analyst Consensus EPS Estimate Range: $0.79 - $0.85
- Sources Confirming Estimate:
1. Zacks Investment Research: $0.79 (based on 14 analysts)
2. TipRanks: $0.85 consensus EPS forecast
3. Moomoo: $0.798 EPS forecast
Additional Contextual Details:
- Comparative Performance:
- Previous Quarter (Q3 FY2025) EPS: $0.81
- Year-over-Year Growth: Expected 62% earnings growth
- Wall Street anticipates significant performance driven by AI momentum

3. Additional context (if relevant):
- The estimate reflects strong market expectations for Nvidia
- Multiple financial platforms show slight variations in the exact EPS estimate
- Earnings release is a critical event for investors, with high anticipation around Nvidia's AI-driven growth
- The company has a recent history of exceeding analyst expectations

3) Data scientist

TODO: the agent did not use the data scientist. I will try to debug the code soon.

Result

The code is available on Github.

Closing remarks

Using proprietary tools and database could further improve the accuracy of the agent.

[1]https://github.com/huggingface/smolagents/tree/main/examples/open_deep_research

Subscribe to FinanceBench.ai

Sign up now to get access to the library of members-only issues.
Jamie Larson
Subscribe