Bot doesn’t remember context within the same conversation

Deville Quist 0 Reputation points
2026-11-30T20:07:58.8966667+00:00

I asked the Teams bot to summarize a document, then followed up with a question about one specific section. Even though it was in the same chat and only a few moments later, the bot asked me to upload the document again. I expected it to remember the document and our previous conversation. Is that expected behavior?

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

3 answers

Sort by: Newest
  1. Ashlesha Pawar (Tata Consultancy Services Limited) 730 Reputation points Microsoft External Staff
    2026-12-01T05:12:26.7033333+00:00

    Hi Deville Quist,

    Just to add to the points already mentioned, this is generally related to how conversation context and document references are managed by the bot.

    Even when messages are exchanged within the same Teams chat, the bot does not necessarily retain the uploaded document's contents or make them available to subsequent AI requests automatically.

    A few things worth checking:

    • Conversation history: Ensure previous user messages and bot responses are included in the context sent with each follow-up request.
    • Document persistence: Store the uploaded document's reference or identifier so the bot can access it again without requiring another upload.
    • State management: If you're using Bot Framework, review conversation state management. If you're using Copilot Studio, check how conversation variables and knowledge sources are maintained across turns.
    • Follow-up processing: Make sure the bot can retrieve the relevant document content when a user asks about a specific section, rather than relying only on the previous summary.

    One important distinction: retaining conversation history and retaining access to an uploaded file are two separate things. The bot needs to handle both correctly.

    Could you clarify whether you're using a custom Teams bot built with Bot Framework or an agent developed in Copilot Studio? That would help narrow down the appropriate configuration to investigate.

    Hope this helps!

    Was this answer helpful?

    0 comments No comments

  2. Aetherin 5,080 Reputation points Independent Advisor
    2026-11-30T20:38:46.57+00:00

    Hi @Deville Quist,

    This behavior may be expected depending on how the bot was designed. A custom Teams bot does not automatically retain the uploaded document or the previous conversation context between messages. The developer needs to explicitly store the conversation state and document reference, then retrieve that information when processing follow-up questions.

    For production environments, the bot should use persistent shared storage rather than in-memory storage, as in-memory state can be lost when the bot restarts or when another instance handles the next message. The bot may also need to retain the file reference in OneDrive or SharePoint and retrieve the relevant content again when responding. Please see:

    Could you confirm whether this is a custom bot developed by your organization or a Microsoft/third-party bot? If it is a custom bot, the developer should review its conversation-state storage, file-reference handling, and how previous context is included in each AI request.

    Was this answer helpful?


  3. AI answer

    2026-11-30T20:08:12.4966667+00:00

    Yes. That can be expected behavior.

    Bots are inherently stateless, so they don’t automatically retain prior turn data unless the bot is designed to persist and return that context. In this scenario, the bot likely used the document to answer the first request, but didn’t keep the full fetched result in active context for the follow-up.

    Two documented causes match this behavior:

    1. Partial return of fetched data: if the bot or topic retrieved the full document content, used only part of it to produce the summary, and returned only that summary, later questions about a specific section can’t be answered from context. The system then refetches the data or asks for it again.
    2. Context loss in conversation: even within a longer session, values can fall out of active context, causing the bot to ask again for information it had earlier.

    To avoid this, the bot needs to be designed to:

    1. Return the whole fetched result, not just the immediate answer, so later turns can reuse other parts of the document.
    2. Persist needed values in state or memory for follow-up turns and longer conversations.

    For Bot Framework bots, state management is the mechanism used to track conversation context and remember previous answers. For Copilot Studio agents, memory and context rehydration are the relevant mechanisms.

    So the behavior is not surprising by default; remembering the document across follow-up questions requires explicit state, memory, or context-handling design in the bot.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.