AI
INDUSTRIAL
we are your local AI crew building cool stuff, sharing ideas, and making tech event
1 3 S E P T E M B E R 2 0 2 5
SUMMIT 2025
1 3 S E P T E M B E R 2 0 2 5
we are your local AI crew building cool stuff, sharing ideas, and making tech event ABOUT
SPONSORS
Big shoutout to our amazing sponsors thanks for believing in the power of AI and helping us bring this event to life in Sofia!
1 3 S E P T E M B E R 2 0 2 5
we are your local AI crew building cool stuff, sharing ideas, and making tech event
BRAINS in SYNC
Advanced Agent Orchestration with Semantic Kernel
AI
•“The Application Layer is Collapsing into Agents.“
Satya Nadella,
(CEO – Microsoft, May 2025)
◆ Solution Architect @
◆ Microsoft Azure AI MVP
◆ External Expert Eurostars-Eureka, Horizon Europe
◆ External Expert InnoFund Denmark, RIF Cyprus
◆ Business Interests
○ Cloud, IoT, Integration
○ Agentic AI, Machine Learning
○ Security & Performance Optimization
◆ Contact
○ ivelin.andreev@kongsbergdigital.com
○ www.linkedin.com/in/ivelin
○ www.slideshare.net/ivoandreev
Speaker
Takeaways
01 AI DEV Workshop: Semantic Kernel & AI Foundry
https://github.com/microsoft/ai-developer/blob/main/Dotnet/challenges/Resources/Lectures.pdf
02 Semantic Kernel (Sample Code)
https://github.com/microsoft/semantic-kernel/tree/main/dotnet/samples/GettingStartedWithProcesses
03 Semantic Kernel Frameworks
Agent Framework, Process Framework
04
Magentic-One: Multi-Agent System
https://arxiv.org/pdf/2411.04468
05
MetaGPT: Multi-Agent Collaborative Framework
https://arxiv.org/html/2308.00352v6, https://github.com/FoundationAgents/MetaGPT
06 Multi-agent Apps with AI Foundry (MSBuild2025)
https://www.youtube.com/watch?v=0tIzhAFzY34
07 Open AI Hallucination Risk Calculator
https://github.com/leochlon/hallbayes
Agents are About
Autonomy
AI Datacenter of the Future
FUTURE AI AUTONOMY
Only two jobs required in AI Datacenter
• 1 Programmer
• 1 Dog
Programmer is there for compliance
and make coffee
Dog makes sure the programmer
does not touch anything else
What is an Agent?
LLM
Instructions
Tools
LLM
Instructions
Tools
Agent
Output
Input
System
events
User
messages
Tool
results
Tool calls
Retrieval Actions Memory
Agent
messages
Agent
messages
Assistant or Agent?
Assistant AI Agent
Definition AI model assisting end-users
Smart autonomous microservice w/o
interactive UI
Function Accurate response on context Planning and reasoning
Use Cases
Routine tasks
• Chatbot, guidance
Complex problems
• Automation, workflows
Trigger Reactive, on request Proactive, works autonomously
Interaction Text-based, user-driven Action-oriented
Memory Retain within a session Maintains indefinite context in time
Complexity One-step: Request – Response Multi-step: Decision - Action
document summary
LLM
prompt
LLM
answer
question
Search
Agent
data
query
prompt
+
data
docs
conversation
Search
Retrieval
Agent
data
query
User Proxy
Agent
Coordinator
Agent
Analytics
Agent
data
Coding
Agent
docker
databases
docs
Memory
history of work
S
L
M
S
L
M
L
L
M
L
L
M
Web Service
Service
Agent
output
input
L
L
M
No Tools Agent
Narrow one-shot task
Ex: (No Tools) Text summarization
Single Agent + Tools
Clear iterative task
Ex: (RAG) Providing an answer with
supporting evidence to a complex question
Multi-agent Systems
Complex use case requiring diverse skills
Ex: Collaboration among specialized agents with diverse
roles and diverse data for optimization or analysis
Agentic Solutions Complexity
Different Ways to Build Agents
Control, visibility, and customization
Platform Integrations, ease-of-use, and development speed
IaaS PaaS SaaS
Infrastructure-as-a-service Platform-as-a-service Software-as-a-service
Semantic Kernel (SK)
Agent framework
(inspired by AutoGen)
Production Ready
Azure AI Foundry
Agent service
Copilot Studio
Agents
No-Code
SK adds:
• Collaboration
• Conversation-based coordination
• Automatic function calling
Semantic Kernel
Components
AI Service Connectors – connect
AI services from different providers
Vector Store Connectors –
connect stores(memory) from
different providers
Functions – arranged in plugin
containers
Prompt Templates – combine
context, instructions and plugin
calls in reusable form
Filters – custom actions
before/after function call
Semantic Kernel Components
Semantic Kernel Process Framework
◆ What is: Framework for integrating Semantic Kernel in biz workflows
◆ Why: Enables integration of LLM AI models in workflows to improve
productivity and decision-making. Runs Local In-Process, Cloud - DAPR
Components
◆ Process – container handling the workflow, events, state
◆ Step – smallest functional unit in a process
○ Is a class with method with [KernelFunction] attribute
○ Events: OnEvent, OnFunctionResult, SendOutputTo
◆ Pattern – standardize solutions of common problems
○ i.e. FanOut (run multiple skills in parallel)
◆ Sample Workflow
○ Research
○ Generate Content
○ Publish
◆ Sample Code (7 samples)
Semantic Kernel Agent Framework
◆ What is: Extends Semantic Kernel core to support multi-agent collaboration
Supported Agent Types
○ Azure AI agent (for Azure AI Agent Service)
○ OpenAI Assistant agent (for OpenAI Assistant API)
○ Amazon Bedrock agent
○ Chat completion agent
○ Copilot Studio agent
Azure AI Agent
○ Specialized agent within SK Framework
○ Automatic tool integration
○ Automatic thread-based context
○ Tools
■ File retrieval, Code execution,
■ Bing, Azure AI Search,
■ Functions, OpenAPI
1. Create AZ Foundry project
2. Add connection string in code
3. Create Agent Settings object
4. Instantiate Agent client
5. Define Agent with instructions
6. Create Agent from:
•Client
•Definition
•Plugins
Build Azure AI Agent workflow
Plugin
◆ Group of functions exposed to AI apps and services
◆ Metadata: {Input, Output, Side Effects}
○ Required by AI agent: to select function
◆ Function Types: {Data Retrieval for RAG, Task Automation}
Adding Plugins
◆ Plugin Sources: Native code, OpenAPI spec, MCP Server
◆ Workflow
○ Define plugin and decorate methods
○ Kernel function attribute contains description
○ Define new agent instance, add to agent collection
○ Invoke plugin function
○ Return result to LLM for final response
Extend Agents with Plugins
Tips for Functions
◆ Create kernel as transient (short-lived) service
○ Plugin collection is mutable and kernel could accumulate plugin errors
◆ Use snake_case function and parameter names even in C#
◆ Use structured types, descriptions, examples. Avoid strings when possible
◆ Hide unnecessary parameters (retrieve internally from context or service)
◆ Arguments must be generated by model and consume tokens (i.e. avoid GUIDs)
[KernelFunction("change_state")]
[Description("Changes the state of the light")]
public async Task<LightModel?> ChangeStateAsync (...){...}
public async Task<double> GetWeatherAsync(string location) – BAD
public async Task<double> GetWeatherAsync(
[Description("Name of the city, e.g., 'London'.")] string city,
[Description("Temperature unit to use.")] TemperatureUnit unit) - GOOD
Function Calling
◆ Only functions with the [KernelFunction] attribute will be sent to the model.
◆ Pass kernel to service, to notify service for kernel.Plugins
○ Without kernel the service will generate text only
Function Selection
○ Auto – allows AI to select zero or more functions
○ Required – forces AI to select at least one function
○ None – instruct AI not to choose any function
Function Invocation
○ Auto – when AI chooses function, it calls automatically
○ Manual – returns a list to the caller for decision
○ Sequentially/Concurrently – invoke one after the other or at the same time
var response =
await chatService.GetChatMessageContentsAsync(messages, kernel: kernel // kernel here);
The Role of Model Context
Protocol (MCP) Server
The Role of MCP Server
MCP Server
◆ Enables AI agent to dynamically discover and interact with tools and resources
and act beyond text generation
◆ JSON-based message format protocol
LLM Limitations (w/o tools and external data)
◆ LLMS produce text completions based on training data
◆ Issues: outdated, incomplete, private
◆ Insufficient for real-life scenarios
Tools and Resources
◆ Extend knowledge of LLM in real-world scenarios
MCP Architecture
○ Host application (the AI Agent)
○ MCP client library to communicate with MCP servers
○ MCP server exposes tools, resources, prompts via REST
MCP – How it works?
Transport Protocols
◆ stdio – I/O pipes for local communication
◆ HTTP/REST – single request-response, for web-based clients
◆ SSE (Server-Sent Events) – persistent connection for streaming (i.e. tool progress)
◆ WebSocket - real-time bi-directional communication
Advantages
◆ Discoverability – AI agents dynamically find GET(resources) or DO(tools)
◆ Plug & Play – new capabilities added w/o modifying agents and core logic
◆ Modularity – each MCP server focusses on a domain
◆ Composability – MCP servers can be clients of MCP servers
◆ Reusability – tools and resources from one MCP server can be reused
◆ Remote Tools – Server B is a proxy and relays requests to Server A
MCP Server Examples
Influx DB 3.x GitHub DevOps
Notes
• Local (Docker) version
• 21 Tools
• 3 Resources
• Local (Docker) version
• Remote (Hosted) version
• 80 Tools
• Local (Docker)
version
• 65 Tools
Resources
• Configuration
• Health Status
• Databases
Tools
• Total (21)
• Help & Diagnostics (2)
• DB Management (4)
• Data Ingestion (1)
• Query & Metadata (3)
• Tokens & Access (11)
• Context (1) & Actions (14)
• Organizations (1) & Users (1)
• Pull (18) & Repos (14) & Gists (3)
• Code Security (2) & Secrets (2)
• Notifications (6) & Discussions (4)
• Issues (12) & Dependabots (2)
• Core (3)
• Work (3)
• Work Items (18)
• Repos (19)
• Builds (9)
• Security (2)
• Test Plans (6)
• Search (3)
Agentic Digital Workforce
Single-Agent System Challenges
◆ Isolated Tasks: summarization, text completion, generation
◆ Real-world Complexity: multistep process required
◆ State: Lost when having multiple responsibilities
◆ Context: Poor context switching
Multi-Agent Systems
◆ Scalable: horizontal scalability by design
◆ Extensible: reusable agents increase flexibility w/o rearchitecting
◆ Expert: specialized agents focus on narrow roles
◆ Durable: support long-running processes and maintain context
Why Orchestration?
◆ Communication: allows predictable, rule-based or dynamic agent interaction
◆ State: maintain state easily
◆ Responsibility: Enables human in the loop
Digital Workforce with Multi-Agents
MetaGPT – Software Company Multi-Agent System
◆ Multi-Agent Collaborative Framework
◆ Integrates human workflows into multi-
agent LLM systems
Assembly Line Paradigm
◆ Chain agents to solve complex problems
◆ Reduces human role
◆ AgentStore – predefined Agent roles
Highlights
◆ Minimize hallucination by specialization
Validation
◆ Measure AI programing abilities
◆ 100% task completion
◆ 85.9% HumanEval
◆ Input: Single line of requirement
◆ Output: (est. 2$ for a project)
○ User Stories
○ Requirements
○ Data Structures
○ Implementation
○ Documentation
◆ Roles
MetaGPT – Why it Works?
SOP (Standard Operating Procedures)
◆ Task decomposition and simplification to roles
◆ Structured Output – structured agent communication (standard documents, not text)
◆ Reduces hallucinations in communication by enforcing consistent handovers
Communication Protocol
◆ Shared message pool (prevents 1-to-1 complexity)
◆ Subscription-based (filters relevant information to prevent overload)
Self-Improvement
◆ Executable Feedback – execute unit tests, improve iteratively (up to 3 iterations)
◆ Historical Memory –maintaining memory of previous feedback to avoid errors
◆ SimpleReviewer – member of the team (is_human=true) provides feedback
Limitations
○ Lags behind in UI/Front-end/Usability
○ Self-reflecting improvement covers only instructions, not protocols
Magentic-One: Multi-Agent System
◆ Generalist multi-agent system
◆ Solves complex X-domain tasks
◆ Generalizes across diverse context without
tuning per-task
Highlights
◆ Open Source
◆ Based on AutoGen-AgentChat
◆ Inspired Magentic Orchestration in Sem.Kernel
Validation
◆ Competitive to SOTA on various benchmarks
without reconfiguration
◆ Security issues: interacts with digital world
intended for humans (better be isolated)
◆ Roles
○ Orchestrator: plans, tracks
progress, re-plans on error
○ WebSurfer, FileSurfer
○ Coder, Compute
Semantic Kernel
Orchestrations
Concurrent Orchestration
Purpose: Runs multiple AI agents to work on the same task in parallel
◆ Agents process input independently from own perspective
◆ Results are aggregated
Use Cases:
◆ Parallel processing
◆ Brainstorming, Voting
Avoid:
◆ No clear conflict resolution strategy
◆ Cumulative context required
◆ Agents cannot coordinate changes on shared state
Sequential Orchestration
Purpose: Chain AI agents in a predefined linear order
◆ Agent processes output from previous agent
◆ Step-by-Step processing
◆ Next agent is deterministic
Use Cases:
◆ Data transformation
◆ Multi-stage process, clear dependencies
Avoid:
◆ Processes with few stages that can be handled by single AI agent
◆ AI agents need to collaborate (iterations) and not to hand over
◆ Dynamic routing necessary based on intermediate results
Group Chat Orchestration
Purpose: Multiple agents collaboratively solve problems in shared conversation
◆ Chat manager coordinates the flow (RoundRobin, AI) in loop
○ ShouldRequestUserInput, ShouldTerminate, FilterResults, SelectNextAgent
◆ Typically, R/O agents to avoid conflict edits
Use Cases:
◆ Iterative decision-making, debate and consensus
◆ Brainstorming reviews with gated approval
Avoid:
◆ When linear pipeline is sufficient
◆ No objective criteria whether task is complete
◆ Timely processing makes discussion overhead unacceptable
Magentic Orchestration
Purpose: Solve complex problems w/o predetermined plan
◆ Agents have tools allowing to make changes
◆ Dynamic task list with goals and subgoals
◆ Improvement of “Group Chat” but with edit
Use Cases:
◆ Complex use case
◆ Create a plan for human review
Avoid:
◆ Deterministic solution path
◆ Low complexity and time-sensitive tasks
◆ Ledger or plan are not necessary
Handling Complexity
◆ Can single agent + tools solve the problem reliably and cheaper?
◆ Context window size may affect agent (use summarization)
◆ Complex scenarios may need different orchestration per step
Reliability
◆ Orchestrator agent shall implement mitigation of failures
◆ Timeout/Retry limits
◆ Use checkpoints to recover from errors in long-running flows (deployment)
◆ Limit access to sensitive data, least privilege, audit trails
Do Not
◆ Use agents without clear specialization
◆ Forget resource constraints (i.e. tokens, cost) in concurrent orchestrations
◆ Ignore time-constraints
◆ Share editable state between concurrent agents
Key Considerations
DEMO
Semantic Kerenel
(.NET)
Semantic Kernel Samples (get project)
◆ Clone/Download Repo
◆ Navigate to solution home directory
◆ Download required packages, referenced by the .csproj files
◆ Navigate to target project location
◆ Build project and dependencies
◆ If build is w/o errors, you are O’K’ ☺
git clone https://github.com/microsoft/semantic-kernel/tree/main/
cd [$(RepoRoot)]semantic-kernel-maindotnet
dotnet restore
cd samplesGettingStartedWithAgents
dotnet build
◆ Open solution (VS 2022+)
o Select startup project (i.e. GettingStartedWithAgents)
o Create AZ AI Foundry agent project
◆ Samples require credentials to access OpenAI or Azure OpenAI
◆ Add appsettings.Development.json to the project
◆ Appsettings: Set AgentID to reuse agent otherwise a new will be created every run
◆ Appsettings > Properties > Copy to Output Directory: Always
Semantic Kernel Samples (Configuration)
{ "AzureOpenAI": {
"ServiceId": "your-service-id",
"DeploymentName": "gpt-4o",
"ModelId": "gpt-4o",
"ChatDeploymentName": "gpt-4o",
"ChatModelId": "gpt-4o",
"EmbeddingModelId": null,
"Endpoint":
"https://<XYZ>.openai.azure.com/",
"ApiKey": "<APIKEY>"
},
"OpenAI": {
"ModelId": "gpt-4o",
"ApiKey": “<APIKEY",
"OrgId": null
},
"AzureAI": {
"ChatModelId": "gpt-4o",
"Endpoint":
"https://<XYZ>.services.ai.azure.com
/api/projects/<ProjectName>",
"WorkflowEndpoint": null,
"BingConnectionId": null,
"VectorStoreId": null,
"AgentId": “<AgentID>"
}
}
◆ Note: Samples are intended for VS 2022 > Test > Test Explorer
◆ Note: Follow steps to set Console Application
◆ Create Program.cs in the project root
o Sample code https://github.com/microsoft/semantic-kernel/tree/main/dotnet
◆ Login with Azure CLI as AzureCliCredential is used
Semantic Kernel Samples (The Code)
az login –tenant <Subscription GUID>
Semantic Kernel Samples (Console Redirect)
◆ Create ConsoleOutputHelper class and add the following to BaseTest
◆ Helper class to redirect output to Console
◆ Pass the ConsoleOutputHelper to each sample
// Helper class to redirect output to Console
public class ConsoleOutputHelper : ITestOutputHelper{
public void WriteLine(string message) {
Console.WriteLine(message);
}
public void WriteLine(string format, params object[] args) {
Console.WriteLine(format, args);
}
}
var showTrace = Console.ReadLine()?.Trim().ToLower() == "y";
var outputHelper = showTrace ? new ConsoleOutputHelper() : null;
Semantic Kernel Samples (Magentic Orchestration)
◆ Magentic orchestration sample requires OpenAI paid model
o gpt-4o-search-preview
◆ To skip OpenAI model, set ForceOpenAI
◆ Use o3-mini as Manager model
o o3-mini - optimized for structured reasoning, GPT-4o – general purpose model
◆ Edit method CreateKernelWithOpenAIChatCompletion
◆ Check explanations @ learn.Microsoft.com
https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-orchestration/magentic
protected override bool ForceOpenAI => false;
private Kernel CreateKernelWithOpenAIChatCompletion(string model) {
IKernelBuilder builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion(
model,
TestConfiguration.AzureOpenAI.Endpoint,
TestConfiguration.AzureOpenAI.ApiKey);
return builder.Build();
}
Advanced Multi-Agent Orchestration with Semantic Kernel

Advanced Multi-Agent Orchestration with Semantic Kernel

  • 1.
    AI INDUSTRIAL we are yourlocal AI crew building cool stuff, sharing ideas, and making tech event 1 3 S E P T E M B E R 2 0 2 5 SUMMIT 2025
  • 2.
    1 3 SE P T E M B E R 2 0 2 5 we are your local AI crew building cool stuff, sharing ideas, and making tech event ABOUT SPONSORS Big shoutout to our amazing sponsors thanks for believing in the power of AI and helping us bring this event to life in Sofia!
  • 3.
    1 3 SE P T E M B E R 2 0 2 5 we are your local AI crew building cool stuff, sharing ideas, and making tech event BRAINS in SYNC Advanced Agent Orchestration with Semantic Kernel AI •“The Application Layer is Collapsing into Agents.“ Satya Nadella, (CEO – Microsoft, May 2025)
  • 4.
    ◆ Solution Architect@ ◆ Microsoft Azure AI MVP ◆ External Expert Eurostars-Eureka, Horizon Europe ◆ External Expert InnoFund Denmark, RIF Cyprus ◆ Business Interests ○ Cloud, IoT, Integration ○ Agentic AI, Machine Learning ○ Security & Performance Optimization ◆ Contact ○ ivelin.andreev@kongsbergdigital.com ○ www.linkedin.com/in/ivelin ○ www.slideshare.net/ivoandreev Speaker
  • 5.
    Takeaways 01 AI DEVWorkshop: Semantic Kernel & AI Foundry https://github.com/microsoft/ai-developer/blob/main/Dotnet/challenges/Resources/Lectures.pdf 02 Semantic Kernel (Sample Code) https://github.com/microsoft/semantic-kernel/tree/main/dotnet/samples/GettingStartedWithProcesses 03 Semantic Kernel Frameworks Agent Framework, Process Framework 04 Magentic-One: Multi-Agent System https://arxiv.org/pdf/2411.04468 05 MetaGPT: Multi-Agent Collaborative Framework https://arxiv.org/html/2308.00352v6, https://github.com/FoundationAgents/MetaGPT 06 Multi-agent Apps with AI Foundry (MSBuild2025) https://www.youtube.com/watch?v=0tIzhAFzY34 07 Open AI Hallucination Risk Calculator https://github.com/leochlon/hallbayes
  • 6.
  • 7.
    AI Datacenter ofthe Future FUTURE AI AUTONOMY Only two jobs required in AI Datacenter • 1 Programmer • 1 Dog Programmer is there for compliance and make coffee Dog makes sure the programmer does not touch anything else
  • 8.
    What is anAgent? LLM Instructions Tools LLM Instructions Tools Agent Output Input System events User messages Tool results Tool calls Retrieval Actions Memory Agent messages Agent messages
  • 9.
    Assistant or Agent? AssistantAI Agent Definition AI model assisting end-users Smart autonomous microservice w/o interactive UI Function Accurate response on context Planning and reasoning Use Cases Routine tasks • Chatbot, guidance Complex problems • Automation, workflows Trigger Reactive, on request Proactive, works autonomously Interaction Text-based, user-driven Action-oriented Memory Retain within a session Maintains indefinite context in time Complexity One-step: Request – Response Multi-step: Decision - Action
  • 10.
    document summary LLM prompt LLM answer question Search Agent data query prompt + data docs conversation Search Retrieval Agent data query User Proxy Agent Coordinator Agent Analytics Agent data Coding Agent docker databases docs Memory historyof work S L M S L M L L M L L M Web Service Service Agent output input L L M No Tools Agent Narrow one-shot task Ex: (No Tools) Text summarization Single Agent + Tools Clear iterative task Ex: (RAG) Providing an answer with supporting evidence to a complex question Multi-agent Systems Complex use case requiring diverse skills Ex: Collaboration among specialized agents with diverse roles and diverse data for optimization or analysis Agentic Solutions Complexity
  • 11.
    Different Ways toBuild Agents Control, visibility, and customization Platform Integrations, ease-of-use, and development speed IaaS PaaS SaaS Infrastructure-as-a-service Platform-as-a-service Software-as-a-service Semantic Kernel (SK) Agent framework (inspired by AutoGen) Production Ready Azure AI Foundry Agent service Copilot Studio Agents No-Code SK adds: • Collaboration • Conversation-based coordination • Automatic function calling
  • 12.
    Semantic Kernel Components AI ServiceConnectors – connect AI services from different providers Vector Store Connectors – connect stores(memory) from different providers Functions – arranged in plugin containers Prompt Templates – combine context, instructions and plugin calls in reusable form Filters – custom actions before/after function call Semantic Kernel Components
  • 13.
    Semantic Kernel ProcessFramework ◆ What is: Framework for integrating Semantic Kernel in biz workflows ◆ Why: Enables integration of LLM AI models in workflows to improve productivity and decision-making. Runs Local In-Process, Cloud - DAPR Components ◆ Process – container handling the workflow, events, state ◆ Step – smallest functional unit in a process ○ Is a class with method with [KernelFunction] attribute ○ Events: OnEvent, OnFunctionResult, SendOutputTo ◆ Pattern – standardize solutions of common problems ○ i.e. FanOut (run multiple skills in parallel) ◆ Sample Workflow ○ Research ○ Generate Content ○ Publish ◆ Sample Code (7 samples)
  • 14.
    Semantic Kernel AgentFramework ◆ What is: Extends Semantic Kernel core to support multi-agent collaboration Supported Agent Types ○ Azure AI agent (for Azure AI Agent Service) ○ OpenAI Assistant agent (for OpenAI Assistant API) ○ Amazon Bedrock agent ○ Chat completion agent ○ Copilot Studio agent Azure AI Agent ○ Specialized agent within SK Framework ○ Automatic tool integration ○ Automatic thread-based context ○ Tools ■ File retrieval, Code execution, ■ Bing, Azure AI Search, ■ Functions, OpenAPI 1. Create AZ Foundry project 2. Add connection string in code 3. Create Agent Settings object 4. Instantiate Agent client 5. Define Agent with instructions 6. Create Agent from: •Client •Definition •Plugins Build Azure AI Agent workflow
  • 15.
    Plugin ◆ Group offunctions exposed to AI apps and services ◆ Metadata: {Input, Output, Side Effects} ○ Required by AI agent: to select function ◆ Function Types: {Data Retrieval for RAG, Task Automation} Adding Plugins ◆ Plugin Sources: Native code, OpenAPI spec, MCP Server ◆ Workflow ○ Define plugin and decorate methods ○ Kernel function attribute contains description ○ Define new agent instance, add to agent collection ○ Invoke plugin function ○ Return result to LLM for final response Extend Agents with Plugins
  • 16.
    Tips for Functions ◆Create kernel as transient (short-lived) service ○ Plugin collection is mutable and kernel could accumulate plugin errors ◆ Use snake_case function and parameter names even in C# ◆ Use structured types, descriptions, examples. Avoid strings when possible ◆ Hide unnecessary parameters (retrieve internally from context or service) ◆ Arguments must be generated by model and consume tokens (i.e. avoid GUIDs) [KernelFunction("change_state")] [Description("Changes the state of the light")] public async Task<LightModel?> ChangeStateAsync (...){...} public async Task<double> GetWeatherAsync(string location) – BAD public async Task<double> GetWeatherAsync( [Description("Name of the city, e.g., 'London'.")] string city, [Description("Temperature unit to use.")] TemperatureUnit unit) - GOOD
  • 17.
    Function Calling ◆ Onlyfunctions with the [KernelFunction] attribute will be sent to the model. ◆ Pass kernel to service, to notify service for kernel.Plugins ○ Without kernel the service will generate text only Function Selection ○ Auto – allows AI to select zero or more functions ○ Required – forces AI to select at least one function ○ None – instruct AI not to choose any function Function Invocation ○ Auto – when AI chooses function, it calls automatically ○ Manual – returns a list to the caller for decision ○ Sequentially/Concurrently – invoke one after the other or at the same time var response = await chatService.GetChatMessageContentsAsync(messages, kernel: kernel // kernel here);
  • 18.
    The Role ofModel Context Protocol (MCP) Server
  • 19.
    The Role ofMCP Server MCP Server ◆ Enables AI agent to dynamically discover and interact with tools and resources and act beyond text generation ◆ JSON-based message format protocol LLM Limitations (w/o tools and external data) ◆ LLMS produce text completions based on training data ◆ Issues: outdated, incomplete, private ◆ Insufficient for real-life scenarios Tools and Resources ◆ Extend knowledge of LLM in real-world scenarios MCP Architecture ○ Host application (the AI Agent) ○ MCP client library to communicate with MCP servers ○ MCP server exposes tools, resources, prompts via REST
  • 20.
    MCP – Howit works? Transport Protocols ◆ stdio – I/O pipes for local communication ◆ HTTP/REST – single request-response, for web-based clients ◆ SSE (Server-Sent Events) – persistent connection for streaming (i.e. tool progress) ◆ WebSocket - real-time bi-directional communication Advantages ◆ Discoverability – AI agents dynamically find GET(resources) or DO(tools) ◆ Plug & Play – new capabilities added w/o modifying agents and core logic ◆ Modularity – each MCP server focusses on a domain ◆ Composability – MCP servers can be clients of MCP servers ◆ Reusability – tools and resources from one MCP server can be reused ◆ Remote Tools – Server B is a proxy and relays requests to Server A
  • 21.
    MCP Server Examples InfluxDB 3.x GitHub DevOps Notes • Local (Docker) version • 21 Tools • 3 Resources • Local (Docker) version • Remote (Hosted) version • 80 Tools • Local (Docker) version • 65 Tools Resources • Configuration • Health Status • Databases Tools • Total (21) • Help & Diagnostics (2) • DB Management (4) • Data Ingestion (1) • Query & Metadata (3) • Tokens & Access (11) • Context (1) & Actions (14) • Organizations (1) & Users (1) • Pull (18) & Repos (14) & Gists (3) • Code Security (2) & Secrets (2) • Notifications (6) & Discussions (4) • Issues (12) & Dependabots (2) • Core (3) • Work (3) • Work Items (18) • Repos (19) • Builds (9) • Security (2) • Test Plans (6) • Search (3)
  • 22.
  • 23.
    Single-Agent System Challenges ◆Isolated Tasks: summarization, text completion, generation ◆ Real-world Complexity: multistep process required ◆ State: Lost when having multiple responsibilities ◆ Context: Poor context switching Multi-Agent Systems ◆ Scalable: horizontal scalability by design ◆ Extensible: reusable agents increase flexibility w/o rearchitecting ◆ Expert: specialized agents focus on narrow roles ◆ Durable: support long-running processes and maintain context Why Orchestration? ◆ Communication: allows predictable, rule-based or dynamic agent interaction ◆ State: maintain state easily ◆ Responsibility: Enables human in the loop Digital Workforce with Multi-Agents
  • 24.
    MetaGPT – SoftwareCompany Multi-Agent System ◆ Multi-Agent Collaborative Framework ◆ Integrates human workflows into multi- agent LLM systems Assembly Line Paradigm ◆ Chain agents to solve complex problems ◆ Reduces human role ◆ AgentStore – predefined Agent roles Highlights ◆ Minimize hallucination by specialization Validation ◆ Measure AI programing abilities ◆ 100% task completion ◆ 85.9% HumanEval ◆ Input: Single line of requirement ◆ Output: (est. 2$ for a project) ○ User Stories ○ Requirements ○ Data Structures ○ Implementation ○ Documentation ◆ Roles
  • 25.
    MetaGPT – Whyit Works? SOP (Standard Operating Procedures) ◆ Task decomposition and simplification to roles ◆ Structured Output – structured agent communication (standard documents, not text) ◆ Reduces hallucinations in communication by enforcing consistent handovers Communication Protocol ◆ Shared message pool (prevents 1-to-1 complexity) ◆ Subscription-based (filters relevant information to prevent overload) Self-Improvement ◆ Executable Feedback – execute unit tests, improve iteratively (up to 3 iterations) ◆ Historical Memory –maintaining memory of previous feedback to avoid errors ◆ SimpleReviewer – member of the team (is_human=true) provides feedback Limitations ○ Lags behind in UI/Front-end/Usability ○ Self-reflecting improvement covers only instructions, not protocols
  • 26.
    Magentic-One: Multi-Agent System ◆Generalist multi-agent system ◆ Solves complex X-domain tasks ◆ Generalizes across diverse context without tuning per-task Highlights ◆ Open Source ◆ Based on AutoGen-AgentChat ◆ Inspired Magentic Orchestration in Sem.Kernel Validation ◆ Competitive to SOTA on various benchmarks without reconfiguration ◆ Security issues: interacts with digital world intended for humans (better be isolated) ◆ Roles ○ Orchestrator: plans, tracks progress, re-plans on error ○ WebSurfer, FileSurfer ○ Coder, Compute
  • 27.
  • 28.
    Concurrent Orchestration Purpose: Runsmultiple AI agents to work on the same task in parallel ◆ Agents process input independently from own perspective ◆ Results are aggregated Use Cases: ◆ Parallel processing ◆ Brainstorming, Voting Avoid: ◆ No clear conflict resolution strategy ◆ Cumulative context required ◆ Agents cannot coordinate changes on shared state
  • 29.
    Sequential Orchestration Purpose: ChainAI agents in a predefined linear order ◆ Agent processes output from previous agent ◆ Step-by-Step processing ◆ Next agent is deterministic Use Cases: ◆ Data transformation ◆ Multi-stage process, clear dependencies Avoid: ◆ Processes with few stages that can be handled by single AI agent ◆ AI agents need to collaborate (iterations) and not to hand over ◆ Dynamic routing necessary based on intermediate results
  • 30.
    Group Chat Orchestration Purpose:Multiple agents collaboratively solve problems in shared conversation ◆ Chat manager coordinates the flow (RoundRobin, AI) in loop ○ ShouldRequestUserInput, ShouldTerminate, FilterResults, SelectNextAgent ◆ Typically, R/O agents to avoid conflict edits Use Cases: ◆ Iterative decision-making, debate and consensus ◆ Brainstorming reviews with gated approval Avoid: ◆ When linear pipeline is sufficient ◆ No objective criteria whether task is complete ◆ Timely processing makes discussion overhead unacceptable
  • 31.
    Magentic Orchestration Purpose: Solvecomplex problems w/o predetermined plan ◆ Agents have tools allowing to make changes ◆ Dynamic task list with goals and subgoals ◆ Improvement of “Group Chat” but with edit Use Cases: ◆ Complex use case ◆ Create a plan for human review Avoid: ◆ Deterministic solution path ◆ Low complexity and time-sensitive tasks ◆ Ledger or plan are not necessary
  • 32.
    Handling Complexity ◆ Cansingle agent + tools solve the problem reliably and cheaper? ◆ Context window size may affect agent (use summarization) ◆ Complex scenarios may need different orchestration per step Reliability ◆ Orchestrator agent shall implement mitigation of failures ◆ Timeout/Retry limits ◆ Use checkpoints to recover from errors in long-running flows (deployment) ◆ Limit access to sensitive data, least privilege, audit trails Do Not ◆ Use agents without clear specialization ◆ Forget resource constraints (i.e. tokens, cost) in concurrent orchestrations ◆ Ignore time-constraints ◆ Share editable state between concurrent agents Key Considerations
  • 33.
  • 34.
    Semantic Kernel Samples(get project) ◆ Clone/Download Repo ◆ Navigate to solution home directory ◆ Download required packages, referenced by the .csproj files ◆ Navigate to target project location ◆ Build project and dependencies ◆ If build is w/o errors, you are O’K’ ☺ git clone https://github.com/microsoft/semantic-kernel/tree/main/ cd [$(RepoRoot)]semantic-kernel-maindotnet dotnet restore cd samplesGettingStartedWithAgents dotnet build
  • 35.
    ◆ Open solution(VS 2022+) o Select startup project (i.e. GettingStartedWithAgents) o Create AZ AI Foundry agent project ◆ Samples require credentials to access OpenAI or Azure OpenAI ◆ Add appsettings.Development.json to the project ◆ Appsettings: Set AgentID to reuse agent otherwise a new will be created every run ◆ Appsettings > Properties > Copy to Output Directory: Always Semantic Kernel Samples (Configuration) { "AzureOpenAI": { "ServiceId": "your-service-id", "DeploymentName": "gpt-4o", "ModelId": "gpt-4o", "ChatDeploymentName": "gpt-4o", "ChatModelId": "gpt-4o", "EmbeddingModelId": null, "Endpoint": "https://<XYZ>.openai.azure.com/", "ApiKey": "<APIKEY>" }, "OpenAI": { "ModelId": "gpt-4o", "ApiKey": “<APIKEY", "OrgId": null }, "AzureAI": { "ChatModelId": "gpt-4o", "Endpoint": "https://<XYZ>.services.ai.azure.com /api/projects/<ProjectName>", "WorkflowEndpoint": null, "BingConnectionId": null, "VectorStoreId": null, "AgentId": “<AgentID>" } }
  • 36.
    ◆ Note: Samplesare intended for VS 2022 > Test > Test Explorer ◆ Note: Follow steps to set Console Application ◆ Create Program.cs in the project root o Sample code https://github.com/microsoft/semantic-kernel/tree/main/dotnet ◆ Login with Azure CLI as AzureCliCredential is used Semantic Kernel Samples (The Code) az login –tenant <Subscription GUID>
  • 37.
    Semantic Kernel Samples(Console Redirect) ◆ Create ConsoleOutputHelper class and add the following to BaseTest ◆ Helper class to redirect output to Console ◆ Pass the ConsoleOutputHelper to each sample // Helper class to redirect output to Console public class ConsoleOutputHelper : ITestOutputHelper{ public void WriteLine(string message) { Console.WriteLine(message); } public void WriteLine(string format, params object[] args) { Console.WriteLine(format, args); } } var showTrace = Console.ReadLine()?.Trim().ToLower() == "y"; var outputHelper = showTrace ? new ConsoleOutputHelper() : null;
  • 38.
    Semantic Kernel Samples(Magentic Orchestration) ◆ Magentic orchestration sample requires OpenAI paid model o gpt-4o-search-preview ◆ To skip OpenAI model, set ForceOpenAI ◆ Use o3-mini as Manager model o o3-mini - optimized for structured reasoning, GPT-4o – general purpose model ◆ Edit method CreateKernelWithOpenAIChatCompletion ◆ Check explanations @ learn.Microsoft.com https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-orchestration/magentic protected override bool ForceOpenAI => false; private Kernel CreateKernelWithOpenAIChatCompletion(string model) { IKernelBuilder builder = Kernel.CreateBuilder(); builder.AddAzureOpenAIChatCompletion( model, TestConfiguration.AzureOpenAI.Endpoint, TestConfiguration.AzureOpenAI.ApiKey); return builder.Build(); }