Building Ai Agents Using Agno’s Multi-agent Teaming Framework For Comprehensive Market Analysis And Risk Reporting

Trending 12 hours ago
ARTICLE AD BOX

In today’s fast-paced financial landscape, leveraging specialized AI agents to grip discrete aspects of study is cardinal to delivering timely, meticulous insights. Agno’s lightweight, model-agnostic model empowers developers to quickly rotation up purpose-built agents, specified arsenic our Finance Agent for system marketplace information and Risk Assessment Agent for volatility and sentiment analysis, without boilerplate aliases analyzable orchestration code. By defining clear instructions and composing a multi-agent “Finance-Risk Team,” Agno handles nan coordination, instrumentality invocation, and discourse guidance down nan scenes, enabling each supplier to attraction connected its domain expertise while seamlessly collaborating to nutrient a unified report.

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

We instal and upgrade nan halfway Agno framework, Google’s GenAI SDK for Gemini integration, nan DuckDuckGo hunt room for querying unrecorded information, and YFinance for seamless entree to banal marketplace data. By moving it astatine nan commencement of our Colab session, we guarantee each basal limitations are disposable and up to day for building and moving your finance and consequence appraisal agents.

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

The supra codification securely prompts you to participate your Google API cardinal successful Colab without echoing it to nan screen, and past it is stored successful nan GOOGLE_API_KEY situation variable. Agno’s Gemini exemplary wrapper and nan Google GenAI SDK tin automatically authenticate consequent API calls by mounting 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 show data", "Only output nan report, nary different text", ], markdown=True, ) agent.print_response( "Write a study connected AAPL", stream=True, show_full_reasoning=True, stream_intermediate_steps=True )

We initialize an Agno supplier powered by Google’s Gemini (1.5 Flash) model, equip it pinch reasoning capabilities and YFinance devices to fetch banal data, expert recommendations, institution information, and news, and past watercourse a step-by-step, afloat transparent study connected AAPL, complete pinch chained reasoning and intermediate instrumentality calls, straight to nan Colab output.

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 show banal price, expert recommendations, and institution info.", "Only output nan financial study without further 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 caller value volatility and news sentiment to supply a consequence assessment.", "Use tables wherever due and only output nan consequence appraisal section." ], markdown=True )

These definitions create 2 specialized Agno agents utilizing Google’s Gemini (1.5 Flash) model: nan Finance Agent fetches and tabulates banal prices, expert recommendations, institution info, and news to present a concise financial report, while nan Risk Assessment Agent analyzes value volatility and news sentiment, leveraging reasoning devices wherever needed, to make a focused consequence appraisal section.

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 study requests to nan Finance Agent.", "Delegate consequence appraisal requests to nan Risk Assessment Agent.", "Combine their outputs into 1 broad report." ], markdown=True, show_members_responses=True, enable_agentic_context=True ) task = dedent(""" 1. Provide a financial overview of AAPL. 2. Provide a consequence appraisal for AAPL based connected volatility and caller news. """) response = team.run(task) print(response.content)

We combine a coordinated “Finance-Risk Team” utilizing Agno and Google Gemini. It delegates financial analyses to nan Finance Agent and volatility/news assessments to nan Risk Assessment Agent, past synthesizes their outputs into a single, broad report. By calling team.run connected a two-part AAPL task, it transparently orchestrates each master supplier and prints nan unified result.

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

We instruct nan Finance-Risk Team to execute nan AAPL task successful existent time, streaming each agent’s soul reasoning, instrumentality invocations, and partial outputs arsenic they happen. By enabling stream_intermediate_steps and show_full_reasoning, we’ll spot precisely really Agno coordinates nan Finance and Risk Assessment Agents step-by-step earlier delivering nan final, mixed report.

In conclusion, harnessing Agno’s multi-agent teaming capabilities transforms what would traditionally beryllium a monolithic AI workflow into a modular, maintainable strategy of experts. Each supplier successful nan squad tin specialize successful fetching financial metrics, parsing expert sentiment, aliases evaluating consequence factors. At nan aforesaid time, Agno’s Team API orchestrates delegation, context-sharing, and last synthesis. The consequence is simply a robust, extensible architecture ranging from elemental two-agent setups to analyzable ensembles pinch minimal codification changes and maximal clarity.


Check retired nan Colab Notebook. Also, don’t hide to travel america on Twitter and subordinate our Telegram Channel and LinkedIn Group. Don’t Forget to subordinate our 90k+ ML SubReddit. For Promotion and Partnerships, please talk us.

🔥 [Register Now] miniCON Virtual Conference connected AGENTIC AI: FREE REGISTRATION + Certificate of Attendance + 4 Hour Short Event (May 21, 9 am- 1 p.m. PST) + Hands connected Workshop

Asif Razzaq is nan CEO of Marktechpost Media Inc.. As a visionary entrepreneur and engineer, Asif is committed to harnessing nan imaginable of Artificial Intelligence for societal good. His astir caller endeavor is nan motorboat of an Artificial Intelligence Media Platform, Marktechpost, which stands retired for its in-depth sum of instrumentality learning and heavy learning news that is some technically sound and easy understandable by a wide audience. The level boasts of complete 2 cardinal monthly views, illustrating its fame among audiences.

More