DEV Community

TheAIRabbit
TheAIRabbit

Posted on • Edited on

How to Build an Autonomous Stock Analysis Team for Under $1

Imagine having a team of financial analysts working for you simultaneously, digging through earnings reports, market sentiment, and price targets, all while you sip your coffee.

Usually, this requires a subscription to a Bloomberg terminal or hours of manual research. However, by using Agentic AI—specifically a "Manager" agent that coordinates sub-agents—you can automate this deep-dive analysis.

In this tutorial, we will show you how to set up a multi-agent workflow using Cherry Studio, Claude Haiku, and Tavily Search to analyze a stock portfolio (Apple, Nvidia, and Salesforce) in real-time.

Prerequisites

  • Cherry Studio (for managing AI agents)
  • Claude 3 Haiku (chosen for its speed and low cost)
  • Tavily Search API (for real-time web browsing)

Step 1: Define the "Manager" Prompt

The secret to Agentic AI isn't just asking a question; it's assigning a role. We don't want the AI to just summarize Wikipedia. We want it to act as a portfolio manager that delegates tasks.

In our prompt, we explicitly instruct the model to use sub-agents for each specific stock. This forces the AI to split the workload rather than trying to do everything in a single, linear train of thought.

We input the following prompt into Cherry Studio:
"Use a subagent for each stock to analyze the stock and tell me your recommendation for buying or selling: Apple stock, Nvidia, and Salesforce."

Screenshot at 0:04

Why this works: By explicitly asking for sub-agents, we are triggering parallel processing. The main agent acts as the orchestrator, while the "worker" agents will handle the specific data gathering for each company.


Step 2: The Orchestration (Spawning Agents)

Once the prompt is sent, the magic happens. The main agent doesn't start researching immediately. Instead, it creates a plan and launches specialized sub-agents.

You will see the interface split into multiple execution threads. One agent takes Apple, another takes Nvidia, and the third takes Salesforce. They are working simultaneously, which drastically reduces the wait time compared to a standard linear chat interaction.

Screenshot at 0:14

Key Concept: This is the difference between a Chatbot and an Agent. A chatbot talks to you; an agent takes actions (in this case, spawning child processes) to achieve a goal.


Step 3: Deep Dives with Real-Time Data

A common pitfall with LLMs is that their training data is outdated. To perform a valid stock analysis, we need current data: today's price, the latest earnings call, and 2025 analyst price targets.

To solve this, the sub-agents utilize Tavily Search. This is a search engine optimized for AI agents.

In the backend, you can see the agents generating specific search queries such as:

  • "Nvidia analyst ratings price target recommendations 2025"
  • "Apple Inc financial metrics P/E ratio revenue growth"

Screenshot at 0:26

The agents parse the search results, extracting the raw numbers and sentiment analysis needed to form a thesis. They are filtering out the noise and keeping only the relevant financial indicators.


Step 4: The Consolidated Report

After the agents finish their parallel research, they report back to the "Manager" agent. The Manager then synthesizes these findings into a cohesive "Stock Recommendations Summary."

Instead of a wall of text, the output is structured into clear actionable insights:

  1. Recommendation: (Buy/Hold/Sell)
  2. Rationale: Why are we making this move?
  3. Key Points: Earnings growth, market share, and risks.
  4. Price Targets: Upside potential based on analyst consensus.

Screenshot at 0:46

For example, in our run, the agent recommended a HOLD for Apple due to valuation concerns, but a BUY for Nvidia based on AI infrastructure dominance. This level of nuance is possible because the sub-agents were able to cross-reference multiple data points during the search phase.


Summary and Cost Analysis

This entire workflow—spanning multiple agents, dozens of search queries, and synthesizing a professional report—was executed in under a minute.

The most impressive part? The cost. Because we utilized Claude Haiku (a smaller, efficient model) combined with the specific capabilities of Cherry Studio, the total cost for this deep-dive session was negligible.

Next Steps

To implement this yourself:

  1. Download Cherry Studio.
  2. Connect your API keys for Claude and Tavily.
  3. Experiment with the prompt: try adding a "Macro-economic analyst" sub-agent to get a broader market view before analyzing specific stocks.

Top comments (0)