buildfastwithaibuildfastwithai
AI WorkshopsAll blogsPartner with usFDE Program
Unrot mascotGet yourselfupskilled in AIfor free.Get the appNext live workshopFree AI WorkshopLive session, recording includedReserve a seat

Newsletter

Stay ahead

AI tools and tips. No spam.

Share
Back to blogs
Tutorials
Automation

AI Automation Made Easy with Agency Swarm

By Satvik Paramkusham
March 10, 2025
4 min read
Share:
AI Automation Made Easy with Agency Swarm
Share:

Are you waiting for change, or will you create it?

The future is calling—answer it with Gen AI Launch Pad 2025.

Introduction

Automation has become a game-changer in modern workflows, allowing businesses to optimize processes and enhance efficiency. Enter Agency Swarm, an advanced AI framework that enables multiple AI agents to work together just like a human team. With features like modular agent roles, intelligent communication, and customizable workflows, Agency Swarm is transforming automation.

This guide walks you through setting up and using Agency Swarm, helping you harness its full potential for task automation and data collection.

Key Features of Agency Swarm

  1. Modular Agent Roles:- Agency Swarm allows you to create AI agents with specialized roles such as Manager, Researcher, Developer, or Analyst. Each agent performs a specific function, making collaboration efficient and structured.
  2. Seamless Collaboration:- Agents communicate through an intelligent messaging system, ensuring smooth task execution without conflicts or delays.
  3. Customizable Workflows:- Define and control how agents interact, automate repetitive tasks, and adapt the system to various use cases.
  4. State Management:- Agents can remember past interactions and track progress using a state-saving system, ensuring continuity in long-term projects.
  5. Scalable & High Performance:- Designed for large-scale automation, Agency Swarm is optimized for high efficiency and production readiness.

Installing and Setting Up Agency Swarm

To start using Agency Swarm, follow these steps:

Step 1: Install Dependencies

Use the following command to install the necessary libraries:

pip install -U agency-swarm gradio selenium webdriver-manager selenium_stealth

Step 2: Set Up API Keys

Set up OpenAI API keys for AI-powered automation:

from google.colab import userdata
OPENAI_API_KEY = userdata.get('OPENAI_API_KEY')

from agency_swarm import set_openai_key
set_openai_key(OPENAI_API_KEY)

Step 3: Import the Genesis Agency

from agency_swarm.agency.genesis import GenesisAgency

Step 4: Initialize a Test Agency

test_agency = GenesisAgency()

Step 5: Launch Gradio Demo

test_agency.demo_gradio()

Creating AI Agents

The CEO Agent oversees operations and ensures seamless task execution:

from agency_swarm import Agency, Agent

ceo = Agent(
    name="CEO",
    description="Responsible for client communication, task planning and management.",
    instructions="You must converse with other agents to ensure complete task execution.",
    tools=[],
)

Creating a Test Agent

A Test Agent verifies system responses:

test = Agent(
    name="Test Agent",
    description="Test agent",
    instructions="Please always respond with 'test complete'",
    tools=[],
)

Managing Threads and Settings

Define thread management to keep track of ongoing conversations:

threads = {}

def load_threads():
    global threads
    return threads

def save_threads(new_threads):
    global threads
    threads = new_threads

Define settings management:

settings = []

def load_settings():
    global settings
    return settings

def save_settings(new_settings):
    global settings
    settings = new_settings
LLM AGENTSRAG PIPELINESTOOL CALLINGDEPLOYMENT
Let's build

Start building AI agents with Build Fast

Explore ProgramJoin Waitlist

Initializing the Agency

Integrate multiple agents and set up an asynchronous communication model:

agency = Agency(
    [ceo, [ceo, test]],
    async_mode="threading",
    threads_callbacks={"load": load_threads, "save": save_threads},
    settings_callbacks={"load": load_settings, "save": save_settings},
)

⚠ Note: 'threading' mode is deprecated. Use send_message_tool_class = SendMessageAsyncThreading for async communication.

Sending Messages to Agents

agency.get_completion("Say hi to test agent", yield_messages=False)

Checking Agency Status

agency.get_completion("Check status", yield_messages=False)

Launching Gradio Demo

agency.demo_gradio()

Building a Data Collection Swarm

Import Required Modules

import sys
sys.path.insert(0, "../")

from agency_swarm import Agency, Agent
from agency_swarm.agents import BrowsingAgent

Creating a Report Manager Agent

The Report Manager supervises web data collection:

report_manager = Agent(
    name="Report Manager",
    description="Supervises data collection from various websites.",
    instructions="Break down user tasks into steps, instruct BrowsingAgent, and compile reports with sourced links.",
)

Configuring Selenium & Browsing Agent

Configure Selenium for web browsing automation:

selenium_config = {
    "headless": False,
    "full_page_screenshot": False,
}

browsing_agent = BrowsingAgent(selenium_config=selenium_config)

Initializing the Data Collection Agency

agency = Agency(
    [report_manager, [report_manager, browsing_agent]],
    shared_instructions="Find relevant information online and compile detailed reports.",
)

Launching the Gradio Demo

demo = agency.demo_gradio(height=700)

Conclusion

Agency Swarm is a powerful AI automation framework that simplifies complex workflows with modular agents and intelligent coordination. Whether you're managing projects, collecting data, or automating repetitive tasks, Agency Swarm provides scalability, efficiency, and adaptability.

Start integrating AI agents today and revolutionize your workflow automation!

References

  • Agency Swarm Documentation
  • Gradio for AI Interfaces
  • Selenium Web Scraping Guide
  • Agency Swarm Experiment Notebook

---------------------------

Stay Updated:- Follow Build Fast with AI pages for all the latest AI updates and resources.

Experts predict 2025 will be the defining year for Gen AI Implementation. Want to be ahead of the curve?

Join Build Fast with AI’s Gen AI Launch Pad 2025 - your accelerated path to mastering AI tools and building revolutionary applications.

---------------------------

Cohort program

Claude MasteryCowork & Code

Explore programJoin waitlistNo coding needed

Resources and Community

Join our community of 12,000+ AI enthusiasts and learn to build powerful AI applications! Whether you're a beginner or an experienced developer, our resources will help you understand and implement Generative AI in your projects.

  • Website: www.buildfastwithai.com
  • LinkedIn: linkedin.com/company/build-fast-with-ai/
  • Instagram: instagram.com/buildfastwithai/
  • Twitter: x.com/satvikps
  • Telegram: t.me/BuildFastWithAI
Satvik Paramkusham
Written by

Satvik Paramkusham

Founder at Build Fast with AI. AI Engineer, educator, and researcher passionate about agentic AI workflows, LLM application architecture, and training the next generation of AI builders.

Share:

Partner with Build Fast with AI

Guest posts, sponsored articles, tool reviews and in-blog CTAs. See what we offer and get in touch.

Partner with us

Topics

  • Claude AI
  • Best AI Models
  • AI Coding Tools
  • AI Agent Frameworks
  • Agentic AI
  • Open-Source LLMs
  • RAG & Vector Databases
  • AI Industry News

Popular guides

  • 100 Best AI Photo Editing Prompts
  • 75 Best ChatGPT Images 2.5 Prompts
  • 100 Best AI Video Prompts
  • Best AI Models 2026, Tested
  • Claude AI Complete Guide
  • What Is MCP?

Build Fast with AI

  • Build Fast with AI
  • AI Workshops
  • Corporate Training
  • FDE Program
  • Partner with Us
  • Contact
© 2026 Intellify Edventures Private Limited. All rights reserved.
    You Might Also Like
    ChatGPT Images 2.6: Features, Pricing and Review
    Tutorials
    ChatGPT Images 2.6: Features, Pricing and Review

    ChatGPT Images 2.6 review covering Flare vs Sunburst, GIFs, SVG output, image editing, API pricing and practical prompts for creators.

    50 Best Diwali AI Photo Prompts 2026 for Gemini, ChatGPT & Nano Banana
    Tools
    50 Best Diwali AI Photo Prompts 2026 for Gemini, ChatGPT & Nano Banana

    Create stunning Diwali photos with 50 copy-paste AI prompts for Gemini, ChatGPT and Nano Banana. Try realistic portraits, couple photos, saree looks, diyas, rangoli and festive posters.