← Questions

Design personalization memory for a chatbot

0
MicrosoftSystem designLast asked May 2026

An AI system design interview question asked in Microsoft's system design round, last asked May 2026. It tests llm, personalization and memory.

Design how an AI assistant remembers things about each user across conversations and uses them to personalize later answers: preferences, facts about the user, ongoing projects. Conversation histories grow without bound, answers must stay fast, and users must stay in control of what is remembered.

Requirements

  • Functional: extract durable memories from conversations; store them per user; retrieve the relevant ones when answering; update and resolve conflicting facts; let users view, edit and delete memories and turn memory off.
  • Non-functional: little added latency per turn; scales to millions of users with long histories; privacy by default (no cross-user leakage, sensitive data handled carefully); deletion is complete and fast.

Clarifying questions

  • What should be remembered: explicit "remember this" requests only, or inferred facts too?
  • Which kinds of information must never be stored (health, credentials, other people's data)?
  • What latency budget does memory retrieval get per turn?
  • Is there an enterprise version where an admin controls retention?
  • How will we know memory is helping?

What a strong answer covers

  • A memory record (text, type, source conversation, timestamps, confidence, embedding) and a per-user store with both structured and vector indexes.
  • Extraction off the critical path: an async model pass after each conversation proposes candidate memories, filtered for durability and sensitivity.
  • Retrieval at answer time: candidate generation (recency, embedding similarity, type filters), ranking, a small token budget, and placing memories in the prompt clearly marked as user context.
  • Conflicts and updates: newer explicit statements win, superseded memories are kept as history or removed, and contradictions can be confirmed with the user.
  • User control and privacy: a visible memory list, edit and delete that propagate to every index and cache, opt-out, retention limits, encryption, and strict per-user scoping.
  • Evaluation: offline sets of conversations needing a remembered fact, precision of extraction, harmful or wrong-memory rate, and online measures such as fewer repeated explanations.

Follow-ups

  • The user says "I moved to Berlin" months after telling us they live in Paris. What happens in the store and in later answers?
  • A wrong memory keeps steering answers. How would the user, and you, notice?
  • How do you stop a prompt injection in a pasted document from writing a malicious memory?
  • How does the design change for team-shared memory?

Where it's asked

What it tests

llm · personalization · memory

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing