Azure AI Foundry Memory Scope for Conversation Isolation
Short answer
B Set the memory tool scope to {{$conversationId}} to isolate conversation history so it does not persist across separate chat sessions.
Question
You need to ensure that the conversation history does NOT persist across separate sessions.
To what should you set the scope of the memory tool?
Key Takeaways
The trap is confusing 'user session' with 'conversation session'; using {{$conversationId}} ensures strict isolation between distinct chat threads.
Learn how to configure memory scope in Microsoft Foundry agents to prevent conversation history persistence. The correct setting is {{$conversationId}}.
Common mistake: Choosing 'session' because it sounds like 'session-based', but this often shares memory across multiple chats within the same user login window.
Expert Analysis
The scenario involves an Azure AI Foundry agent where the requirement is to prevent conversation history from persisting across separate sessions. This implies that each distinct interaction or 'chat' should start with a clean slate, without accessing data from previous interactions.
In Microsoft Foundry agents, memory scope determines how long and for whom memory is retained. The options provided are:
- Session: Typically refers to the broader user session (e.g., the browser tab or login state). If set to
session, memory might persist as long as the user remains logged in or the tab is open, potentially crossing multiple 'chats' if they occur within the same session. This does not guarantee isolation between separate conversations. - global: Stores memory for all users and all interactions. This clearly violates the requirement.
- {{$userId}}: Ties memory to the specific user. All conversations for that user would share memory, which again violates the requirement for non-persistence across sessions.
- {{$conversationId}}: Ties memory to a specific conversation instance. When a new conversation starts (a 'separate session' in the context of chat apps), it gets a new ID. Therefore, memory from one conversation ID does not bleed into another. This ensures that history does not persist across separate conversations/sessions.
The key distinction here is between a 'user session' (login state) and a 'conversation session' (chat thread). In the context of customer support chat apps, 'separate sessions' usually refers to distinct chat threads. To ensure no history persists between these, memory must be scoped to the conversation identifier.
Comment analysis: One comment argues for session based on a literal interpretation, but this often leads to shared memory within a single browser session. Another comment correctly identifies {{$conversationId}} as the mechanism for isolating memory per chat thread, citing official documentation. The second comment aligns with standard agentic patterns where conversation isolation is achieved via conversation IDs.
Official Reference
https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/memory-usage
This link opens the official vendor documentation in a new tab.
Exam Strategy
When configuring agent memory, always map the scope to the smallest unit of isolation required by the business logic. For chat apps requiring independent threads, use {{$conversationId}}. For user-specific preferences across threads, use {{$userId}}. Avoid 'session' unless you explicitly want memory tied to the runtime environment rather than logical conversations.
Frequently Asked Questions
What is the difference between session and {{$conversationId}} in Foundry memory?
Why not use {{$userId}} for customer support agents?
Community Votes
67% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 3 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 3
-
acon 👍 2 Answered BThis gives each conversation its own memory scope, preventing history from being shared across separate sessions. A literal session value would be a shared static scope. Microsoft Learn (https://learn.microsoft.com/en-us/azure/ai-foundry/agents/how-to/memory-usage)
-
Amelia233 👍 1 Answered AThe memory tool scope should be set to session when you want conversation history to remain available only during the current session and not persist across separate sessions. A. Session ✅ → Memory is limited to the current session. B. {{$conversationId}} ❌ → Ties memory to a specific conversation, but the requirement specifically calls for session-level isolation. C. {{$userId}} ❌ → Allows memory to persist for the same user across sessions. D. Global ❌ → Makes memory available broadly rather than limiting it to one session. Final Answer: A. Session
-
8ac3742 👍 1 Answered Atell about session and conversation(chat) You open ChatGPT or your customer support chat portal (Session starts). You have one chat You click "New Chat" (Conversation 1 ends, Conversation 2 starts). Both happened inside the exact same login Session.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AI-103 Questions
Access 88 questions with complete answers and detailed explanations.
View Full AI-103 Practice Test →