Microsoft Teams
Connect Microsoft Teams to Squid to enable AI-powered messaging
The Teams connector's functionality
The Teams connector currently supports:
- Searching conversations across teams and channels using AI-powered knowledge base search.
- By providing AI agents with these capabilities, users can ask the AI agent to search for relevant conversations, and the agent will retrieve intelligent results.
- Users may message the AI agent from Teams (via @mentions or direct messages), and the Teams connector will relay the agent's response directly within Teams.
- Reading all conversations from teams and channels into a knowledge base to enable users to ask the AI agent for intelligent searches or summaries.
- The connector currently only supports "Single Tenant" application setups, not "Multitenant". If you need support for multitenant, let us know!
Configuring the Teams connector
Squid connects to a Microsoft Teams application (via Azure App Registration) to read messages and interact with your Teams workspace.
Creating a Teams application and Azure App Registration
- Navigate to the Azure Portal and go to App registrations.
- Click New registration and provide a meaningful app name.
- Under Supported account types, select Single Tenant.
- After creation, note down the Application (client) ID and Directory (tenant) ID.
- Go to Certificates & secrets and create a new client secret. Save this value securely as it won't be shown again.
- Go to API permissions and add the necessary Microsoft Graph permissions:
Team.ReadBasic.All- To read team informationChannel.ReadBasic.All- To read channel informationChannelMessage.Read.All- To read messages from channelsChat.Read.All- To read chat messages (if supporting DMs)
- Grant admin consent for these permissions.
Adding the Teams connector to your Squid application
-
Navigate to the Squid Console and select the Connectors tab.
-
Switch to the Available Connectors tab and add a Microsoft Teams connector.
-
The configuration details can be found from your Azure App Registration:
Connector ID: A meaningful string that uniquely identifies the connector in the code. Note this ID because you will need it later.
Client ID: The Application (client) ID from your Azure App Registration, which can be found on the Overview tab.
Tenant ID: The Directory (tenant) ID from your Azure App Registration, which can be found on the Overview tab.
Client Secret: The client secret value you created in the Certificates & secrets section. This is used to authenticate requests to the Microsoft Graph API.
Index Channels: Whether Squid should read all messages (from the teams and channels the bot has access to) to offer intelligent searches and summaries.
Message History Limit: When messaging Squid via Teams, Squid will read this many prior messages to provide itself enough context to best answer the user.
Create a corresponding AI Agent to use with Teams
- Navigate to the Squid Console and select the Agent Studio tab.
- Click Create New Agent and create the agent. Note the Agent ID because we will need it later.
- On the new agent's Overview tab, click Add Abilities and expand the Microsoft Teams entry to add the Teams connector you just created.
Creating a Teams Bot (for interactive messaging)
- Navigate to the Azure Portal and search for Azure Bot.
- Create a new Azure Bot resource.
- Set Type of App to Single Tenant.
- Link it to your App Registration created above by selecting Use existing app registration.
- Create the bot.
- Get the Messaging endpoint URL from Squid.
- Navigate to the Squid Console.
- Select the Backend tab on the sidebar.
- Select the Webhooks tab.
- Copy the URL for the
teamsNotificationwebhook, which should look likehttps://{your-app-id}.{your-region}.squid.cloud:8001/webhooks/teamsNotification - Append this to the URL
?integrationId={your-teams-connector-id}&agentId={your-squid-agent-id}so that the final URL looks like:https://{your-app-id}.{your-region}.squid.cloud:8001/webhooks/teamsNotification?integrationId={your-teams-connector-id}&agentId={your-squid-agent-id}
- Go to your newly-created Azure Bot and navigate to Settings → Configuration.
- Copy your Squid webhook URL into the Messaging endpoint field.
- Navigate to Settings → Channels, find Microsoft Teams from the Available Channels and add it to the bot.
Create app package and upload to Teams
-
Create a Teams app package, which is a ZIP file containing three files:
manifest.json,color.png, andoutline.png.- You may start with this manifest.json and replace all occurences of
YOUR_APPLICATION_CLIENT_IDwith your Application (client) ID. - The PNG icons are also available: color.png and outline.png
- Just create a ZIP file with these three files at the top level.
- You may start with this manifest.json and replace all occurences of
-
Upload to Teams. You have two options:
Option A: Upload via Teams Client
- Open Microsoft Teams
- Go to Apps → Manage your apps
- Click Upload an app → Upload a custom app
- Select your ZIP file.
- Click Add to install in your organization.
Option B: Upload via Teams Admin Center
- Go to Teams Admin Center → Teams apps → Manage apps
- Click Upload new app
- Select your ZIP file.
- Configure app settings and permissions as needed.
Using the Teams connector in your application
There are three ways to use the Teams connector in your application:
-
Using the Agent Studio: If you are using the Agent Studio to create your AI agent, you can add the Teams connector by clicking the Add Abilities button and adding the Microsoft Teams ability. Learn more about abilities here. After adding the ability, you can ask your agent to search Teams messages in the Test Agent tab. Note: please allow a couple of hours for Squid to index the Teams messages.
Example messages:
Search Teams for conversations about the product launchShow me all discussions in the Engineering team about API designFind messages in the Finance channel about budget planning
-
Using the Squid SDK: If you are using the Squid SDK to create your AI agent, you can use the
squid.ai().agent('AGENT_ID').ask()function to chat with your agent. Learn more here. Use the Teams connector by adding it in theconnectedIntegrationsoption of theask()function.
await this.squid.ai().agent('AGENT_ID').ask('Search Teams for discussions about the new feature', {
connectedIntegrations: [{
integrationId: 'TEAMS_CONNECTOR_ID',
integrationType: 'teams',
description: 'Call this connector to search Microsoft Teams messages',
}],
});
- Using the NPM package: If you use
@squidcloud/teams-client, you can:
// Initialize the client.
const teamsClient = SquidTeamsClient(this.squid, 'TEAMS_CONNECTOR_ID');
// Search for messages related to your query.
await teamsClient.searchMessages({
teamNames: 'Engineering,Product',
channelNames: 'general,announcements',
prompt: 'API design discussions'
});