Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Microsoft Agents Activity

PyPI version

Core types and schemas for building conversational AI agents that work across Microsoft 365 platforms like Teams, Copilot Studio, and Webchat.

What is this?

This library is part of the Microsoft 365 Agents SDK for Python - a comprehensive framework for building enterprise-grade conversational AI agents. The SDK enables developers to create intelligent agents that work across multiple platforms including Microsoft Teams, M365 Copilot, Copilot Studio, and web chat, with support for third-party integrations like Slack, Facebook Messenger, and Twilio.

Release Notes

Version Date Release Notes
1.9.0 2026-10-19 1.9.0 Release Notes
1.8.0 2026-10-01 1.8.0 Release Notes
1.7.0 2026-09-17 1.7.0 Release Notes
1.5.0 2026-08-26 1.5.0 Release Notes
1.4.0 2026-08-18 1.4.0 Release Notes
1.3.0 2026-07-30 1.3.0 Release Notes
1.2.0 2026-07-17 1.2.0 Release Notes
1.1.0 2026-06-19 1.1.0 Release Notes
1.0.0 2026-05-22 1.0.0 Release Notes
0.9.1 2026-05-04 0.9.1 Release Notes
0.9.0 2026-04-15 0.9.0 Release Notes
0.8.0 2026-02-23 0.8.0 Release Notes
0.7.0 2026-01-21 0.7.0 Release Notes
0.6.1 2025-12-01 0.6.1 Release Notes
0.6.0 2025-11-18 0.6.0 Release Notes
0.5.0 2025-10-22 0.5.0 Release Notes

Packages Overview

We offer the following PyPI packages to create conversational experiences based on Agents:

Package Name PyPI Version Description
microsoft-agents-activity PyPI Types and validators implementing the Activity protocol spec.
microsoft-agents-hosting-core PyPI Core library for Microsoft Agents hosting.
microsoft-agents-hosting-aiohttp PyPI Configures aiohttp to run the Agent.
microsoft-agents-hosting-fastapi PyPI Configures fastapi to run the Agent.
microsoft-agents-hosting-msteams PyPI Provides classes to host an Agent for Teams.
microsoft-agents-hosting-dialogs PyPI Dialog system with waterfall dialogs, prompts, and multi-turn conversation management.
microsoft-agents-hosting-slack PyPI Provides classes to host an Agent for Slack.
microsoft-agents-storage-blob PyPI Extension to use Azure Blob as storage.
microsoft-agents-storage-cosmos PyPI Extension to use CosmosDB as storage.
microsoft-agents-authentication-msal PyPI MSAL-based authentication for Microsoft Agents.
microsoft-agents-authentication-entra-auth-sidecar PyPI Credential-free Entra ID Agent ID authentication via the sidecar.

Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:

Package Name PyPI Version Description
microsoft-agents-copilotstudio-client PyPI Direct to Engine client to interact with Agents created in CopilotStudio

Configuration

microsoft_agents.activity.config.Configuration wraps a mapping and provides typed getters and section lookup:

from microsoft_agents.activity.config import Configuration

config = Configuration(
    {"service": {"timeout": "30", "enabled": "false"}}
)

assert config.get_int(["service", "timeout"]) == 30
assert config.get_bool(["service", "enabled"]) is False

service = config.get_section("service")
assert service.get_int("timeout") == 30
assert service.base_path == "service"

Use string keys for direct lookup and lists of segments for nested lookup. Matching is exact. Internal SDK path helpers support case/underscore matching.

List positions require integer segments, including negative indexes. Numeric strings address string mapping keys rather than list positions:

items = Configuration({"items": [{"name": "first"}, {"name": "last"}]})
assert items.get(["items", 0, "name"]) == "first"
assert items.get(["items", -1, "name"]) == "last"
assert items.get(["items", "0", "name"], default="missing") == "missing"

Use wildcard() with collect(), collect_str(), or get_sections() to match all keys at one mapping level. String segments, including "*", remain literal keys.

from microsoft_agents.activity.config import Configuration, wildcard

config = Configuration(
    {
        "connections": {
            "first": {"client_id": "first-id"},
            "second": {"client_id": "second-id"},
        },
        "*": "literal value",
    }
)

assert config.collect(["connections", wildcard(), "client_id"]) == [
    "first-id",
    "second-id",
]
assert config.get("*") == "literal value"

Single-value getters do not accept wildcard paths.

get() returns its default for a missing value. Typed getters raise when a value is missing and no default is supplied; pass default=None, such as get_int("retries", default=None), for optional settings. Invalid nonempty typed values still raise rather than silently using a fallback. get_scopes() splits text on commas and whitespace.

Construction preserves key names and scalar values while wrapping nested plain containers. Existing query wrappers can remain shared between copies.

Settings classes expose from_config() for mappings, Configuration, existing settings objects, or None. Root-aware settings distinguish application-root input using mapping metadata. load_configuration_from_env(mapping) delegates normalization to the source resolver, applies logging configuration, and marks the result as root input. It accepts one mapping; callers own source selection and precedence.

Architecture

The SDK follows a modular architecture:

  • Activity Layer: Protocol definitions for cross-platform messaging
  • Hosting Layer: Core agent lifecycle, middleware, and web hosting
  • Storage Layer: Persistent state management with Azure backends
  • Authentication Layer: Secure identity and token management
  • Integration Layer: Platform-specific adapters (Teams, Copilot Studio)

Installation

pip install microsoft-agents-activity

Quick Start

Code below taken from the Quick Start sample.

@AGENT_APP.conversation_update("membersAdded")
async def on_members_added(context: TurnContext, _state: TurnState):
    await context.send_activity(
        "Welcome to the empty agent! "
        "This agent is designed to be a starting point for your own agent development."
    )
    return True


@AGENT_APP.message(re.compile(r"^hello$"))
async def on_hello(context: TurnContext, _state: TurnState):
    await context.send_activity("Hello!")


@AGENT_APP.activity("message")
async def on_message(context: TurnContext, _state: TurnState):
    await context.send_activity(f"you said: {context.activity.text}")

Common Use Cases

Rich Messages with Cards

Code below taken from the Cards sample.

    @staticmethod
    async def send_animation_card(context: TurnContext):
        card = CardFactory.animation_card(
            AnimationCard(
                title="Microsoft Agents Framework",
                image=ThumbnailUrl(
                    url="https://i.giphy.com/Ki55RUbOV5njy.gif", alt="Cute Robot"
                ),
                media=[MediaUrl(url="https://i.giphy.com/Ki55RUbOV5njy.gif")],
                subtitle="Animation Card",
                text="This is an example of an animation card using a gif.",
                aspect="16:9",
                duration="PT2M",
            )
        )
        await CardMessages.send_activity(context, card)

    @staticmethod
    async def send_activity(context: TurnContext, card: Attachment):
        activity = Activity(type=ActivityTypes.message, attachments=[card])
        await context.send_activity(activity)

Activity Types

The library supports different types of communication:

  • Message - Regular chat messages with text, cards, attachments
  • Typing - Show typing indicators
  • ConversationUpdate - People joining/leaving chats
  • Event - Custom events and notifications
  • Invoke - Direct function calls
  • EndOfConversation - End chat sessions

Key Features

✅ Type-safe - Built with Pydantic for automatic validation
✅ Rich content - Support for cards, images, videos, and interactive elements
✅ Teams ready - Full Microsoft Teams integration
✅ Cross-platform - Works across all Microsoft 365 chat platforms
✅ Migration friendly - Easy upgrade from Bot Framework

Quick Links

Sample Applications

Explore working examples in the Python samples repository:

Name Description README
Quickstart Simplest agent Quickstart
Auto Sign In Simple OAuth agent using Graph and GitHub auto-signin
OBO Authorization OBO flow to access a Copilot Studio Agent obo-authorization
Semantic Kernel Integration A weather agent built with Semantic Kernel semantic-kernel-multiturn
Streaming Agent Streams OpenAI responses azure-ai-streaming
Copilot Studio Client Console app to consume a Copilot Studio Agent copilotstudio-client
Cards Agent Agent that uses rich cards to enhance conversation design cards

Metadata

Release files for microsoft-agents-activity 1.10.0.dev11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microsoft-agents-activity 1.10.0.dev11
File Size Uploaded Provenance Actions
microsoft_agents_activity-1.10.0.dev11.tar.gz 99.1 kB Without provenance Details for microsoft_agents_activity-1.10.0.dev11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for microsoft-agents-activity 1.10.0.dev11
File Interpreter ABI Platform Actions
microsoft_agents_activity-1.10.0.dev11-py3-none-any.whl Python 3 none any Details for microsoft_agents_activity-1.10.0.dev11-py3-none-any.whl

Total release size: 281.6 kB

Release files / microsoft_agents_activity-1.10.0.dev11.tar.gz

Download URL microsoft_agents_activity-1.10.0.dev11.tar.gz
Size 99.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f5f74eef411b7b6ba91cb909f8e907951543f380b52c0c0c101b448a96a8c2dd
BLAKE2b-256 checksum
How to use checksums
3824d143a9cc4b4806e2d05603fbd1c553016f09d6ccf248e33f3a697eb11334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release files / microsoft_agents_activity-1.10.0.dev11-py3-none-any.whl

Download URL microsoft_agents_activity-1.10.0.dev11-py3-none-any.whl
Size 182.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30592b75688088a9ecac619fa595ef73d31ec13fb122969baad0077f984a38bd
BLAKE2b-256 checksum
How to use checksums
f0c15f88b77a3c7ba4da4308c43e116f9307611b5bbfbb2a9beedfb868cdc818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Security for microsoft-agents-activity 1.10.0.dev11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page