QuestionQ76

VerifiedImplement generative AI and agentic solutions

You have a Microsoft Foundry project containing an agent used for a customer support chat application. The agent uses a memory store together with a memory search tool.

You need to make sure the conversation history does not persist across separate sessions.

What should you set as the scope of the memory tool?

Explanation

In Foundry Agent Service, the memory tool's scope parameter determines which pool of stored memory items a given request can read from and write to. Setting scope to the dynamic {{$conversationId}} variable ties memory items to the unique ID of the current conversation/thread, so each new session (which gets a new conversation ID) cannot see memory captured in a different, earlier conversation. In contrast, scoping to {{$userId}} intentionally keeps the same identity key across sessions so memory persists and personalizes future sessions for that user — the opposite of the requirement — while a static 'session' or 'global' value would create one shared, non-varying bucket used by all calls rather than isolating memory per individual session.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!