You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Essential techniques for managing session state, handling updates, and ensuring reliable performance when deploying Copilot Studio agents to Microsoft Teams.
7
+
description: Essential techniques for managing session state, handling updates, and ensuring reliable performance when deploying Copilot Studio Agents to Microsoft Teams.
8
8
author: raemone
9
+
image:
10
+
path: /assets/posts/teams-deployment/header.jpeg
11
+
alt: "A sleek gradient in Microsoft Teams brand colors (purple and blue) with subtle circuit patterns to suggest technology"
12
+
no_bg: true
9
13
---
10
14
11
-
Deploying a Copilot Studio agent to Microsoft Teams introduces unique challenges that don't exist in web chat deployments. Sessions persist indefinitely, conversation start events don't fire automatically, and updates can be cached. Understanding these nuances is critical for delivering a reliable user experience.
15
+
Deploying a Copilot Studio Agent to Microsoft Teams introduces unique challenges that don't exist in web chat deployments. Sessions persist indefinitely, conversation start events don't fire automatically, and updates can be cached (meaning end-users might not always interact with the latest version). Understanding these nuances is critical for delivering a reliable user experience.
12
16
13
17
## Why Teams Deployment is Different
14
18
15
-
-Sessions persist across days or weeks without automatic reset
19
+
-Conversation persist across days without automatic reset, this is different from sessions which are an analytical concept and are calculated each time inactivity is triggered
16
20
- Conversation Start events don't trigger on initial load
17
21
- Stale context and expired tokens can cause unexpected behavior
18
22
- Updates may not propagate immediately due to caching
@@ -22,9 +26,9 @@ Deploying a Copilot Studio agent to Microsoft Teams introduces unique challenges
22
26
23
27
## The Session State Challenge
24
28
25
-
Unlike web chat where each session starts fresh, Teams conversations maintain state indefinitely. This persistence is powerful for continuity but creates problems:
29
+
Unlike [WebChat](https://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-connect-bot-to-web-channels?tabs=preview#add-your-agent-to-your-website)where each session starts fresh, Teams maintain state through a single conversation. This persistence is powerful for continuity but creates problems:
26
30
27
-
-**Stale Context**: Old conversation data can confuse the AI
31
+
-**Stale Context**: Conversation history is not cleared automatically and can confuse the LLM (we use the last 10 turns unless we clear the history)
28
32
-**Token Expiration**: Connector authentication expires during long sessions
29
33
-**Context Limits**: Accumulated history can hit token limits
30
34
-**Update Delays**: Users continue running old bot logic after updates
@@ -80,7 +84,7 @@ This special command forces a complete conversation reset:
80
84
- Clears all conversation state
81
85
- Removes cached connector information
82
86
- Re-authenticates connectors
83
-
- Loads latest agent version
87
+
- Loads latest Agent version
84
88
85
89
**When to use:**
86
90
- Bot seems "stuck" with outdated information
@@ -94,7 +98,7 @@ This special command forces a complete conversation reset:
94
98
95
99
**Query rewrite** is a key step in the knowledge pipeline of Copilot Studio. When a user asks a question, the system doesn’t send the raw text directly to the search indexes. Instead, it rewrites the query to optimize it for retrieval across multiple knowledge sources (lexical and semantic). This process ensures better relevance and accuracy of search results.
96
100
97
-
Enable the **OnKnowledgeRequested** trigger to reveal what the agent is actually searching for:
101
+
Enable the **OnKnowledgeRequested** trigger to reveal what the Agent is actually searching for:
98
102
99
103
**Implementation:**
100
104
1. Enable OnKnowledgeRequested trigger (via YAML as this is not yet in the UI)
@@ -115,7 +119,7 @@ This provides read-only access to the refined search query (query rewrite) that
115
119
Example: User asks "How do I reset my password?" and bot displays "(debug) Searching HR FAQ for 'reset password'".
0 commit comments