Skip to content
Skillv1.0.0

microsoft-agent-framework

Build multi-agent AI systems with Microsoft's Agent Framework (formerly Semantic Kernel Agents). Use when: defining AI agents, orchestrating multi-agent workflows (sequential, parallel, conditional),

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/microsoft-agent-framework/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill microsoft-agent-framework. Copyright stays with the author (Apache-2.0).

Microsoft Agent Framework

Overview

Microsoft Agent Framework provides primitives for building single and multi-agent AI systems. It supports agent definition, orchestration patterns, tool integration, and deployment — available in both Python and .NET.

Repo: microsoft/semantic-kernel (agents module)
Docs: learn.microsoft.com/semantic-kernel/agents
Requirements: Python 3.10+ or .NET 8+

Installation

Python

pip install semantic-kernel
# Agents are included in the core package

.NET

dotnet add package Microsoft.SemanticKernel
dotnet add package Microsoft.SemanticKernel.Agents.Core
dotnet add package Microsoft.SemanticKernel.Agents.OpenAI  # For OpenAI Assistant agent

Core Concepts

Agent Definition

An agent = instructions + model + tools + optional name/description.

from semantic_kernel.agents import ChatCompletionAgent
from semantic_kernel import Kernel

kernel = Kernel()
# Add AI service to kernel (OpenAI, Azure OpenAI, etc.)

researcher = ChatCompletionAgent(
    kernel=kernel,
    name="Researcher",
    instructions="""You are a research analyst. Given a topic,
    find key facts, statistics, and recent developments.
    Always cite sources. Output structured findings.""",
)

writer = ChatCompletionAgent(
    kernel=kernel,
    name="Writer",
    instructions="""You are a technical writer. Take research findings
    and produce clear, engaging content. Use simple language.
    Target audience: software developers.""",
)

Built-in Agent Types

Type Description Use Case
ChatCompletionAgent Wraps any chat model General tasks, most common
OpenAIAssistantAgent Uses OpenAI Assistants API Code interpreter, file search
AzureAIAgent Azure AI Foundry agent Enterprise, Azure-integrated

Agent with Tools

from semantic_kernel.functions import kernel_function

class WebSearch:
    @kernel_function(description="Search the web for information")
    def search(self, query: str) -> str:
        # Implement search logic
        return f"Results for: {query}"

class Calculator:
    @kernel_function(description="Perform mathematical calculations")
    def calculate(self, expression: str) -> str:
        return str(eval(expression))  # Use safe eval in production

kernel.add_plugin(WebSearch(), plugin_name="web")
kernel.add_plugin(Calculator(), plugin_name="math")

agent = ChatCompletionAgent(
    kernel=kernel,
    name="Assistant",
    instructions="Use tools to answer questions accurately.",
)

Multi-Agent Orchestration

AgentGroupChat

The primary way to orchestrate multiple agents:

from semantic_kernel.agents import AgentGroupChat
from semantic_kernel.agents.strategies import (
    SequentialSelectionStrategy,
    KernelFunctionTerminationStrategy,
)

chat = AgentGroupChat(
    agents=[researcher, writer, editor],
    selection_strategy=SequentialSelectionStrategy(
        agents=[researcher, writer, editor]
    ),
    termination_strategy=KernelFunctionTerminationStrategy(
        agents=[editor],
        max_iterations=6,
    ),
)

await chat.add_chat_message(message="Write a blog post about WebAssembly in 2025")

async for response in chat.invoke():
    print(f"[{response.name}]: {response.content}")

Orchestration Patterns

Sequential — agents take turns in fixed order

from semantic_kernel.agents.strategies import SequentialSelectionStrategy

strategy = SequentialSelectionStrategy(
    agents=[researcher, writer, editor],
    initial_agent=researcher,
)

Use for: pipelines where each agent builds on the previous output.

Conditional — kernel function picks the next agent

from semantic_kernel.agents.strategies import KernelFunctionSelectionStrategy

selector_fn = KernelFunction.from_prompt("""
Given the conversation, determine which agent should respond next.
Agents: Researcher, Writer, Editor.
If research is needed, pick Researcher.
If draft is ready for writing, pick Writer.
If draft needs review, pick Editor.
Respond with only the agent name.
""")

strategy = KernelFunctionSelectionStrategy(
    kernel=kernel,
    function=selector_fn,
    agents=[researcher, writer, editor],
)

Use for: dynamic workflows where the next step depends on current state.

Parallel — fan-out to multiple agents, aggregate results

import asyncio

async def parallel_analysis(topic: str):
    tasks = [
        researcher.invoke(f"Research {topic}"),
        competitor_analyst.invoke(f"Analyze competitors in {topic}"),
        trend_analyst.invoke(f"Identify trends in {topic}"),
    ]
    results = await asyncio.gather(*tasks)
    # Feed aggregated results to synthesizer agent
    summary = await synthesizer.invoke(
        f"Synthesize these analyses:\n" +
        "\n---\n".join(r.content for r in results)
    )
    return summary

Use for: independent analyses that combine into a final output.

.NET Example

using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.Chat;

var kernel = Kernel.CreateBuilder()
    .AddAzureOpenAIChatCompletion(deployment, endpoint, apiKey)
    .Build();

ChatCompletionAgent researcher = new()
{
    Kernel = kernel, Name = "Researcher",
    Instructions = "You are a research analyst. Find key facts and statistics."
};

ChatCompletionAgent writer = new()
{
    Kernel = kernel, Name = "Writer",
    Instructions = "You are a technical writer. Produce clear, engaging content."
};

AgentGroupChat chat = new(researcher, writer)
{
    ExecutionSettings = new()
    {
        SelectionStrategy = new SequentialSelectionStrategy { InitialAgent = researcher },
        TerminationStrategy = new MaxIterationTerminationStrategy(4)
    }
};

chat.AddChatMessage(new("Write about Kubernetes security best practices"));

await foreach (var msg in chat.InvokeAsync())
{
    Console.WriteLine($"[{msg.AuthorName}]: {msg.Content}");
}

Deployment

As API Service

from fastapi import FastAPI
from semantic_kernel.agents import ChatCompletionAgent

app = FastAPI()
# Initialize agents at startup

@app.post("/chat")
async def chat(message: str):
    response = await agent.invoke(message)
    return {"response": response.content}

Tips

  • Start with ChatCompletionAgent — it works with any chat model provider
  • Use SequentialSelectionStrategy first, upgrade to KernelFunctionSelectionStrategy when you need dynamic routing
  • Set max_iterations on termination strategy to prevent infinite agent loops
  • Each agent can have its own kernel with different models — use cheaper models for simple tasks
  • AgentGroupChat maintains shared conversation history — all agents see all messages

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-microsoft-agent-framework/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-microsoft-agent-framework.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-microsoft-agent-framework",
  "kind": "skill",
  "name": "microsoft-agent-framework",
  "description": "Build multi-agent AI systems with Microsoft's Agent Framework (formerly Semantic Kernel Agents). Use when: defining AI agents, orchestrating multi-agent workflows (sequential, parallel, conditional), creating custom agents in Python or .NET, using built-in agents (ChatCompletion, OpenAI Assistant), deploying agent systems, or comparing agent orchestration patterns.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "microsoft",
      "multi-agent",
      "orchestration",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Build multi-agent AI systems with Microsoft's Agent Framework (formerly Semantic Kernel Agents). Use when: defining AI agents, orchestrating multi-agent workflows (sequential, parallel, conditional), creating custom agents in Python or .NET, using built-in agents (ChatCompletion, OpenAI Assistant), deploying agent systems, or comparing agent orchestration patterns."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/microsoft-agent-framework/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/microsoft-agent-framework/SKILL.md",
      "key": "terminalskills/skills/skills/microsoft-agent-framework/SKILL.md"
    },
    "compatibility": "Python 3.10+ or .NET 8+",
    "license": "Apache-2.0"
  },
  "instructions": "# Microsoft Agent Framework\n\n## Overview\n\nMicrosoft Agent Framework provides primitives for building single and multi-agent AI systems. It supports agent definition, orchestration patterns, tool integration, and deployment — available in both Python and .NET.\n\n**Repo:** `microsoft/semantic-kernel` (agents module)  \n**Docs:** learn.microsoft.com/semantic-kernel/agents  \n**Requirements:** Python 3.10+ or .NET 8+\n\n## Installation\n\n### Python\n```bash\npip install semantic-kernel\n# Agents are included in the core package\n```\n\n### .NET\n```bash\ndotnet add package Microsoft.SemanticKernel\ndotnet add pa",
  "cost": {
    "context_tokens": 1705
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-microsoft-agent-framework/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.