Use AGNO’s multi-agent team framework to build AI agents for comprehensive market analysis and risk reporting

In today’s fast-paced financial environment, leveraging professional AI agents to handle discrete aspects of analytics is key to providing timely, accurate insights. Agno’s lightweight model framework framework enables developers to quickly rotate dedicated manufacturing agents, such as our financial agents for structured market data and risk assessment agents for volatility and sentiment analysis without boilerplate or complex orchestration code. By clearly defined instructions and forming a multi-agent “financial risk team”, Agno can handle coordination, tool calls and context management behind the scenes, allowing each agent to focus on its domain expertise while collaborating seamlessly to produce unified reports.
!pip install -U agno google-genai duckduckgo-search yfinance
We installed and upgraded Google’s Google SDK Gemini Integration, the core AGNO Framework for the DuckDuckgo search library to query real-time information, and seamless access to stock market data. By running it at the start of a COLAB meeting, we ensure that all necessary dependencies are available and that your financial and risk assessment agent is established and run.
from getpass import getpass
import os
os.environ["GOOGLE_API_KEY"] = getpass("Enter your Google API key: ")
The above code safely prompts you to enter the Google API key in COLAB without having to go back to the screen and then store it in the Google_api_key environment variable. Agno’s Gemini model wrapper and Google Genai SDK can automatically authenticate 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 initialized the AGNO agent powered by Google’s Gemini (1.5 Flash) model, equipped it with reasoning capabilities and YFINANCE tools for inventory data, analyst advice, company information and news, then step-by-step, completely transparent reporting on the AAPL, equipped with linked reasoning and intermediary tools to call Colab Eutput directly.
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 professional AGNO agents using Google’s Gemini (1.5 Flash) model: financial agents acquire and develop stock prices, analyst advice, company information and news to provide concise financial reporting, while risk assessment agents analyze price volatility and news sentiment, leverage the required reasoning tools, and need to generate a focused risk assessment section where needed.
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 assembled a coordinated “financial risk team” using Agno and Google Gemini. It delegates financial analysis to financial agents, volatility/news assessment delegates it to risk assessment agents, and then combines its output into a comprehensive report. By calling Team.run on a two-part AAPL task, it transparently coordinates each expert agent and prints unified results.
team.print_response(
task,
stream=True,
stream_intermediate_steps=True,
show_full_reasoning=True
)
We instruct the financial risk team to perform AAPL tasks in real time to implement internal reasoning, tool calls, and partial output for each agent. By enabling stream_intermediate_steps and show_full_reasoning, we will see exactly how Agno coordinates financial and risk assessment agents step by step before delivering the final merge report.
In summary, leverage Agno’s multi-agent combination capabilities to transform traditional AI workflows into modular, maintainable expert systems. Each agent on the team can specialize in financial metrics, analyze analyst sentiment or evaluate risk factors. Meanwhile, AGNO’s API team curated the delegation, context sharing and final synthesis. The result is a reliable, scalable architecture, from simple two-level setups to complex ensembles with minimal code changes and maximum clarity.
Check COLAB notebook. Also, don’t forget to follow us twitter And join us Telegram Channel and LinkedIn GrOUP. Don’t forget to join us 90K+ ml reddit. To promote and partnership, Please talk to us.
🔥 [Register Now] Minicon Agesic AI Virtual Conference: Free Registration + Certificate of Attendance + 4-hour Short Event (May 21, 9am-1pm) + Hands-On the Workshop
Asif Razzaq is CEO of Marktechpost Media Inc. As a visionary entrepreneur and engineer, ASIF is committed to harnessing the potential of artificial intelligence to achieve social benefits. His recent effort is to launch Marktechpost, an artificial intelligence media platform that has an in-depth coverage of machine learning and deep learning news that can sound both technically, both through technical voices and be understood by a wide audience. The platform has over 2 million views per month, demonstrating its popularity among its audience.