AI

Building AI Agents Using Agno’s Multi-Agent Teaming Framework for Comprehensive Market Analysis and Risk Reporting

In the rapid financial scene today, the use of artificial intelligence agents specialized in dealing with the separate aspects of analysis is a key to providing accurate visions in time. The light weight framework for the model weight of developers enables the factors that have been built quickly, such as our financing agent for structured market data and risk assessment agent for analyzing fluctuations and morale analysis, without a kettle or a complex format code. By identifying clear instructions and creating a multi -agent “risk team”, Agno deals with coordination, calling tools and managing the context behind the scenes, allowing each agent to focus on field experience while cooperating smoothly to produce a unified report.

!pip install -U agno google-genai duckduckgo-search yfinance

We install and upgrade Core Agno Framework, Genai SDK from Google for Gemini Integration, the Suckduckgo Library to search for direct information, and Yfinance to smoothly access the stock market data. By running it at the beginning of our Cola’s session, we ensure that all necessary dependencies are available to build and operate risk evaluation agents and evaluate risk.

from getpass import getpass
import os


os.environ["GOOGLE_API_KEY"] = getpass("Enter your Google API key: ")

The above code calls you to enter the Google API key in Colab without echo on the screen, then it is stored in the Google_API_KEY environment variable. The Gemini model of AGNO and Google Genai SDK can automatically approve the subsequent API calls by setting this variable.

from agno.agent import Agent
from agno.models.google import Gemini
from agno.tools.reasoning import ReasoningTools
from agno.tools.yfinance import YFinanceTools


agent = Agent(
    model=Gemini(id="gemini-1.5-flash"),  
    tools=[
        ReasoningTools(add_instructions=True),
        YFinanceTools(
            stock_price=True,
            analyst_recommendations=True,
            company_info=True,
            company_news=True
        ),
    ],
    instructions=[
        "Use tables to display data",
        "Only output the report, no other text",
    ],
    markdown=True,
)


agent.print_response(
    "Write a report on AAPL",
    stream=True,
    show_full_reasoning=True,
    stream_intermediate_steps=True
)

We configure the AGNO agent supported by Google Gemini (1.5 Flash), descending it with thinking capabilities and Yfinance tools to bring stock data, analyst recommendations, company information, and news, then broadcast a step -by -step and transparent report on AAPL, while completing it with logic with chains and medium tools calls, directly to directing Colab.

finance_agent = Agent(
    name="Finance Agent",
    model=Gemini(id="gemini-1.5-flash"),
    tools=[
        YFinanceTools(
            stock_price=True,
            analyst_recommendations=True,
            company_info=True,
            company_news=True
        )
    ],
    instructions=[
        "Use tables to display stock price, analyst recommendations, and company info.",
        "Only output the financial report without additional commentary."
    ],
    markdown=True
)


risk_agent = Agent(
    name="Risk Assessment Agent",
    model=Gemini(id="gemini-1.5-flash"),
    tools=[
        YFinanceTools(
            stock_price=True,
            company_news=True
        ),
        ReasoningTools(add_instructions=True)
    ],
    instructions=[
        "Analyze recent price volatility and news sentiment to provide a risk assessment.",
        "Use tables where appropriate and only output the risk assessment section."
    ],
    markdown=True
)

These definitions create two AGNO models using the Gemini model (1.5 Flash) from Google: It brings the financing agent and replaces stock prices, analysts’ recommendations, company information, and news to provide a summary financial report, while the risk assessment agent analyzes price fluctuations and news aid, benefit from inherited thinking tools when needed, generating a section to evaluate risk.

from agno.team.team import Team
from textwrap import dedent


team = Team(
    name="Finance-Risk Team",
    mode="coordinate",
    model=Gemini(id="gemini-1.5-flash"),
    members=[finance_agent, risk_agent],
    tools=[ReasoningTools(add_instructions=True)],
    instructions=[
        "Delegate financial analysis requests to the Finance Agent.",
        "Delegate risk assessment requests to the Risk Assessment Agent.",
        "Combine their outputs into one comprehensive report."
    ],
    markdown=True,
    show_members_responses=True,
    enable_agentic_context=True
)


task = dedent("""
1. Provide a financial overview of AAPL.
2. Provide a risk assessment for AAPL based on volatility and recent news.
""")


response = team.run(task)
print(response.content)

We assemble the coordinated “financing risk team” using Agno and Google Gemini. It delegates financial analyzes to the financing agent and evaluating the volatility/news to the risk evaluation agent, then collects its outputs in one comprehensive report. By connecting to TEAM.Run on the AAPL mission of two parts, it is organized with the transparency of each expert agent and prints the unified result.

team.print_response(
    task,
    stream=True,
    stream_intermediate_steps=True,
    show_full_reasoning=True
)

We direct the financial risks team to implement the AAPL mission in the actual time, the internal thinking flow of each agent, the invitations of tools, and partial outputs when they happen. By empowering Stream_intermediaTE_Steps and Show_FULL_RESTONING, we will see exactly how Agno coordinates financing evaluation agents and risk evaluation step by step before submitting the joint final report.

In conclusion, harnessing the capabilities of the multi -agent AGNO team converts what can be traditionally to be a homogeneous workflow of artificial intelligence to a formalized expert system. Each agent in the team can specialize in bringing in financial standards, analyzing the feelings of analysts, or assessing risk factors. At the same time, API is organizing the delegation, sharing context and final synthesis. The result is a strong and extensive structure ranging from simple settings of vehicles to complex groups with a minimal code and maximum clarity.


verify Clap notebook. Also, do not forget to follow us twitter And join us Telegram channel and LinkedIn GrOup. Don’t forget to join 90k+ ml subreddit. For promotion and partnerships, Please talk to us.

🔥 [Register Now] The virtual Minicon Conference on Agency AI: Free Registration + attendance Certificate + 4 hours short (May 21, 9 am- Pacific time)


Asif Razzaq is the CEO of Marktechpost Media Inc .. As a pioneer and vision engineer, ASIF is committed to harnessing the potential of artificial intelligence for social goodness. His last endeavor is to launch the artificial intelligence platform, Marktechpost, which highlights its in -depth coverage of machine learning and deep learning news, which is technically sound and can be easily understood by a wide audience. The platform is proud of more than 2 million monthly views, which shows its popularity among the masses.

Don’t miss more hot News like this! Click here to discover the latest in AI news!

2025-05-04 20:27:00

Related Articles

Back to top button