Welcome to the Teams AI Library v2 (Docs)
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.
The SDK code for each language are in their own individual repos:
The Teams CLI makes it easy to bootstrap your first agent. First, install the CLI via NPM:
npm install -g @microsoft/teams.cliNext, use the CLI to create your agent:
npx @microsoft/teams.cli new <typescript | csharp | python> quote-agent --template echoFor more information, follow our quickstart guide: C#, Typescript, Python
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();
})();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.
This repository has transitioned from v1 to v2 as the main branch.
- The
mainbranch now contains v2 code, which was previously developed on thev2-previewbranch. - The previous
mainbranch (v1) has been moved to therelease/v1branch. We will continue to provide critical bug fixes and security patches for v1 on this branch.
For comprehensive documentation, API references, and examples, visit our documentation site.