• About
  • Disclaimer
  • Privacy Policy
  • Contact
Saturday, June 14, 2025
Cyber Defense GO
  • Login
  • Home
  • Cyber Security
  • Artificial Intelligence
  • Machine Learning
  • Data Analysis
  • Computer Networking
  • Disaster Restoration
No Result
View All Result
  • Home
  • Cyber Security
  • Artificial Intelligence
  • Machine Learning
  • Data Analysis
  • Computer Networking
  • Disaster Restoration
No Result
View All Result
Cyber Defense Go
No Result
View All Result
Home Data Analysis

Agentic AI 103: Constructing Multi-Agent Groups

Md Sazzad Hossain by Md Sazzad Hossain
0
Agentic AI 103: Constructing Multi-Agent Groups
585
SHARES
3.2k
VIEWS
Share on FacebookShare on Twitter

You might also like

How knowledge high quality eliminates friction factors within the CX

Monitoring Information With out Turning into Massive Brother

Information Bytes 20250609: AI Defying Human Management, Huawei’s 5nm Chips, WSTS Semiconductor Forecast


Introduction

articles right here in TDS, we explored the basics of Agentic AI. I’ve been sharing with you some ideas that may show you how to navigate by way of this sea of content material we now have been seeing on the market.

Within the final two articles, we explored issues like:

  • The right way to create your first agent
  • What are instruments and the way to implement them in your agent
  • Reminiscence and reasoning
  • Guardrails
  • Agent analysis and monitoring

Good! If you wish to examine it, I counsel you take a look at the articles [1] and [2] from the References part.

Agentic AI is among the hottest topics for the time being, and there are a number of frameworks you possibly can select from. Luckily, one factor that I’ve seen from my expertise studying about brokers is that these basic ideas might be carried over from one to a different.

For instance, the category Agent from one framework turns into chat in one other, and even one thing else, however often with comparable arguments and the exact same goal of connecting with a Massive Language Mannequin (LLM).

So let’s take one other step in our studying journey.

On this submit, we’ll discover ways to create multi-agent groups, opening alternatives for us to let AI carry out extra advanced duties for us.

For the sake of consistency, I’ll proceed to make use of Agno as our framework.

Let’s do that.

Multi-Agent Groups

A multi-agent staff is nothing greater than what the phrase means: a staff with a couple of agent.

However why do we’d like that?

Properly, I created this straightforward rule of thumb for myself that, if an agent wants to make use of greater than 2 or 3 instruments, it’s time to create a staff. The explanation for that is that two specialists working collectively will do a lot better than a generalist.

Whenever you attempt to create the “swiss-knife agent”, the likelihood of seeing issues going backwards is excessive. The agent will grow to be too overwhelmed with totally different directions and the amount of instruments to take care of, so it finally ends up throwing an error or returning a poor consequence.

Alternatively, while you create brokers with a single function, they may want only one instrument to resolve that drawback, due to this fact rising efficiency and enhancing the consequence.

To coordinate this staff of specialists, we’ll use the category Workforce from Agno, which is ready to assign duties to the right agent.

Let’s transfer on and perceive what we’ll construct subsequent.

Mission

Our challenge might be centered on the social media content material era business. We are going to construct a staff of brokers that generates an Instagram submit and suggests a picture based mostly on the subject supplied by the consumer.

  1. The consumer sends a immediate for a submit.
  2. The coordinator sends the duty to the Author
    • It goes to the web and searches for that subject.
  3. The Author returns textual content for the social media submit.
  4. As soon as the coordinator has the primary consequence, it routes that textual content to the Illustrator agent, so it could create a immediate for a picture for the submit.
Workflow of the Workforce of brokers. Picture by the writer.

Discover how we’re separating the duties very effectively, so every agent can focus solely on their job. The coordinator will make it possible for every agent does their work, and they’ll collaborate for a great closing consequence.

To make our staff much more performant, I’ll limit the topic for the posts to be created about Wine & Tremendous Meals. This manner, we slender down much more the scope of data wanted from our agent, and we are able to make its position clearer and extra centered.

Let’s code that now.

Code

First, set up the required libraries.

pip set up agno duckduckgo-search google-genai

Create a file for atmosphere variables .env and add the wanted API Keys for Gemini and any search mechanism you might be utilizing, if wanted. DuckDuckGo doesn’t require one.

GEMINI_API_KEY="your api key"
SEARCH_TOOL_API_KEY="api key"

Import the libraries.

# Imports
import os
from textwrap import dedent
from agno.agent import Agent
from agno.fashions.google import Gemini
from agno.staff import Workforce
from agno.instruments.duckduckgo import DuckDuckGoTools
from agno.instruments.file import FileTools
from pathlib import Path

Creating the Brokers

Subsequent, we’ll create the primary agent. It’s a sommelier and specialist in connoisseur meals.

  • It wants a identify for simpler identification by the staff.
  • The position telling it what its specialty is.
  • A description to inform the agent the way to behave.
  • The instruments that it could use to carry out the duty.
  • add_name_to_instructions is to ship together with the response the identify of the agent who labored on that job.
  • We describe the expected_output.
  • The mannequin is the mind of the agent.
  • exponential_backoff and delay_between_retries are to keep away from too many requests to LLMs (error 429).
# Create particular person specialised brokers
author = Agent(
    identify="Author",
    position=dedent("""
                You might be an skilled digital marketer who focuses on Instagram posts.
                You understand how to jot down an enticing, Search engine marketing-friendly submit.
                 all about wine, cheese, and connoisseur meals present in grocery shops.
                You might be additionally a wine sommelier who is aware of the way to make suggestions.
                
                """),
    description=dedent("""
                Write clear, partaking content material utilizing a impartial to enjoyable and conversational tone.
                Write an Instagram caption concerning the requested {subject}.
                Write a brief name to motion on the finish of the message.
                Add 5 hashtags to the caption.
                Should you encounter a personality encoding error, take away the character earlier than sending your response to the Coordinator.
                        
                        """),
    instruments=[DuckDuckGoTools()],
    add_name_to_instructions=True,
    expected_output=dedent("Caption for Instagram concerning the {subject}."),
    mannequin=Gemini(id="gemini-2.0-flash-lite", api_key=os.environ.get("GEMINI_API_KEY")),
    exponential_backoff=True,
    delay_between_retries=2
)

Now, allow us to create the Illustrator agent. The arguments are the identical.

# Illustrator Agent
illustrator = Agent(
    identify="Illustrator",
    position="You might be an illustrator who focuses on photos of wines, cheeses, and tremendous meals present in grocery shops.",
    description=dedent("""
                Primarily based on the caption created by Marketer, create a immediate to generate an enticing photograph concerning the requested {subject}.
                Should you encounter a personality encoding error, take away the character earlier than sending your response to the Coordinator.
                
                """),
    expected_output= "Immediate to generate an image.",
    add_name_to_instructions=True,
    mannequin=Gemini(id="gemini-2.0-flash", api_key=os.environ.get("GEMINI_API_KEY")),
    exponential_backoff=True,
    delay_between_retries=2
)

Creating the Workforce

To make these two specialised brokers work collectively, we have to use the category Agent. We give it a reputation and use the argument to find out the kind of interplay that the staff could have. Agno makes accessible the modes coordinate, route or collaborate.

Additionally, don’t neglect to make use of share_member_interactions=True to make it possible for the responses will movement easily among the many brokers. You may as well use enable_agentic_context, that allows staff context to be shared with staff members.

The argument monitoring is sweet if you wish to use Agno’s built-in monitor dashboard, accessible at https://app.agno.com/

# Create a staff with these brokers
writing_team = Workforce(
    identify="Instagram Workforce",
    mode="coordinate",
    members=[writer, illustrator],
    directions=dedent("""
                        You're a staff of content material writers working collectively to create partaking Instagram posts.
                        First, you ask the 'Author' to create a caption for the requested {subject}.
                        Subsequent, you ask the 'Illustrator' to create a immediate to generate an enticing illustration for the requested {subject}.
                        Don't use emojis within the caption.
                        Should you encounter a personality encoding error, take away the character earlier than saving the file.
                        Use the next template to generate the output:
                        - Put up
                        - Immediate to generate an illustration
                        
                        """),
    mannequin=Gemini(id="gemini-2.0-flash", api_key=os.environ.get("GEMINI_API_KEY")),
    instruments=[FileTools(base_dir=Path("./output"))],
    expected_output="A textual content named 'submit.txt' with the content material of the Instagram submit and the immediate to generate an image.",
    share_member_interactions=True,
    markdown=True,
    monitoring=True
)

Let’s run it.

# Immediate
immediate = "Write a submit about: Glowing Water and sugestion of meals to accompany."

# Run the staff with a job
writing_team.print_response(immediate)

That is the response.

Picture of the Workforce’s response. Picture by the writer.

That is how the textual content file appears like.

- Put up
Elevate your refreshment sport with the effervescence of glowing water! 
Neglect the sugary sodas, and embrace the crisp, clear style of bubbles. 
Glowing water is the final word palate cleanser and a flexible companion for 
your culinary adventures.

Pair your favourite glowing water with connoisseur delights out of your native
grocery retailer.
Strive these pleasant duos:

*   **For the Basic:** Glowing water with a squeeze of lime, served with 
creamy brie and crusty bread.
*   **For the Adventurous:** Glowing water with a splash of cranberry, 
alongside a pointy cheddar and artisan crackers.
*   **For the Wine Lover:** Glowing water with a touch of elderflower, 
paired with prosciutto and melon.

Glowing water is not only a drink; it is an expertise. 
It is the proper solution to get pleasure from these particular moments.

What are your favourite glowing water pairings?

#SparklingWater #FoodPairing #GourmetGrocery #CheeseAndWine #HealthyDrinks

- Immediate to generate a picture
A vibrant, eye-level shot inside a connoisseur grocery retailer, showcasing a range
of glowing water bottles with numerous flavors. Organize pairings round 
the bottles, together with a wedge of creamy brie with crusty bread, sharp cheddar 
with artisan crackers, and prosciutto with melon. The lighting needs to be vibrant 
and alluring, highlighting the textures and colours of the meals and drinks.

After we now have this textual content file, we are able to go to no matter LLM we like higher to create pictures, and simply copy and paste the Immediate to generate a picture.

And here’s a mockup of how the submit could be.

Mockup of the submit generated by the Multi-agent staff. Picture by the writer.

Fairly good, I’d say. What do you suppose?

Earlier than You Go

On this submit, we took one other step in studying about Agentic AI. This subject is scorching, and there are lots of frameworks accessible available in the market. I simply stopped attempting to be taught all of them and selected one to start out truly constructing one thing.

Right here, we had been capable of semi-automate the creation of social media posts. Now, all we now have to do is select a subject, modify the immediate, and run the Workforce. After that, it’s all about going to social media and creating the submit.

Definitely, there’s extra automation that may be carried out on this movement, however it’s out of scope right here.

Relating to constructing brokers, I like to recommend that you just take the better frameworks to start out, and as you want extra customization, you possibly can transfer on to LangGraph, for instance, which permits you that.

Contact and On-line Presence

Should you preferred this content material, discover extra of my work and social media in my web site:

https://gustavorsantos.me

GitHub Repository

https://github.com/gurezende/agno-ai-labs

References

[1. Agentic AI 101: Starting Your Journey Building AI Agents] https://towardsdatascience.com/agentic-ai-101-starting-your-journey-building-ai-agents/

[2. Agentic AI 102: Guardrails and Agent Evaluation] https://towardsdatascience.com/agentic-ai-102-guardrails-and-agent-evaluation/

[3. Agno] https://docs.agno.com/introduction

[4. Agno Team class] https://docs.agno.com/reference/groups/staff

Tags: agenticBuildingMultiAgentTeams
Previous Post

The right way to use ChatGPT to put in writing code – and my prime trick for debugging what it generates

Next Post

Take a look at: ChatGPT vs Imagen 4 vs FLUX 1.1 – Vilken AI-bildgenerator är bäst?

Md Sazzad Hossain

Md Sazzad Hossain

Related Posts

How knowledge high quality eliminates friction factors within the CX
Data Analysis

How knowledge high quality eliminates friction factors within the CX

by Md Sazzad Hossain
June 13, 2025
Monitoring Information With out Turning into Massive Brother
Data Analysis

Monitoring Information With out Turning into Massive Brother

by Md Sazzad Hossain
June 12, 2025
Information Bytes 20250609: AI Defying Human Management, Huawei’s 5nm Chips, WSTS Semiconductor Forecast
Data Analysis

Information Bytes 20250609: AI Defying Human Management, Huawei’s 5nm Chips, WSTS Semiconductor Forecast

by Md Sazzad Hossain
June 11, 2025
Why Tech Wants a Soul
Data Analysis

Why Tech Wants a Soul

by Md Sazzad Hossain
June 11, 2025
Integrating DuckDB & Python: An Analytics Information
Data Analysis

Integrating DuckDB & Python: An Analytics Information

by Md Sazzad Hossain
June 10, 2025
Next Post
Take a look at: ChatGPT vs Imagen 4 vs FLUX 1.1 – Vilken AI-bildgenerator är bäst?

Take a look at: ChatGPT vs Imagen 4 vs FLUX 1.1 – Vilken AI-bildgenerator är bäst?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

FBI warns that finish of life units are being actively focused by risk actors

FBI warns that finish of life units are being actively focused by risk actors

May 11, 2025
Detecting Ransomware on Community: How Community Site visitors Evaluation Helps

Detecting Ransomware on Community: How Community Site visitors Evaluation Helps

June 13, 2025

Categories

  • Artificial Intelligence
  • Computer Networking
  • Cyber Security
  • Data Analysis
  • Disaster Restoration
  • Machine Learning

CyberDefenseGo

Welcome to CyberDefenseGo. We are a passionate team of technology enthusiasts, cybersecurity experts, and AI innovators dedicated to delivering high-quality, insightful content that helps individuals and organizations stay ahead of the ever-evolving digital landscape.

Recent

Detecting Ransomware on Community: How Community Site visitors Evaluation Helps

Detecting Ransomware on Community: How Community Site visitors Evaluation Helps

June 13, 2025
Photonic processor may streamline 6G wi-fi sign processing | MIT Information

Photonic processor may streamline 6G wi-fi sign processing | MIT Information

June 13, 2025

Search

No Result
View All Result

© 2025 CyberDefenseGo - All Rights Reserved

No Result
View All Result
  • Home
  • Cyber Security
  • Artificial Intelligence
  • Machine Learning
  • Data Analysis
  • Computer Networking
  • Disaster Restoration

© 2025 CyberDefenseGo - All Rights Reserved

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In