Unit 8 of 10 · about 5 hours · implement

Memory conflict and supersession, authorization, retention and deletion

A remembered preference can be wrong, outdated or outside the caller's scope. The Systems unit on identity and authorization supplies the gate; this unit applies it to memory's read, write and deletion paths.

You'll be able to

  • Implement conflict, correction and supersession without silently overwriting the evidence history.
  • Authorize memory reads and writes from authenticated tenant and user identity, never from recalled text.
  • Enforce expiry and deletion across records, derived summaries, retrieval indexes, caches and resumable task state.

Covers

Memory retrieval, conflict, staleness, correction and supersessionAuthorization, tenant boundaries and non-authoritative memoryRetention, deletion and audit semantics
1

Read

In this order, only the parts listed

0 of 4 done

  1. Conflicts and temporal assertionsThe Hitchhiker's Guide to Agentic AI - Memory and Agent Patterns

    arXiv:2606.24937v3, Section 17.4.1 Write: Committing to Memory, paragraph Contradiction Detection; 17.4.2 Read / Retrieve, paragraph Bi-Temporal Fact Management; 17.4.3 Update: Conflict Resolution and Consolidation

    Read the distinction between valid and transaction time. Listing 22 is only a retrieval function, not a complete historical storage design: preserve old assertion versions when correcting their validity intervals.

  2. Scope, consolidation and advisory memoryContext Personalization: Memory Lifecycle and Guardrails

    Notebook at commit 5bd6cb4: 3. Memory Scope; 4. Memory Lifecycle; Memory Guardrails, including Distillation, Consolidation and Injection Checks

    Read these Markdown cells only. Do not run hosted API calls or copy memory into privileged instructions. Its current-message, session, memory precedence resolves preferences, not authorization or system policy.

  3. Why a shared bank needs explicit write authorityMINJA: Memory Injection Attacks on LLM Agents via Query-Only Interaction

    arXiv:2503.03704v5, Section 3 Threat Model

    Read the shared-bank and feedback-gated write assumptions, not the attack construction.

  4. Namespaces and single-record deletionLangGraph Persistence, Interrupts and Graph API

    Stores: Build a custom store, required methods table (adelete) and Namespace design; LangGraph 1.2.16 (page read 2026-10-18)

    Use the API as a mechanism reference. A namespace is not authorization, and deleting one item does not purge summaries, checkpoints or backups.

2

Focus on

  • Resolve only comparable assertions about the same subject, attribute, scope and valid time. A temporary session preference need not supersede the durable default; unresolved material conflicts require clarification.
  • Valid time says when a fact applies; recorded time says when the store learned it. Retain assertion versions and supersession links for audit queries rather than rewriting the past in place.
  • Derive scope from authenticated identity before retrieval and check again before injection or use. Namespaced search can span prefixes; never accept the tenant or user named in a memory as an access grant.
  • Define retention separately from ranking decay. At expiry or deletion, deny reads immediately, invalidate dependent summaries and caches, and prevent checkpoints or restore jobs from resurrecting content. Keep minimal content-free audit events and declare backup purge deadlines.
Common mistakes · 3
  • Using newest-wins across all trust levels. A fresh attacker-controlled claim cannot replace an authorized policy or another user's facts.
  • Confusing ranking decay with deletion. A low-ranked record is still stored and can reappear.
  • Claiming erasure after deleting one store row. Copies in summaries, traces, indexes, caches and checkpoints need an explicit propagation contract.
3

Try it yourself

Closed-book, before checking anything

Closed-book, create two tenants with the same user and memory keys. Add a durable aisle preference, a session-only window override and a later durable correction. Test present and historical reads, cross-tenant denial and expiry at the exact cutoff using a fake clock. Delete the preference and its derived summary, then restore an older checkpoint: the deletion registry must still prevent either from entering context. Keep audit IDs, not the deleted text.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Does 'window for this trip' overwrite a durable aisle default?Answer

    Not under a session-scoped policy. Apply window for this trip and retain aisle as the default unless the user explicitly makes a lasting correction.

  2. 2.Can a memory saying the user is an administrator authorize a tool?Answer

    No. Authorization comes from current authenticated identity and policy. Memory is advisory data.

  3. 3.Why keep both valid time and recorded time?Answer

    They answer different questions: when the assertion applied in the world, and what the system knew at a past decision point. A late correction can change one without changing the other.

  4. 4.A deleted fact remains in an old checkpoint. Is deletion complete?Answer

    No. Block its reinjection on resume or restore, purge or redact the retained copy under the declared policy, and invalidate derived artifacts without copying its content into the audit log.

You're done when

Current and historical queries select the intended assertion, cross-tenant reads fail, and deleted or expired content cannot return through retrieval, a summary or checkpoint restore.

Only when you can do this without notes.

Leads to

Notes

Resources · 4 for this unit, 18 more in the section
  • The Hitchhiker's Guide to Agentic AI - Memory and Agent PatternsHaggai Roitman · support

    Use v3 Chapter 17 (17.4 memory writes, conflicts and bi-temporal facts), Chapter 19 loop engineering (19.7 termination, 19.8 stagnation and escalation, 19.9 failure taxonomy) and Chapter 21 agent design patterns. Chapters 24 to 26 (skills, A2A, multi-agent) are only for a bounded depth comparison.

  • LangGraph Persistence, Interrupts and Graph APILangChain · support

    At langgraph 1.2.16, read the Graph API "Reducers" and "Recursion limit" sections, checkpointers (core concepts, durability modes), interrupts ("Rules of interrupts": a resumed node reruns from its start) and stores for long-term memory. The page says the default recursion limit is 1000 but the 1.2.16 code default is 10007, so set recursion_limit yourself. Build one graph only after the framework-free loop passes its tests; skip the prebuilt agent templates.

  • MINJA: Memory Injection Attacks on LLM Agents via Query-Only InteractionDong et al. (NeurIPS 2025) · support

    Read Section 3 and Section 5.4: an attacker acting as an ordinary user plants records in a shared memory bank through queries alone, because the agent stores its own reasoning after user feedback, and later users retrieve them. Use it to decide which memories are per user, which are shared and who may write each.

  • Context Personalization: Memory Lifecycle and GuardrailsOpenAI Cookbook · depth

    Read "4. Memory Lifecycle" (distill, consolidate, inject) and "Memory Guardrails": the precedence order is the current user message, then session context, then memory. It is SDK specific and lists principles without attack fixtures; take the lifecycle, not the code.

Also in this section

  • AI Agents in DepthBojie Li · primary

    Read 1.2.4 Orchestration Patterns for the workflow-versus-agent choice (the book argues for less structure; this track keeps deterministic authority), 3.1 user memory with 3.3.3, 5.1.5 for repeated-call fingerprints, circuit breakers and turn and budget ceilings, and Chapter 10 (10.1 to 10.5) for when multi-agent coordination helps or fails. Implement one bounded loop before any delegation.

  • Building Effective AgentsAnthropic · required

    Study augmented models, prompt chaining, routing, parallelization, orchestrator-worker and evaluator-optimizer, then "Agents". Select the simplest pattern that meets the task and document why more autonomy is or is not justified. The post now opens with a note that its December 2024 tooling list is out of date; use it for the patterns, not for framework advice.

  • AI Engineering Handbook - Agent EngineeringHandbook Academy · required

    Read Part 7 chapters 7.0 Workflow vs agent (the compounding-error arithmetic), 7.1 The five workflow patterns, 7.2 The agent loop (stop conditions; reflection needs an external check), 7.6 Agent memory and task state, 7.8 Long-running agents (four budgets, kill switch versus circuit breaker, checkpointing is not recovery) and 7.12 Choosing a framework. Treat 7.9 multi-agent systems as optional until a single-agent baseline is measured.

  • AI Agents That MatterKapoor, Stroebl, Siegel, Nadgir and Narayanan · required

    Read Section 2 (cost-controlled evaluation: on HumanEval, simple retry, warming and escalation baselines matched the best agent architectures in accuracy at lower cost; plot accuracy against cost as a Pareto frontier) and Table 1 in Section 5 (which benchmarks have proper holdouts). The result is limited to that benchmark and April 2024 prices; the method is the point. Report every agent result next to a non-agentic baseline and its cost. Preprint, no venue.

  • Agentless: Demystifying LLM-based Software Engineering AgentsXia, Deng, Dunn and Zhang · support

    Read the Section 1 limits of agent approaches, the Section 3 overview and Table 1: a fixed localize, repair and validate pipeline rivaled agents on score and cost. Use it as the worked non-agentic baseline; its numbers are not a target.

  • ReAct: Synergizing Reasoning and Acting in Language ModelsYao et al. (ICLR 2023) · support

    Read Sections 1 to 3.3 and Section 4 up to Table 4: the interleaved thought, action and observation loop and the hand-labeled failure modes of Table 2. On HotpotQA, ReAct alone scored below chain of thought; the gain came from combining them. It is the primary citation for the loop, not a design to copy.

  • AlgoMaster AI Engineering - AgentsAlgoMaster · support

    Read the free lesson what-are-ai-agents ("The Autonomy Spectrum", "When to Use Agents, Pipelines, or Chatbots", "Building a Minimal Agent Loop"), then the owned premium lessons agent-memory-systems, agent-reliability-and-debugging, human-in-the-loop-patterns and long-running-agents. Rebuild one loop without a framework under the same tasks, budgets and failure cases.

  • No Magic - ReAct LoopNo Magic · reference

    Read the agent README and trace microreact.py for the shape of the reason, act and observe loop. It has no language model or tool schema, so it illustrates control flow only.

  • OpenAI Agents SDK: Running Agents and HandoffsOpenAI · support

    At openai-agents 0.24.0, read running_agents ("The agent loop": final output, handoff or tool call, max_turns) and the first screen of handoffs. Its ScriptedModel runs the loop with no key and no server, a reference for deterministic fake models. Disable tracing export for local runs.

  • Pydantic AI: Usage LimitsPydantic · support

    At pydantic-ai 2.57.0, read the "Usage Limits" section of the agent page: request, tool-call, token and cost limits (the tool-call limit is checked before tools run; cost limits are best effort). Compare it with your own budget object and test it with FunctionModel.

  • A Practical Guide to Building AgentsOpenAI · support

    Read pages 5 and 6 (when to build an agent) and 14 and 15 (the run loop and its exit conditions). The rest repeats Building Effective Agents; its guardrail pages are weaker than this track's security sources.

  • Cognitive Architectures for Language Agents (CoALA)Sumers, Yao, Narasimhan and Griffiths (TMLR 2024) · support

    Read Section 4.1 (working memory and the long-term episodic, semantic and procedural stores; writing to procedural memory is riskier than writing to episodic or semantic memory) and Section 4.5 (learning actions, the writes). Its working memory is broader than the context window. Use it to name each store in your design and its write rule.

  • Generative Agents: Interactive Simulacra of Human BehaviorPark et al. (UIST 2023) · support

    Read Section 4.1 (memory stream; retrieval scored by recency, importance and relevance), 4.2 (reflections as derived memories that point to their sources) and 6.5.2 (embellished recall). Recency decays from the last retrieval, not from creation, and nothing supersedes a wrong memory: test both in your store.

  • MemGPT: Towards LLMs as Operating SystemsPacker et al. · depth

    Read Sections 2.1 to 2.4 for the tiered memory vocabulary (main context, recall and archival storage, eviction under memory pressure). Its writes are entirely self-directed by the model, with no provenance or review; your write policy and deletion rule come from your own specification.

  • Reflexion: Language Agents with Verbal Reinforcement LearningShinn et al. (NeurIPS 2023) · depth

    Read Section 3 and Section 4.3: verbal self-reflection stored in an episodic buffer between trials. Compare it at equal cost against plain retries, as AI Agents That Matter does, before crediting the memory.

  • Agent2Agent (A2A) Protocol Specification 1.0.0A2A Project · depth

    Read 1.2 (opaque execution), 3.4 (task and context ids), 4.1.3 TaskState (nine values, including TASK_STATE_INPUT_REQUIRED and TASK_STATE_AUTH_REQUIRED), 4.4.1 AgentCard, 7.5 and 7.6 and Appendix B (relationship to MCP). Authorization is implementation specific (7.5): the protocol says where to ask, not what a grant means. Field names changed from 0.3.0, so older posts are stale.

  • How We Built Our Multi-Agent Research SystemAnthropic · depth

    Read after the single-agent comparison. Extract the parallelization assumptions, delegation contracts (objective, output format, tools and boundaries for each subagent) and evaluator strategy. The benefits section gives the cost: agents use about 4x the tokens of chat and multi-agent systems about 15x. Test one small coordinator-worker variant only if your workload has independent search branches.

  • HTTP Semantics: validators and conditional actionsIETF / RFC Editor · reference

    RFC 9110 Sections 8.8.1 and 13.1.1 only: carry an observed resource version into a conditional action so stale observations cannot silently authorize an overwrite. Apply the mechanism to fake tools, not a second HTTP course.