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:
- 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. - 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.
- 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.
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