Skip to content
145 changes: 131 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,137 @@
# Microsoft Agent 365 Python SDK
# Microsoft Agents 365 SDK - Python
Comment thread
abdulanu0 marked this conversation as resolved.
Outdated

The Microsoft Agent365 SDK provides comprehensive observability, tooling, and runtime capabilities for AI agents and tools built with Python.
[![PyPI](https://img.shields.io/pypi/v/microsoft-agents-a365-observability-core?label=PyPI&logo=pypi)](https://pypi.org/search/?q=microsoft-agents-a365)
[![PyPI Downloads](https://img.shields.io/pypi/dm/microsoft-agents-a365-observability-core?label=Downloads&logo=pypi)](https://pypi.org/search/?q=microsoft-agents-a365)
[![Build Status](https://img.shields.io/github/actions/workflow/status/microsoft/Agent365-python/build.yml?branch=main&label=Build&logo=github)](https://github.com/microsoft/Agent365-python/actions)
[![License](https://img.shields.io/github/license/microsoft/Agent365-python?label=License)](LICENSE.md)
[![Python Version](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python)](https://www.python.org/)
[![Contributors](https://img.shields.io/github/contributors/microsoft/Agent365-python?label=Contributors&logo=github)](https://github.com/microsoft/Agent365-python/graphs/contributors)

## 📚 Library Documentation
> #### Note:
> Use the information in this README to contribute to this open-source project. To learn about using this SDK in your projects, refer to the [Microsoft Agents 365 Developer documentation](https://learn.microsoft.com/microsoft-agent-365/developer/).
Comment thread
abdulanu0 marked this conversation as resolved.
Outdated

Each library includes comprehensive documentation:
The Microsoft Agents 365 SDK extends the Microsoft 365 Agents SDK with enterprise-grade capabilities for building sophisticated agents. This SDK provides comprehensive tooling for observability, notifications, runtime utilities, and development tools that help developers create production-ready agents for platforms including M365, Teams, Copilot Studio, and Webchat.
Comment thread
abdulanu0 marked this conversation as resolved.
Outdated

| Library | Purpose | Documentation |
|---------|---------|---------------|
| **Observability Core** | Core telemetry and tracing | [`/libraries/microsoft-agents-a365-observability-core/README.md`](./libraries/microsoft-agents-a365-observability-core/README.md) |
| **Runtime** | Environment management and utilities | [`/libraries/microsoft-agents-a365-runtime/README.md`](./libraries/microsoft-agents-a365-runtime/README.md) |
| **Tooling** | MCP server configuration and utilities | [`/libraries/microsoft-agents-a365-tooling/README.md`](./libraries/microsoft-agents-a365-tooling/README.md) |
| **OpenAI Extensions** | OpenAI integration and observability | [`/libraries/microsoft-agents-a365-observability-extensions-openai/README.md`](./libraries/microsoft-agents-a365-observability-extensions-openai/README.md) |
| **LangChain Extensions** | LangChain integration and observability | [`/libraries/microsoft-agents-a365-observability-extensions-langchain/README.md`](./libraries/microsoft-agents-a365-observability-extensions-langchain/README.md) |
| **Semantic Kernel Extensions** | Semantic Kernel integration | [`/libraries/microsoft-agents-a365-observability-extensions-semantickernel/README.md`](./libraries/microsoft-agents-a365-observability-extensions-semantickernel/README.md) |
The Microsoft Agents 365 SDK focuses on four core areas:
Comment thread
abdulanu0 marked this conversation as resolved.
Outdated

## 📋 **Telemetry**
- **Observability**: Comprehensive tracing, caching, and monitoring capabilities for agent applications
- **Notifications**: Agent notification services and models for handling user notifications
- **Runtime**: Core utilities and extensions for agent runtime operations
- **Tooling**: Developer tools and utilities for building sophisticated agent applications

Data Collection. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
## Current Project State

This project is currently in active development. Packages are published to PyPI as they become available.

### Public PyPI feed

The best way to consume this SDK is via our PyPI packages found here: [pypi.org](https://pypi.org/search/?q=microsoft-agents-a365). All packages begin with **microsoft-agents-a365**.

## Working with this codebase

### Prerequisites

- Python 3.10 or later
- pip or uv package manager
- Git

### Building the project

1. Clone the repository:

```bash
git clone https://github.com/microsoft/Agent365-python.git
cd Agent365-python
```

2. Create a virtual environment:

```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```

3. Build the packages:

```bash
# Set the version
export AGENT365_PYTHON_SDK_PACKAGE_VERSION="0.1.0" # On Windows: $env:AGENT365_PYTHON_SDK_PACKAGE_VERSION = "0.1.0"

# Build all packages
uv build --all-packages --wheel
```

4. Run tests:

```bash
pytest tests/
```

For more detailed build instructions, see the [BUILD.md](BUILD.md).

## Project Structure

- **libraries/microsoft-agents-a365-notifications**: Microsoft Agents 365 Notifications - Agent notification services and models
- **libraries/microsoft-agents-a365-observability-core**: Microsoft Agents 365 Observability Core - Core observability functionality
- **libraries/microsoft-agents-a365-observability-extensions-agentframework**: Agent Framework observability extensions
- **libraries/microsoft-agents-a365-observability-extensions-langchain**: LangChain observability extensions
- **libraries/microsoft-agents-a365-observability-extensions-openai**: OpenAI observability extensions
- **libraries/microsoft-agents-a365-observability-extensions-semantickernel**: Semantic Kernel observability extensions
- **libraries/microsoft-agents-a365-runtime**: Microsoft Agents 365 Runtime - Core runtime utilities and extensions
- **libraries/microsoft-agents-a365-tooling**: Microsoft Agents 365 Tooling - Agent tooling and MCP integration
- **libraries/microsoft-agents-a365-tooling-extensions-agentframework**: Agent Framework tooling extensions
- **libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry**: Azure AI Foundry tooling extensions
- **libraries/microsoft-agents-a365-tooling-extensions-openai**: OpenAI tooling extensions
- **libraries/microsoft-agents-a365-tooling-extensions-semantickernel**: Semantic Kernel tooling extensions
- **samples/**: For sample applications, see the [Agent365-Samples Repository](https://github.com/microsoft/Agent365-Samples/tree/main/python)
- **tests/**: Unit and integration tests

## Support

For issues, questions, or feedback:

- **Issues**: Please file issues in the [GitHub Issues](https://github.com/microsoft/Agent365-python/issues) section
- **Documentation**: See the [Microsoft Agents 365 developer documentation](https://learn.microsoft.com/microsoft-agent-365/developer/)
- **Security**: For security issues, please see [SECURITY.md](SECURITY.md)

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

## Useful Links

### Microsoft 365 Agents SDK

The core SDK for building conversational AI agents for Microsoft 365 platforms.

- [Microsoft 365 Agents SDK](https://aka.ms/agents)
- [Agents-for-net repository](https://github.com/Microsoft/Agents-for-net)
- [Agents-for-js repository](https://github.com/Microsoft/Agents-for-js)
- [Agents-for-python repository](https://github.com/Microsoft/Agents-for-python)
- [Microsoft 365 Agents documentation](https://learn.microsoft.com/microsoft-365/agents-sdk/)

### Microsoft Agents 365 SDK
Comment thread
abdulanu0 marked this conversation as resolved.

Enterprise-grade extensions for observability, notifications, runtime utilities, and developer tools.

- [Agent365-dotnet repository](https://github.com/microsoft/Agent365-dotnet)
- [Agent365-python repository](https://github.com/microsoft/Agent365-python) - You are here
- [Agent365-nodejs repository](https://github.com/microsoft/Agent365-nodejs)
- [Agent365-Samples repository](https://github.com/microsoft/Agent365-Samples)
- [Microsoft Agents 365 developer documentation](https://learn.microsoft.com/microsoft-agent-365/developer/)
Comment thread
abdulanu0 marked this conversation as resolved.
Outdated

### Additional Resources

- [Python Documentation](https://learn.microsoft.com/python/api/?view=m365-agents-sdk&preserve-view=true)

## Data Collection Notice

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
181 changes: 57 additions & 124 deletions libraries/microsoft-agents-a365-notifications/README.md
Original file line number Diff line number Diff line change
@@ -1,140 +1,73 @@
# Microsoft Agent 365 Notifications
[![PyPI version](https://badge.fury.io/py/microsoft-agents-a365-notifications.svg)](https://badge.fury.io/py/microsoft-agents-a365-notifications)
# microsoft-agents-a365-notifications

Notification and messaging extensions for AI agent applications built with the Microsoft Agent 365 SDK. Enable your agents to handle rich notifications from Microsoft 365 applications like Word, Excel, PowerPoint, and Email.
[![PyPI](https://img.shields.io/pypi/v/microsoft-agents-a365-notifications?label=PyPI&logo=pypi)](https://pypi.org/project/microsoft-agents-a365-notifications)
[![PyPI Downloads](https://img.shields.io/pypi/dm/microsoft-agents-a365-notifications?label=Downloads&logo=pypi)](https://pypi.org/project/microsoft-agents-a365-notifications)

## What is this?

This library is part of the Microsoft Agent 365 SDK for Python - a comprehensive framework for building enterprise-grade conversational AI agents. The notifications package specifically handles incoming notifications from Microsoft 365 applications, allowing your agents to respond to events like document updates, email mentions, and collaborative activities.

## Key Features

✅ **Microsoft 365 Integration** - Handle notifications from Word, Excel, PowerPoint, and Outlook
✅ **Channel Routing** - Intelligent routing based on source application and context
✅ **Type Safety** - Built with Pydantic for automatic validation and type checking
✅ **Flexible Handlers** - Support for wildcard and specific channel notification handlers
✅ **Enterprise Ready** - Built for production Microsoft 365 environments
✅ **Async Support** - Full async/await support for high-performance applications
Notification and messaging extensions for AI agent applications. This package provides utilities for handling agent notifications, lifecycle events, and routing across different channels and subchannels in Microsoft 365 applications.
Comment thread
mrunalhirve128 marked this conversation as resolved.

## Installation

```bash
pip install microsoft-agents-a365-notifications
```

## Quick Start

### Basic Concepts

The Microsoft Agent 365 Notifications package enables your agents to receive and respond to notifications from Microsoft 365 applications. Key concepts include:

- **Notification Handlers**: Functions that process incoming notifications
- **Channel Routing**: Route notifications based on the source application
- **Sub-Channel Filtering**: Handle specific types of notifications (email, documents, etc.)
- **Context Integration**: Access rich context about the notification source

### Getting Started

1. Install the package: `pip install microsoft-agents-a365-notifications`
2. Configure your agent application with notification support
3. Register handlers for specific Microsoft 365 applications
4. Process incoming notifications with full context

## Supported Microsoft 365 Applications

| Application | Sub-Channel ID | Description |
|-------------|----------------|-------------|
| **Email** | `email` | Handle mentions and email-based interactions |
| **Word** | `word` | Respond to document collaboration events |
| **Excel** | `excel` | Process spreadsheet updates and analysis requests |
| **PowerPoint** | `powerpoint` | Handle presentation collaboration notifications |
| **Federated Knowledge** | `federatedknowledgeservice` | Enterprise knowledge base interactions |

## Advanced Usage

### Notification Processing Features

- **Custom Route Priorities**: Configure handler execution order for different notification types
- **Authentication Integration**: Seamless integration with Microsoft 365 authentication flows
- **Rich Context Access**: Access detailed metadata about notification sources and content
- **Flexible Filtering**: Support for wildcard matching and specific application targeting

### Notification Types

The package supports various notification scenarios:
- Document collaboration events (Word, Excel, PowerPoint)
- Email mentions and interactions
- Enterprise knowledge base updates
- Custom application notifications

## Architecture

The notifications package follows a clean architecture pattern:

- **Route Selectors**: Determine which notifications match specific handlers
- **Activity Wrappers**: Strongly-typed wrappers around raw notification data
- **Handler Registry**: Manages registration and execution of notification handlers
- **Channel Filtering**: Intelligent filtering based on Microsoft 365 application context

## Integration with Microsoft Agent 365 SDK

This package works seamlessly with other Microsoft Agent 365 SDK components:

| Package | Integration |
|---------|-------------|
| `microsoft-agents-activity` | Core activity types and protocols |
| `microsoft-agents-hosting-core` | Agent lifecycle and middleware |
| `microsoft-agents-authentication-msal` | Microsoft 365 authentication |
| `microsoft-agents-hosting-teams` | Teams-specific hosting |

## Sample Applications

Check out these working examples:

| Sample | Description | Location |
|--------|-------------|----------|
| **Word Assistant** | Agent that helps with document writing | `samples/word-assistant/` |
| **Excel Analyzer** | Data analysis agent for spreadsheets | `samples/excel-analyzer/` |
| **Email Summarizer** | Automatic email summary agent | `samples/email-summarizer/` |
| **Multi-App Agent** | Handles notifications from all M365 apps | `samples/multi-app-agent/` |

## Requirements

- **Python**: 3.11+
- **Dependencies**:
- `typing-extensions >= 4.0.0`
- `microsoft-agents-activity >= 0.4.0`
- `microsoft-agents-hosting-core >= 0.4.0`
- `pydantic >= 2.0.0`

## Common Use Cases

### Document Collaboration
- Respond to document updates and changes
- Provide writing assistance and suggestions
- Generate document summaries and reviews
- Handle collaborative editing scenarios
## Usage
Comment thread
abdulanu0 marked this conversation as resolved.

### Basic Notification Handler

```python
from microsoft_agents_a365.notifications import AgentNotification, AgentNotificationActivity
from microsoft_agents.activity import ChannelId
from microsoft_agents.hosting.core import TurnContext, TurnState

# Initialize notification handler
agent_notification = AgentNotification(
app=app,
known_subchannels=["email", "word", "excel"],
)

# Register notification handler for specific channel
@agent_notification.on_agent_notification(
channel_id=ChannelId(channel="msteams", sub_channel="email")
)
async def handle_email_notification(
context: TurnContext,
state: TurnState,
notification: AgentNotificationActivity
):
# Process email notification
print(f"Received notification: {notification.notification_type}")
await context.send_activity("Processing your email notification")
```

### Data Analysis Assistant
- Process spreadsheet updates and changes
- Generate insights from data modifications
- Create visualizations and reports
- Assist with data analysis workflows
### Handle Multiple Subchannels

```python
# Handle all notifications for a channel (wildcard)
@agent_notification.on_agent_notification(
channel_id=ChannelId(channel="msteams", sub_channel="*")
)
async def handle_all_notifications(
context: TurnContext,
state: TurnState,
notification: AgentNotificationActivity
):
# Route based on notification type
if notification.notification_type == "email":
await handle_email(context, notification)
elif notification.notification_type == "document":
await handle_document(context, notification)
```

### Email Productivity
- Handle email mentions and notifications
- Draft responses and follow-ups
- Extract action items from conversations
- Manage email-based workflows
## Support

## Quick Links
For issues, questions, or feedback:

📦 [All SDK Packages on PyPI](TODO: Update when packages are published)
📖 [Complete Documentation](https://github.com/microsoft/Agent365/tree/main/python)
💡 [Python Samples Repository](https://github.com/microsoft/Agent365/tree/main/samples)
🐛 [Report Issues](https://github.com/microsoft/Agent365/issues)
🔧 [Microsoft 365 Developer Center](https://developer.microsoft.com/microsoft-365/)
- File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-python/issues) section
- See the [main documentation](../../../README.md) for more information

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License - see the [LICENSE](../../../LICENSE.md) file for details.
Loading
Loading