Skip to main content
Build a reasoning team that handles complex queries by combining web search, financial data, and transparent analytical thinking. This example demonstrates how reasoning tools make the team’s decision-making process visible.

What You’ll Learn

By building this team, you’ll understand:
  • How to integrate reasoning tools for transparent analytical thinking
  • How to combine multiple specialized agents with different data sources
  • How to use domain-specific search with Exa for financial information
  • How to stream reasoning events to see the team’s thought process in real-time

Use Cases

Build financial research platforms, investment analysis tools, market intelligence systems, or decision support applications.

How It Works

The team coordinates specialized agents with transparent reasoning:
  1. Analyze: Team leader uses reasoning tools to plan the approach
  2. Search: Web agent finds general information using DuckDuckGo
  3. Research: Finance agent retrieves financial data from trusted sources
  4. Synthesize: Team combines findings with visible reasoning process
  5. Present: Outputs structured data with supporting logic
Reasoning tools provide transparency into how the team thinks through complex queries.

Code

reasoning_team.py
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.models.openai import OpenAIChat
from agno.team import Team
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.reasoning import ReasoningTools
from agno.tools.exa import ExaTools

web_agent = Agent(
    name="Web Search Agent",
    role="Handle web search requests",
    model=OpenAIChat(id="gpt-4o"),
    tools=[DuckDuckGoTools()],
    instructions=["Always include sources"],
)

finance_agent = Agent(
    name="Finance Agent",
    role="Handle financial data requests",
    model=OpenAIChat(id="gpt-4o"),
    tools=[
        ExaTools(
            include_domains=["cnbc.com", "reuters.com", "bloomberg.com", "wsj.com"],
            show_results=True,
            text=False,
            highlights=False,
        )
    ],
    instructions=["Use tables to display data"],
)

team_leader = Team(
    name="Reasoning Team Leader",
    model=Claude(id="claude-3-7-sonnet-latest"),
    members=[
        web_agent,
        finance_agent,
    ],
    tools=[ReasoningTools(add_instructions=True)],
    markdown=True,
    show_members_responses=True,
)

team_leader.print_response(
    "Tell me 1 company in New York, 1 in San Francisco and 1 in Chicago and the stock price of each",
    stream=True,
    show_full_reasoning=True,
)

What to Expect

The team will research companies and stock prices by coordinating between web search and financial data agents. You’ll see the reasoning process as the team plans its approach, delegates tasks, and synthesizes information. The output includes visible thinking through reasoning tools, showing how the team decides which agent to use and how to combine their findings. Financial data is presented in tables with sources from trusted financial news outlets.

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

Set your API keys

export OPENAI_API_KEY=xxx
export ANTHROPIC_API_KEY=xxx
export EXA_API_KEY=xxx
3

Install libraries

pip install -U agno openai anthropic ddgs exa-py
4

Run Team

python reasoning_team.py

Next Steps

  • Modify the query to research different types of companies or markets
  • Adjust include_domains in ExaTools to focus on specific financial sources
  • Toggle show_full_reasoning to control visibility of the thinking process
  • Explore Reasoning Tools for advanced analytical capabilities