What to Remember, What to Reveal: Privacy-Aware Memory for Conversational Agents

Wenjie Wang, Wenhe Si, Xinyue Xu, Yue XuNeurIPS 2026

TL;DR

Giving AI agents long-term memory makes them genuinely helpful personal assistants, right up until they leak your home address while recommending a pizza place. This paper introduces SP-Mem, a memory architecture that locks exact sensitive details in an isolated vault while leaving useful, sanitized context in searchable memory—retrieving the real data only when a task strictly requires it and you explicitly say "yes."

What Problem Does This Paper Address?

To move beyond Groundhog Day-style interactions, modern LLM agents use external memory databases to remember who you are across sessions. However, current memory frameworks optimize almost exclusively for utility: they eagerly scrape your conversations for facts and dump everything into a single searchable pool.

This creates a sharp privacy-utility dilemma. If you ask an agent for a dinner spot based on your spicy food preference, an indiscriminate memory retrieval might also pull—and expose—your exact home address. Yet, you cannot just permanently delete or mask all Personally Identifiable Information (PII) on ingestion, because tomorrow you might actually need the agent to fill out a medical or tax form. Instead of treating privacy as a one-off prompt filter, memory systems need to govern the entire lifecycle of sensitive data: how it is written, stored, and conditionally revealed.

Methods

The authors propose Sanitized Privacy-Mapped Memory (SP-Mem), which decouples general memory utility from exact private-value exposure across three stages:

Figure 1: Overview of the privacy-aware conversational agent framework. The system contains three stages: privacy-aware memory writing, partitioned memory storage, and query-time privacy-aware reasoning. Private values are sanitized before storage and are only hydrated at inference time when the task requires them and the user grants consent.
  1. Privacy-Aware Memory Writing: Building on standard hybrid memory designs, SP-Mem extracts both natural-language facts (stored in a vector database for broad semantic search) and structured entity-relation triplets (stored in a graph database). What's new is how it intercepts PII: rather than using generic [REDACTED] tags that destroy context, SP-Mem applies type-specific sanitization—like alias substitution ([email protected] $\rightarrow$ [email protected]), numerical bucketing, suffix-preserving masking, or LLM generalization.
  2. Partitioned Storage: Non-private facts and sanitized entries go into general searchable memory. Meanwhile, the exact raw PII is locked inside an isolated Protected Private Store, linked to its sanitized counterpart only via cryptographic hashes or UUIDs in a Privacy Mapping Layer.
  3. Query-Time Reasoning & Gated Retrieval: When a new query arrives, an analyzer checks if exact private data is actually required. If not, the agent only searches the sanitized memory. If exact PII is needed, the system triggers a consent check via a trusted UI/API. Only when granted does it "hydrate" the sanitized placeholders with exact values from the vault; if denied, it gracefully falls back to sanitized context.

Datasets

Existing benchmarks test personalization or privacy leakage in isolation, and real-world datasets are usually pre-anonymized. To bridge this gap, the authors built a new synthetic Privacy-Aware Memory Benchmark spanning four domains: finance, medical, education, and mental support.

Figure 3: Overview of the benchmark construction pipeline.

They generated 1,000 coherent user profiles containing both 37 fine-grained PII types and 18 non-private preference dimensions, yielding a massive pool of historical dialogues and scenario-grounded queries. For evaluation, they sampled 100 users—constructing memories from 2,100 multi-turn history dialogues and testing across 5,400 queries annotated by whether they require preferences, private data, or both, alongside explicit user consent flags (allowed vs. denied).

Key Insights and Ideas

  • Less context is better for personalization: Stuffing a user's entire chat history into the prompt (Full-context) gives an LLM all the facts, yet SP-Mem consistently beat it on personalization quality. Why? Unrestricted history dilutes the model's attention, whereas retrieving concise, structured graph and vector memories keeps the LLM focused on relevant user signals.
  • Smart sanitization preserves utility under denial: When users deny access to their private data, naive [PRIVATE] placeholders cripple task completion. SP-Mem’s type-specific sanitization (like keeping numerical buckets or generalized categories) preserves enough semantic scaffolding for the agent to still give helpful answers without ever touching the raw PII.
  • Vector and graph memories do different jobs: Ablation studies show the two branches aren't redundant—graph triplets drive major gains in preference personalization, while vector facts supply the broader semantic context needed for general task completion.

Key Results

Evaluated across four LLM backbones (GPT-5.2-Chat, Llama-3.1-8B, DeepSeek-V3.2, and Qwen3-14B) against Full-context and leading memory baselines (Zep, Mem0, MemOS):

  • Near-perfect gatekeeping: During memory writing, SP-Mem identified private entities with 99.6% accuracy and 99.2% recall. At query time, it achieved 1.00 precision (and 0.84–0.92 recall) in requesting permission—meaning zero false-alarm consent pop-ups.
  • Drastic reduction in leaks: On preference-only tasks where private data has no business appearing, Full-context leaked exact PII in 16.00% of responses; SP-Mem slashed this Unnecessary Privacy Usage rate to 0.33% (and kept it around ~1.1–1.2% even on adversarial/denied tasks).
  • Superior response quality: Using GPT-4.1 as a pairwise judge, SP-Mem achieved >85% win-tie rates on most allowed-access tasks against memory baselines, and >87% win-tie rates across all baselines when privacy consent was denied.
  • Token efficiency: SP-Mem required only 26–31% of the inference tokens used by Full-context prompting.

Limitations and Future Work

Because real-world datasets lack ground-truth PII annotations, the evaluation relies on a controlled, role-play-generated synthetic benchmark; the authors note that testing SP-Mem in messy, real-world human interactions is an essential next step. Additionally, the current architecture treats privacy categories uniformly across users, leaving room for future systems to learn finer-grained, user-specific privacy boundaries. Finally, SP-Mem’s security guarantees assume that the underlying storage vault, mapping table, and UI/API consent mechanisms are trusted infrastructure outside the reach of conversational prompt injections.

Summary updated

Abstract

Long-term memory enables personalized conversational agents to retain user information across sessions. However, existing memory architectures primarily optimize for utility but neglect the risks of storing and reusing private attributes such as personally identifiable information (PII) unnecessarily. Dealing with privacy risk in personalized memory is challenging as simply removing sensitive values would undermine the utility of the memory system. Therefore, privacy protection for memory agents must govern the full life-cycle of sensitive values rather than just sanitizing individual records. To fill this research gap, we introduce $\textbf{S}$anitized $\textbf{P}$rivacy-$\textbf{M}$apped M$\textbf{em}$ory (SP-Mem), a privacy-aware memory architecture that decouples memory utility from exact private-value exposure. SP-Mem provides full life-cycle privacy-related design including determining how to identify and separate sensitive information from raw user inputs, how to store sanitized content and exact private values in isolated structures, and how to selectively retrieve values based on the task requirement and user consent. We further introduce a privacy-aware memory benchmark that jointly assesses response quality, privacy behavior, and inference cost. Extensive experiments across multiple LLM-based agents show that SP-Mem achieves stronger personalization while reducing unnecessary privacy exposure. Code and data are available at https://github.com/Jensassss/SP-Mem.
BibTeX
@inproceedings{wang2026what,
  author = {Wenjie Wang and Wenhe Si and Xinyue Xu and Yue Xu},
  title = {{What to Remember, What to Reveal: Privacy-Aware Memory for Conversational Agents}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=mLdUy1WYEJ},
}
Figure