Teaching an AI assistant to forget a deleted Teams message
Description and use
An AI assistant kept quoting a deleted Microsoft Teams message because its knowledge graph retained the content. A Cognee Teams connector was built to delete threads from the graph when messages are removed, ensuring the assistant no longer references them.
Problem
An AI assistant continued quoting a price from a Microsoft Teams message after the message was deleted, indicating it retained memory of non‑existent content.
Outcome
The connector successfully removes deleted Teams threads from the knowledge graph, ensuring the AI assistant no longer references removed content.
Workflow
- 1. Register an app in Microsoft Entra and grant it ChannelMessage.Read.All and Channel.ReadBasic.All permissions with admin consent.
- 2. Use the Cognee Teams connector to fetch threads from selected teams and channels.
- 3. Each thread becomes a document; edits or deletions rewrite the whole thread.
- 4. The connector tracks changes via message modified timestamps, processing only newer threads.
- 5. Deleted messages are detected by deletedDateTime and removed from the graph and vector store.
- 6. Safety rules prevent accidental deletions on failed requests or empty channel lists.
Evidence
The connector feeds it from Teams channels. You pick the teams, and optionally the channels.
Threads that are deleted are forgotten.
Graph does not drop a deleted message. It keeps it in the list, with deletedDateTime set and an empty body.
I added safety rules because a wrong delete is worse than a missed one: ... A failed request, a 403 or a rate limit never deletes anything.
- Record date: 2026-10-20T07:41:03.916Z