VOOZH about

URL: https://thenewstack.io/building-multiagent-workflows-with-microsoft-autogen/

⇱ Building Multiagent Workflows With Microsoft AutoGen - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2025-10-29 13:00:54
Building Multiagent Workflows With Microsoft AutoGen
sponsor-andela,sponsored-post-contributed,
AI Agents / CI/CD / DevOps

Building Multiagent Workflows With Microsoft AutoGen

Set up agents with different roles — one focused on generating ideas, another on critiquing them — and watch them work together to produce better results.
Oct 29th, 2025 1:00pm by Oladimeji Sowole
👁 Featued image for: Building Multiagent Workflows With Microsoft AutoGen
Image from FAMILY STOCK on Shutterstock.
Andela sponsored this post.

Most AI implementations can feel like having a single, really smart intern: helpful, but limited to one perspective and prone to confidently wrong answers. But what if instead you could assemble a small team of AI specialists who actually debate with each other before giving you their final recommendation? That’s the industry change happening right now. Organizations are moving beyond basic chatbots toward choosing AI systems that can tackle real, complex problems. Microsoft’s AutoGen caught my attention because it makes this kind of multiagent collaboration surprisingly approachable. I’ve been experimenting with AutoGen for a few months, and the difference is striking. Instead of hoping one model gets it right, you’re watching agents challenge each other’s reasoning, catch mistakes and build on ideas — kind of like overhearing a really productive brainstorming session. This approach becomes essential when you’re dealing with messy, real-world problems: processing complex documents, synthesizing research from multiple sources or generating code that needs to actually work. Single agents often miss nuances or make assumptions that seem reasonable in isolation but fall apart under scrutiny. Here’s how to build a simple but effective multiagent system. You’ll set up agents with different roles — one focused on generating ideas, another on critiquing them — and watch them work together to produce better results than either could achieve alone. By the end, you’ll understand not just how to implement this technically, but why it represents a fundamental shift in the way we should think about AI in business contexts.

Why Multiagent Collaboration Matters

Traditional large language model (LLM) systems use one model to answer a query. But what if that model:
  • Needs context from prior answers?
  • Misses an important fact?
  • Could benefit from structured review?
Multiagent systems let you solve these problems by assigning roles:
  • One agent plans.
  • Another generates output.
  • A third critiques.
  • A user proxy collects and routes inputs.

Real-World Examples

  • Research copilot: Analyst agent searches documents, summarizer agent condenses, QA agent verifies facts.
  • Coding agent: User defines specs, builder agent generates code, critic agent tests or reviews it.

Step-By-Step Tutorial With AutoGen

1. Install Dependencies

pip install pyautogen openai Note: It’s recommended to use a virtual environment such as venv or conda when installing Python packages. This helps manage dependencies effectively and prevents conflicts with other projects. You’ll need an OpenAI API key and access to GPT-4 or GPT-3.5 Turbo. Store your key safely: export OPENAI_API_KEY="your-openai-key"

2. Create the Agent Configuration

AutoGen agents are configured using JSON-like dictionaries. You define:
  • Role (such as assistant, user, critic)
  • LLM settings
  • Behavioral flags (like auto-reply, enable feedback)
llm_config = {
 "model": "gpt-4",
 "api_key": os.environ["OPENAI_API_KEY"],
 "temperature": 0.5
}

3. Create a User Proxy Agent

The user proxy acts as the bridge between a human user and the LLM agents. It routes messages and optionally injects prompts.
user_proxy = UserProxyAgent(
 name="user",
 human_input_mode="NEVER",
 code_execution_config={"work_dir": "./autogen_output"},
 llm_config=llm_config
)

Set `human_input_mode=”ALWAYS”` if you want the user to be involved at each step. Otherwise, agents will operate automatically.

4. Create a Task Assistant Agent

This agent handles the actual task (answer generation, coding, summarization).
assistant = AssistantAgent(
 name="assistant",
 llm_config=llm_config
)

5. Create a Critic Agent (Optional but Powerful)

To improve quality, introduce a second agent to evaluate and refine assistant outputs.
critic = AssistantAgent(
 name="critic",
 system_message="You are a critic agent. Improve and verify the responses from other agents.",
 llm_config=llm_config
)

6. Set up Collaborative Workflow

AutoGen allows you to define group chats (multiturn dialogues between agents) or static message passing. Here’s a simple user-assistant dialogue:
user_proxy.initiate_chat(assistant, message="Explain the concept of transfer learning in machine learning.")
For critic involvement, chain multiple agents:
def critic_loop(user_proxy, assistant, critic):
 user_proxy.initiate_chat(
 recipient=assistant,
 message="Write a Python function to calculate the Fibonacci sequence.",
 summary_method="last_msg"
 )
 assistant.initiate_chat(critic, message="Please review my previous response.")

critic_loop(user_proxy, assistant, critic)

This mimics real-world collaboration: One agent completes a task, another reviews and optionally routes output back to the user.

Optional: Multiagent Group Chat

AutoGen supports GroupChatManager, which orchestrates many agents in turn-based settings:
from autogen import GroupChat, GroupChatManager

groupchat = GroupChat(
 agents=[user_proxy, assistant, critic],
 messages=[],
 max_round=5
)

manager = GroupChatManager(groupchat=groupchat)
user_proxy.initiate_chat(manager, message="Design a plan to teach AI in high schools.")

This structure lets each agent add value over multiple rounds until a consensus is formed.

What This Looks Like in Action

  • Prompt: “Design a marketing campaign for an eco-friendly toothpaste.”
  • Assistant agent response: Suggests a three-phase plan with social media and influencer outreach.
  • Critic agent: Flags that budget constraints weren’t considered.
  • Final answer: Refined with realistic costs and A/B testing.
You just built a self-improving, autonomous thought partnership.

Advanced Extensions

  • Tool-using agents: Configure agents to run Python code, query APIs or search the web.
  • Self-reflection: Let assistants review their own responses before sending.
  • Custom roles: Define agents like “planner,” “strategist,” “coder” or “tester.”
Example of a tool-invoking assistant:
AssistantAgent(..., code_execution_config={"use_docker": True})

Business and Technical Takeaways

Benefit For Executives For Developers
Modular agents Delegate responsibilities to improve interpretability and trust. Test and debug roles independently.
Dialogue-driven architecture Mirrors human workflows for review and feedback. Easy to replicate agile-style processes.
Production-ready Works with OpenAI APIs and pluggable backends. Great for experimentation and later deployment.

Final Thoughts

Working with a single AI model often feels like having a brilliant but isolated consultant, in that you get one perspective, take it or leave it. But what if you could assemble a whole team of AI specialists who actually talk to each other, debate ideas and catch each other’s mistakes? That’s the promise of multiagent systems like Microsoft AutoGen. Instead of crossing your fingers and hoping one model gets it right, you’re orchestrating conversations between different AI agents, each bringing their own strengths to the table. I’ve seen this approach solve problems that stumped single models. When agents can push back on each other’s reasoning, question assumptions and build on ideas collaboratively, the results are noticeably better. Less hallucination, more nuanced thinking and outputs that feel like they came from an actual team discussion. The practical benefits are hard to ignore:
  • Decisions happen faster when you have multiple perspectives working in parallel.
  • Agents catch each other’s errors before they reach you.
  • You can create specialist agents for different domains, including legal, finance and marketing, and let them combine their expertise.
The organizations that figure this out early are going to have a serious advantage. We’re moving from “using AI” to “managing AI teams.” The companies that nail this transition will be the ones setting the pace.
Andela provides the world’s largest private marketplace for global remote tech talent driven by an AI-powered platform to manage the complete contract hiring lifecycle. Andela helps companies scale teams & deliver projects faster via specialized areas: App Engineering, AI, Cloud, Data & Analytics.
Learn More
The latest from Andela
Hear more from our sponsor
TRENDING STORIES
Oladimeji Sowole is a member of the Andela Talent Network, a private marketplace for global tech talent.  A Data Scientist and Data Analyst with more than 6 years of professional experience building data visualizations with different tools and predictive models...
Read more from Oladimeji Sowole
Andela sponsored this post.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Real, OpenAI.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.