Skip to content

microsoft/teams-ai

Welcome to the Teams AI Library v2 (Docs)

Overview

Teams AI Library v2 represents a fundamental reimagining of how Teams apps and AI agents are built, while maintaining compatibility with existing botframework-based agents. This new version focuses on developer experience, simplified architecture, and enhanced AI capabilities.

For a detailed explanation of the motivations and architectural decisions behind v2, please see our WHY.md document.

Quick start

The Teams CLI makes it easy to bootstrap your first agent. First, install the CLI via NPM:

npm install -g @microsoft/teams.cli

Next, use the CLI to create your agent:

teams new <typescript | csharp | python> quote-agent --template echo

For more information, follow our quickstart guide: C#, Typescript, Python

SDK

Microsoft Teams has a robust developer ecosystem with a broad suite of capabilities, now unified via Teams AI v2. Whether you are building AI-powered agents (TS, C#, Python), Message Extensions (TS, C#, Python), embedded web applications, or Graph, Teams AI v2 has you covered.

Here is a simple example, which responds to incoming messages with information retrieved from Graph.

import { App } from '@microsoft/teams.apps';
import { DevtoolsPlugin } from '@microsoft/teams.dev';
import * as endpoints from '@microsoft/teams.graph-endpoints';

const app = new App({
  plugins: [new DevtoolsPlugin()],
});

// Listen for incoming messages
app.on('message', async ({ userGraph, isSignedIn, send, signin }) => {
  if (!isSignedIn) {
    await signin(); // initiates Entra login flow
    return;
  }
  const me = await userGraph.call(endpoints.me.get); 
  await send(`Hello, ${me.displayName} from Earth!`);
});

// Start your application
(async () => {
  await app.start();
})();

SDK Language Support

This repository contains submodules that point to dedicated repositories for different language implementations of the SDK:

For language-specific bugs or issues, please use the Issues tab in the respective language repository.

Important: v1 to v2 Transition Notice

This repository has transitioned from v1 to v2 as the main branch.

  • The main branch now contains v2 code, which was previously developed on the v2-preview branch.
  • The previous main branch (v1) has been moved to the release/v1 branch. We will continue to provide critical bug fixes and security patches for v1 on this branch.

Documentation

For comprehensive documentation, API references, and examples, visit our documentation site.

About

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published