BUG/TEAMS Integration : Maintain Chat Session Context and Prevent New Thread on Each Message
When using Chainlit’s Microsoft Teams integration, each new user message currently reloads the chat and starts a new thread, causing a loss of conversation context. This makes it difficult to build conversational bots that rely on persistent sessions and memory.
I would be really good to have:
- The ability to maintain a chat session within an existing Teams conversation, so that context is preserved across messages.
- A memory feature that allows the bot to remember previous interactions within the same Teams chat.
- Documentation or guidance on how a new session could be intentionally triggered (e.g., via a command or specific message), rather than starting a new session with every new message by default.
Questions:
- Is there a recommended approach for session management and memory persistence with Teams integration?
- How could developers override the current new-thread behavior to implement custom session logic?
- Would it be possible to provide an example of how to programmatically start or reset a session when needed?
Any support, examples, or roadmap updates on this would be greatly appreciated!
#1426
Is this happening in group chats or dms? I think this is pretty easy to fix but I don't have a teams bot setup on my end
It is happening in both ways, both dms and adding the app in a griup chat. Is there any more config to add to the chainlit app aside from the proper Teams envs?
@willydouhard Is cl.user_session available when chatting through teams? And is there an alternative for fetch_slack_message_history for MS Teams?
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
I think I am faced with the same problem, but in slack. When I output print(f"[Chainlit] Session ID: {cl.user_session.get('id')}") I get a new id for every interaction, which means I loose my user state.