esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

Personal Memory With Privacy

How an AI assistant can remember a person across chats while keeping that memory private, for your AI interview.

In short

Save only a few stable facts per person, keep each person's memory apart, let them view and delete it, and make code, not the model, decide who can read what.

12 min readAdvancedOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

A personal memory is a short list of facts an assistant saves about one person and reads back in later chats. The privacy part is simple to say and hard to build. Save only stable facts, keep each person's memory apart, let them see and delete it, and have code, not the model, decide who gets read. I would also test it by trying to pull another person's notes out.

What is personal memory with privacy, in plain words?

A personal memory is a short list of facts an assistant saves about one person and reads back later: the way they like replies, the project they are on, the branch they bank at. Without it, every chat starts cold. With it, the assistant feels like it knows you, and that is exactly why it needs care.

Think of a hotel concierge. A good one remembers that you want a quiet room and a late checkout. They keep that note in the front office file, not on a sticky note by the lobby door, and you can ask to read it or have it torn up. An assistant needs the same habits: keep the file small, lock it per guest, and let the guest read it.

A real case: a benefits assistant at a mid-size insurer remembers that a member prefers WhatsApp and that her claim is with the Pune office. Those facts help her. The same chat also holds her medical details, and those should never be saved.

Key words

Memory store
The database of saved facts, with each row tied to one person.
Scope
Whose facts a read can touch: one person, or one project.
Retention
How long a saved fact is kept before it expires and is removed.
Temporary chat
A chat that reads and writes no memory at all.
Model
The AI that reads the chat and writes the reply.

How does a memory get saved and read back?

Four steps, and the model does only one of them. The model proposes a fact worth keeping. Code decides whether it is saved, under which person, and who may read it later. When the next chat starts, the app fetches only that person's rows and hands them to the model.

How a memory is saved and read back

The person's chat

what they say in this session

AI suggests a fact

a candidate, not yet saved

Code checks it

rules in code: stable, allowed?

Memory store

Rows keyed by person

one row set per person

Expiry clock

old facts drop out

Model

sees only this person's rows

  1. 1The person's words reach the model, which proposes any facts worth keeping.
  2. 2The candidate goes to code first, not straight into storage.
  3. 3Code saves it only if it passes the check, under that person's ID.
  4. 4For the next chat, code fetches only that person's rows for the model.
The model suggests and code decides, on both the save and the read. Rows are kept per person, so a read is filtered before the model sees anything. Old facts expire unless the person confirms them again.

Save less. Keep stable facts such as a preferred channel, a working language or a project name. Skip health, money, passwords and anything the person would not expect to be kept. Store a fact like "Prefers WhatsApp replies in the evening". Never store a diagnosis.

Take the benefits assistant for 40,000 members. Each member has three or four saved facts. A fact not confirmed in 12 months expires, so an old claim office drops out by itself. When a member asks to see her file, the app returns only her rows.

Here is the idea in plain Python. No model is involved: the marked lines decide what is saved and what is read back. The sensitive flag has to be set by a rule in your code, never by the model's own say-so.

Python
# A simplified memory store: facts are kept per member, and every read is filtered in code.
STORE = {}

def remember(member_id, fact, sensitive=False):
    if sensitive:
        return "REFUSED: sensitive, not stored"
    STORE.setdefault(member_id, []).append(fact)
    return "SAVED for " + member_id

def recall(member_id):
    # The filter is code, so no prompt can ask for another member's rows.
    return STORE.get(member_id, [])

def forget(member_id):
    STORE.pop(member_id, None)
    return "DELETED " + member_id

print(remember("member-417", "Prefers WhatsApp replies in the evening"))
print(remember("member-417", "Claim is with the Pune office"))
print(remember("member-417", "Mentioned a diagnosis", sensitive=True))
print(recall("member-417"))
print(recall("member-902"))
print(forget("member-417"))
print(recall("member-417"))

Output

SAVED for member-417
SAVED for member-417
REFUSED: sensitive, not stored
['Prefers WhatsApp replies in the evening', 'Claim is with the Pune office']
[]
DELETED member-417
[]

Tip

Say the rule in one breath: the model proposes, code saves and code reads. A model that can read any row can be talked into leaking one.

What controls do people need, and what do the big assistants offer?

In its 2025 memory announcement, Anthropic says Team and Enterprise users get a separate memory for each project, full control to view and edit what Claude remembers, and incognito chat that does not save to memory. Anthropic describes the project split as a way to keep sensitive work contained. Enterprise admins can turn memory off for a whole organisation.

OpenAI's help page separates two steps. Turning Memory off does not delete past chats. A separate "Delete and turn off memory" step removes the remembered information shown in the summary. OpenAI also offers Temporary Chat for conversations that do not use or update memory.

  • “Delete and turn off memory deletes the remembered information shown in the summary and turns Memory off.”

    OpenAI Help Center

  • “You control where and how the data is stored through your own infrastructure.”

    Anthropic, memory tool docs

If you build your own assistant, the storage is yours. Anthropic's memory tool works this way: Claude asks for a file operation, and your application runs it. Its example maps the memory path onto a per-user directory or keys in a database. In our reading, the isolation then sits in your storage layer.

Tip

A common wrong answer is that turning memory off deletes it. Check whether the product has a separate delete step, and test that it works.

What goes wrong with a shared memory store?

Two failures matter most. The first is a leak between people. If a read does not filter by person, one member's notes can come back for another. OWASP lists memory among the live context a model can disclose.

How one member's notes could reach another

Member B asks

a normal question about a claim

App runs the read

the filter decides what comes back

Shared index

Search all members

no member filter applied

Keyed read

Filter by member B

code adds the ID

B sees A's notes

a privacy breach

Only B's facts

nothing from A is returned

  1. 1Member B's question is ordinary and harmless.
  2. 2The bad path searches one index that holds every member's notes.
  3. 3The good path adds Member B's ID as a filter, in code.
  4. 4The bad path returns Member A's notes to Member B.
  5. 5The good path returns only Member B's own facts.
One read, two paths. A shared index with no filter can return anyone's notes. A filter added in code limits the read to the person asking, so the second path cannot leak another member's facts.

RAG means the app looks up documents and pastes the relevant parts into the prompt.

  • “The model discloses live context (system prompt, RAG chunks, files, tool outputs, memory, or another session's data), often because summarization, translation, or extraction surfaces more than was asked, including visually-redacted spans.”

    OWASP, LLM02:2026

  • “A prompt-injection vulnerability occurs when input to a large language model (LLM), whether direct user input, retrieved content, tool output, image, audio, or video content, intermediate reasoning, or persistent memory, alters the model's behavior in ways the application developer did not intend.”

    OWASP, LLM01:2026

The second is poisoning. A hidden line in a web page or email gets saved as if it were a fact, and then every later chat reads it back. OWASP's definition of prompt injection already counts persistent memory as an input the model can be steered through. The fix is a gate: fetched text may never write to memory without a check in code.

Keep the prompt out of the security story. A rule such as "never reveal other members' details" helps, but it cannot stop a read that returns the wrong rows.

How would you let someone delete one memory and prove it is gone?

  1. 1

    Delete the row, not just hide it

    Remove the stored fact by its ID, so the app can no longer read it.

  2. 2

    Clear the copies

    Remove it from caches, from search indexes (the lookup tables that find text fast), and from any embeddings made from it (number lists that stand for the meaning of text, used for search).

  3. 3

    Log the deletion without the fact

    Keep a log line with the time and the ID, never the text that was deleted.

  4. 4

    Set the backup expiry

    Backups age out on a set schedule, and you tell the person when that happens.

  5. 5

    Test from the user's side

    Ask in a new chat and check that the store and the index return nothing.

For high-sensitivity data, OWASP gives a clear direction: "Isolate per-tenant indexes for high-sensitivity workloads." Separate indexes make a missed filter fail smaller.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: facts saved per person and read back later.
  • Privacy starts with saving less: stable facts only, with expiry.
  • Every read is filtered by person in code, never by the prompt.
  • Users can view, edit, delete, and use a temporary chat.
  • Leaks and poisoning are named, each with its own fix.
  • Deletion covers the store, indexes and copies, and is tested.

Common traps

  • Trap"Tell the model to keep memories private."

    BetterA prompt is a partial control. Filter by person in code, so the model never receives other rows.

  • Trap"Turning memory off deletes it."

    BetterNot always. Check for a separate delete step, and test that it works.

  • Trap"Store everything, it may help later."

    BetterEvery stored fact is a leak risk and a retention duty. Save only stable facts, with expiry.

Can you spot the leak?

Spot the leak

Which design lets one member's notes reach another member?

Quick check

A claims assistant at an insurer remembers each member's preferred channel and open claim office. Which change protects privacy most?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q163Short-term vs long-term agent memory?12 min
  2. Q191What is memory poisoning?12 min
  3. Q199How do agents use files as memory?11 min
  4. Q097What is structured note-taking (external memory)?12 min
  5. Q201What is prompt injection?12 min
  6. Q459GDPR basics for AI apps?12 min

Learn it in depth

Last updated on 27 November 2026

Building an assistant that remembers its users?

I design and build AI assistants with memory that stays scoped, deletable and checked in code. Book a short call and tell me what it should remember, and what it must never keep.