Building a Multi-Agent Translator with Microsoft Agent Framework
Today, we’re diving into something brand new and really exciting for all .NET developers — the Microsoft Agent Framework. This preview release takes AI and .NET development to the next level.
In this tutorial, we’ll build a translator that converts English text into French and Spanish, reviews the translations for quality, and then produces a final summary report — all using multiple AI agents working together.
What Are Agents?
An agent is essentially an AI-powered worker that can think, decide, and act to achieve a goal. You can think of it like a digital teammate — it has a specific job, its own personality, and it can use tools or APIs when necessary.
According to Microsoft, an agent is not just a simple “prompt and response” system. It can:
-
Reason and plan,
-
Call APIs,
-
Use memory, and
-
Collaborate with other agents.
This means agents can coordinate complex workflows and handle tasks that would typically require multiple independent systems.
Understanding Workflows
A workflow defines how agents connect and work together to finish a task. You can imagine it like a flowchart — first translate, then review, then summarize.
Workflows can be executed sequentially or in parallel, depending on the scenario. They bring structure and control, transforming random AI outputs into reliable, repeatable processes.
In short:
-
Agents bring intelligence — they understand context, reason, and generate output.
-
Workflows bring structure — they define order, dependencies, and branching.
When you combine both, you get a team of cooperating AI agents that can achieve much more than any single model call. For example, one agent could translate text, another could review it, and a third could summarize it — all orchestrated by the workflow you define.
It’s like turning large language models into a well-organized software system, not just a chatbot.
Introducing Microsoft Agent Framework
Now, let’s talk about the star of today’s video — the Microsoft Agent Framework.
This is a new open-source SDK from Microsoft, still in preview, that brings agents, workflows, tools, and memory together into one framework for both .NET and Python developers.
It’s built on ideas from Semantic Kernel and Autogen, but redesigned to make building multi-agent systems simple and scalable.
With this framework, you can:
-
Easily create agents,
-
Connect them through type-safe workflows,
-
Integrate Azure OpenAI or local models, and
-
Run steps in parallel or with human checkpoints.
Project Setup
We’ll now build a sequential translator workflow using four agents:
-
French Translator Agent – Converts English to French.
-
Spanish Translator Agent – Converts English to Spanish.
-
Quality Reviewer Agent – Reviews both translations for tone and accuracy.
-
Summary Agent – Combines everything into a final report.
It’s a simple example, but it clearly demonstrates how multiple agents can collaborate.
I’ve already created a .NET 9 console app. First, I’ll clean up the Program.cs
file.
Installing Required Packages
Next, let’s install the Microsoft Agent Framework packages.
Open the NuGet Package Manager and search for:
-
Microsoft.Agents.AI
– Install it. -
Microsoft.Agents.AI.Workflows
– This helps us build and connect multiple agents through workflows. -
Microsoft.Extensions.AI.OpenAI
– To integrate OpenAI or GitHub-hosted models.
Once installed, you’ll see them listed under the Dependencies section in your project. Now we’re ready to implement our agents and workflow.
Adding the Chat Client
The chat client allows agents to communicate with the AI model.
Here, we’re using the GitHub model GPT-4.0 Mini
, a lightweight yet powerful model ideal for these demos. To access it, you’ll need a GitHub API key.
In my previous video, I showed how to create these API keys, so check that out if you need help.
This chat client connects our .NET app to the GitHub-hosted OpenAI model so we can start building agents on top of it.
Creating the French Translator Agent
Our first agent is the French Translator.
It uses the chat client we just created, and its job is simple — take English text and translate it into French.
We create an instance of an agent using the ChatClientAgent
class and name it French Agent.
Inside the configuration options:
-
Name
= “French Agent” -
Instructions
= “Translate any provided text into French, keeping it natural and accurate.”
Once that’s done, our first agent is ready to go.
Creating the Spanish Translator Agent
Instead of writing everything from scratch, copy the French Agent’s code and make a few small changes:
-
Rename the variable to
SpanishAgent
. -
Update the name property to “Spanish Agent.”
-
Change the instructions to: “You are a translation assistant that translates provided text to Spanish.”
Now we have two agents:
-
One for French,
-
One for Spanish.
Creating the Quality Reviewer Agent
Next, copy the Spanish Agent code and adjust it for the Quality Reviewer Agent.
Rename the variable to QualityReviewerAgent
, and set the name property to “Quality Reviewer Agent.”
To keep the code clean, define the agent’s instructions in a separate string variable:string qualityReviewerAgentInstructions = "...";
This agent’s task is to review translations and provide quality feedback with a simple rating system.
Creating the Summary Agent
Now, we’ll create the Summary Agent in a similar way.
Copy the Quality Reviewer Agent code and make the following changes:
-
Rename the variable to
SummaryAgent
. -
Update the name property to “Summary Agent.”
Create a new string called summaryAgentInstructions
describing its role:
“Combine all translation reviews into one final readable report.”
And that’s it — the Summary Agent is ready.
Building the Workflow
Now it’s time to connect all four agents using a workflow.
We’ll create a new AI agent called WorkflowAgent
using the AgentWorkflowBuilder
class and call the method BuildSequential
.
This means the agents will run one after another:
-
French Translator
-
Spanish Translator
-
Quality Reviewer
-
Summary Agent
Finally, we call .AsAgentAsync()
to turn this entire chain into a single agent we can interact with.
Behind the scenes, the framework automatically passes the output from one agent to the next — turning multiple agents into one coordinated pipeline.
Running the Workflow
We’ll now add a simple user input to test it.
Prompt the user to enter some English text, then pass that input to the workflow agent using workflowAgent.Run(userInput)
.
This sends the text through the full workflow:
-
French Translator
-
Spanish Translator
-
Reviewer
-
Summary Agent
Each step processes the output and passes it along.
To display results nicely:
-
Print each agent’s name in yellow,
-
Print its output text in green.
Now run the application.
When prompted, type something like “Hello world” and press Enter.
You’ll see:
-
The French Agent translates it into French.
-
The Spanish Agent translates it into Spanish.
-
The Quality Reviewer Agent checks tone, grammar, and accuracy.
-
The Summary Agent generates a final quality report.
Each agent’s name appears in yellow, and its output in green — making it easy to follow the sequence.
Try entering a few more sentences — you’ll see how the workflow runs end-to-end, with each agent performing its role in order.
Conclusion
We’ve just built a complete multi-language translator workflow using the Microsoft Agent Framework.
Here’s what we achieved:
-
Created four agents — French Translator, Spanish Translator, Quality Reviewer, and Summary Agent.
-
Connected them using a sequential workflow.
-
Watched them collaborate step-by-step to produce a final report.
Each agent focused on a single task, while the framework handled all coordination — from translation to review and summary.
This demonstrates how easily you can design structured, collaborative AI systems inside .NET.
You can extend this workflow further by:
-
Adding more languages,
-
Creating custom reviewer agents, or
-
Integrating external APIs for advanced translation.
Related Posts
Leave a Reply Cancel reply
Service
Categories
- DEVELOPMENT (111)
- DEVOPS (54)
- FRAMEWORKS (34)
- IT (25)
- QA (14)
- SECURITY (14)
- SOFTWARE (13)
- UI/UX (6)
- Uncategorized (8)