Courseiva

AI-102 Implement agentic AI solutions Practice Question

A developer is creating an agent in Azure AI Foundry Agent Service and wants the agent to remember a user's stated preferences across separate conversations that occur days apart. The agent definition already includes a model deployment and instructions. What should the developer add to persist this context?

⚠ Common exam trap

A common mix-up: candidates confuse a bigger context window with persistent memory, when context length is per-request and memory must be stored externally.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Attach a Foundry memory store to the agent so it can save and retrieve user facts across threads

Cross-conversation memory requires a durable, user-scoped store outside the model and outside static agent configuration. Attaching a Foundry memory store lets the agent save facts during one thread and retrieve them in later threads for the same user. A larger context window, code interpreter session files, and the instructions field all fail because they are either ephemeral, shared, or scoped to a single run.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Increase the model's context window by selecting a larger deployment

    Why it's wrong here

    A larger context window only expands how much text the model can consider in a single request; it does not persist anything between conversations. Once a conversation ends, its tokens are not retained for future runs. Remembering preferences across days requires a storage mechanism outside the model, so changing the deployment size does not meet the requirement.

  • ✓

    Attach a Foundry memory store to the agent so it can save and retrieve user facts across threads

    Why this is correct

    A memory store in Azure AI Foundry Agent Service is designed to persist user-level facts and preferences beyond a single thread. The agent can write memories during one conversation and retrieve them in later conversations, even days apart, as long as the same user identity is used. This directly provides the cross-session continuity the scenario requires.

  • ✗

    Enable the code interpreter tool so the agent can write preferences to a file

    Why it's wrong here

    Code interpreter sessions are scoped to a run and are not a durable cross-conversation store. Files created in one session are not guaranteed to be available days later in a separate conversation. Using it as a memory layer would be fragile and unsupported for this purpose, so it does not satisfy the requirement to persist user preferences across sessions.

  • ✗

    Add the preferences to the agent's instructions field in the agent definition

    Why it's wrong here

    Instructions are static configuration shared by all users of the agent, not per-user state. Writing one user's preferences there would leak them to every other user and could not capture preferences learned during conversations. The scenario needs dynamic, per-user persistence across sessions, which instructions cannot provide.

About these practice questions

Courseiva writes every AI-102 question from scratch — 761 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.