{"schemaVersion":1,"id":"https://lucioduran.com/projects/agent-memory-lifecycle","url":"https://lucioduran.com/projects/agent-memory-lifecycle","title":"Agent Memory Lifecycle","description":"Auditable memory events with provenance, corrections, expiry, deletion and session-scoped lexical retrieval.","language":"en","datePublished":"2026-11-09","dateModified":"2026-11-09","contentFormat":"text/markdown","content":"[Projects](<https://lucioduran.com/projects>) / Agent Memory Lifecycle\n\n# Agent Memory Lifecycle\n\nAuditable memory events with provenance, corrections, expiry, deletion and session-scoped lexical retrieval.\n\nAuthor: [Lucio Durán](<https://lucioduran.com/>) · Python 3.11.13 · License: [MIT](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE>)\n\nPage published: 2026-11-09 · Page updated: 2026-11-09\n\n[Repository](<https://github.com/lucioduran/agent-memory-lifecycle>) · [Original evidence](<https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/results/evaluation.json>) · [Release v0.1.0](<https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0>)\n\n## Problem and relevance to agents\n\nAppend-only memory may retrieve an obsolete fact after it has expired, been corrected or been deleted. Retrieval scores alone do not explain whether a fact should remain usable.\n\nExplicit lifecycle decisions make memory selection inspectable before an agent consumes the selected facts.\n\n## Architecture\n\n1. **Validate events.** Assertions, corrections and tombstones carry source, session, recording time and validity bounds.\n2. **Resolve before ranking.** Filter session and validity, apply permanent corrections and deletions, and select one winning value per key before TF-IDF cosine retrieval.\n3. **Explain and replay.** Return conflicts, exclusions and provenance. Sanitized exports preserve replay structure while removing deleted payloads.\n\n- [Design and trust boundaries](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/semantics.md>)\n\n## What this demonstrates\n\n- Deterministic correction and expiration semantics, including boundary timestamps.\n- Cross-session selection and deletion checks with explicit expected IDs.\n- Replayable traces showing why memory was selected or excluded.\n\n## Published results\n\nEighteen original fictional policy scenarios executed locally on a Xeon W-3223 using Python 3.11.13 and one thread.\n\nExact top-one ID set matches include empty expected results. Both methods filter by session. The baseline ignores corrections, expiry and deletion and uses simpler lexical ranking.\n\n### Lifecycle policy cases\n\n| Method | Exact expected ID sets |\n| --- | --- |\n| Session-scoped append-only baseline | 8/18 |\n| Temporal policy and TF-IDF | 18/18 |\n\nAll policy scenarios passed, but the baseline comparison changes both ranking and lifecycle rules. It does not isolate a causal retrieval-quality gain. A single elapsed time is not a latency benchmark.\n\n## Reproduce\n\nPython 3.11 or newer; replay and evaluation have no runtime dependencies.\n\nRun measurements in a new destination and serialize heavy workloads. Within the original project series, use the shared benchmark\\_lock.py wrapper. Commands below use POSIX shell syntax.\n\n### Verify saved evidence\n\n```\ngit clone https://github.com/lucioduran/agent-memory-lifecycle.git\ncd agent-memory-lifecycle\ngit checkout d185070cadfd4d0b36e58d957ab7054ae90bdf18\npython -m scripts.evaluate results/evaluation.json --verify\n```\n\n### Repeat the local experiment\n\n```\npython -m scripts.evaluate results/new-run.json\n```\n\n## Scope and limitations\n\n- The in-memory library assumes trusted callers and files. It provides no authentication, concurrency control, crash durability, encryption or secure erasure.\n- Deletion retains audit identifiers and timestamps and cannot erase external copies or old traces. Erased correction keys cannot be revalidated from sanitized exports.\n- Newer facts win by policy, not because they have been verified as true. Historical queries use current knowledge.\n- ASCII lexical retrieval and small author-known fixtures do not establish semantic understanding, production accuracy or security.\n\n- [Related architecture article](<https://lucioduran.com/blog/agentic-ai-architecture-patterns>)\n\n## Sources and revision\n\nThe report identifies implementation commit 7b9a6b77399c38e461544c7897f812bab6e96ebd and a fixture hash, but contains no execution timestamp. The release and page dates are separate.\n\n- Reviewed revision: [` d185070cadfd4d0b36e58d957ab7054ae90bdf18 `](<https://github.com/lucioduran/agent-memory-lifecycle/commit/d185070cadfd4d0b36e58d957ab7054ae90bdf18>)\n- Revision recorded by the experiment: [` 7b9a6b77399c38e461544c7897f812bab6e96ebd `](<https://github.com/lucioduran/agent-memory-lifecycle/commit/7b9a6b77399c38e461544c7897f812bab6e96ebd>)\n- Release published: [v0.1.0](<https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0>) · 2026-11-09T18:31:34Z\n- Corpus SHA-256: ` 05a8e826369607eb05d5bcf9f67783db6161ed565e35d05f0313a983c37459dc `\n\n- [README and usage](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/README.md>)\n- [Original evidence](<https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/results/evaluation.json>)\n- [MIT license](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE>)\n- [Design and trust boundaries](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/semantics.md>)\n- [Measurement methodology](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/evaluation.md>)\n- [Original fixtures](<https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/examples/scenarios.json>)","headings":[{"level":1,"text":"Agent Memory Lifecycle","url":"https://lucioduran.com/projects/agent-memory-lifecycle#title"},{"level":2,"text":"Problem and relevance to agents","url":"https://lucioduran.com/projects/agent-memory-lifecycle#problem"},{"level":2,"text":"Architecture","url":"https://lucioduran.com/projects/agent-memory-lifecycle#architecture"},{"level":2,"text":"What this demonstrates","url":"https://lucioduran.com/projects/agent-memory-lifecycle#demonstrates"},{"level":2,"text":"Published results","url":"https://lucioduran.com/projects/agent-memory-lifecycle#results"},{"level":3,"text":"Lifecycle policy cases","url":"https://lucioduran.com/projects/agent-memory-lifecycle#results-Lifecycle%20policy%20cases"},{"level":2,"text":"Reproduce","url":"https://lucioduran.com/projects/agent-memory-lifecycle#reproduce"},{"level":3,"text":"Verify saved evidence","url":"https://lucioduran.com/projects/agent-memory-lifecycle#reproduce-replay"},{"level":3,"text":"Repeat the local experiment","url":"https://lucioduran.com/projects/agent-memory-lifecycle#reproduce-experiment"},{"level":2,"text":"Scope and limitations","url":"https://lucioduran.com/projects/agent-memory-lifecycle#scope"},{"level":2,"text":"Sources and revision","url":"https://lucioduran.com/projects/agent-memory-lifecycle#sources"}],"sections":[{"heading":"Agent Memory Lifecycle","level":1,"url":"https://lucioduran.com/projects/agent-memory-lifecycle","content":"[Projects](<https://lucioduran.com/projects>) / Agent Memory Lifecycle"},{"heading":"Agent Memory Lifecycle","level":1,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#title","content":"Auditable memory events with provenance, corrections, expiry, deletion and session-scoped lexical retrieval.\n\nAuthor: [Lucio Durán](<https://lucioduran.com/>) · Python 3.11.13 · License: [MIT](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE>)\n\nPage published: 2026-11-09 · Page updated: 2026-11-09\n\n[Repository](<https://github.com/lucioduran/agent-memory-lifecycle>) · [Original evidence](<https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/results/evaluation.json>) · [Release v0.1.0](<https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0>)"},{"heading":"Problem and relevance to agents","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#problem","content":"Append-only memory may retrieve an obsolete fact after it has expired, been corrected or been deleted. Retrieval scores alone do not explain whether a fact should remain usable.\n\nExplicit lifecycle decisions make memory selection inspectable before an agent consumes the selected facts."},{"heading":"Architecture","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#architecture","content":"1. **Validate events.** Assertions, corrections and tombstones carry source, session, recording time and validity bounds.\n2. **Resolve before ranking.** Filter session and validity, apply permanent corrections and deletions, and select one winning value per key before TF-IDF cosine retrieval.\n3. **Explain and replay.** Return conflicts, exclusions and provenance. Sanitized exports preserve replay structure while removing deleted payloads.\n\n- [Design and trust boundaries](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/semantics.md>)"},{"heading":"What this demonstrates","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#demonstrates","content":"- Deterministic correction and expiration semantics, including boundary timestamps.\n- Cross-session selection and deletion checks with explicit expected IDs.\n- Replayable traces showing why memory was selected or excluded."},{"heading":"Published results","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#results","content":"Eighteen original fictional policy scenarios executed locally on a Xeon W-3223 using Python 3.11.13 and one thread.\n\nExact top-one ID set matches include empty expected results. Both methods filter by session. The baseline ignores corrections, expiry and deletion and uses simpler lexical ranking."},{"heading":"Lifecycle policy cases","level":3,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#results-Lifecycle%20policy%20cases","content":"| Method | Exact expected ID sets |\n| --- | --- |\n| Session-scoped append-only baseline | 8/18 |\n| Temporal policy and TF-IDF | 18/18 |\n\nAll policy scenarios passed, but the baseline comparison changes both ranking and lifecycle rules. It does not isolate a causal retrieval-quality gain. A single elapsed time is not a latency benchmark."},{"heading":"Reproduce","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#reproduce","content":"Python 3.11 or newer; replay and evaluation have no runtime dependencies.\n\nRun measurements in a new destination and serialize heavy workloads. Within the original project series, use the shared benchmark\\_lock.py wrapper. Commands below use POSIX shell syntax."},{"heading":"Verify saved evidence","level":3,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#reproduce-replay","content":"```\ngit clone https://github.com/lucioduran/agent-memory-lifecycle.git\ncd agent-memory-lifecycle\ngit checkout d185070cadfd4d0b36e58d957ab7054ae90bdf18\npython -m scripts.evaluate results/evaluation.json --verify\n```"},{"heading":"Repeat the local experiment","level":3,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#reproduce-experiment","content":"```\npython -m scripts.evaluate results/new-run.json\n```"},{"heading":"Scope and limitations","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#scope","content":"- The in-memory library assumes trusted callers and files. It provides no authentication, concurrency control, crash durability, encryption or secure erasure.\n- Deletion retains audit identifiers and timestamps and cannot erase external copies or old traces. Erased correction keys cannot be revalidated from sanitized exports.\n- Newer facts win by policy, not because they have been verified as true. Historical queries use current knowledge.\n- ASCII lexical retrieval and small author-known fixtures do not establish semantic understanding, production accuracy or security.\n\n- [Related architecture article](<https://lucioduran.com/blog/agentic-ai-architecture-patterns>)"},{"heading":"Sources and revision","level":2,"url":"https://lucioduran.com/projects/agent-memory-lifecycle#sources","content":"The report identifies implementation commit 7b9a6b77399c38e461544c7897f812bab6e96ebd and a fixture hash, but contains no execution timestamp. The release and page dates are separate.\n\n- Reviewed revision: [` d185070cadfd4d0b36e58d957ab7054ae90bdf18 `](<https://github.com/lucioduran/agent-memory-lifecycle/commit/d185070cadfd4d0b36e58d957ab7054ae90bdf18>)\n- Revision recorded by the experiment: [` 7b9a6b77399c38e461544c7897f812bab6e96ebd `](<https://github.com/lucioduran/agent-memory-lifecycle/commit/7b9a6b77399c38e461544c7897f812bab6e96ebd>)\n- Release published: [v0.1.0](<https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0>) · 2026-11-09T18:31:34Z\n- Corpus SHA-256: ` 05a8e826369607eb05d5bcf9f67783db6161ed565e35d05f0313a983c37459dc `\n\n- [README and usage](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/README.md>)\n- [Original evidence](<https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/results/evaluation.json>)\n- [MIT license](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE>)\n- [Design and trust boundaries](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/semantics.md>)\n- [Measurement methodology](<https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/evaluation.md>)\n- [Original fixtures](<https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/examples/scenarios.json>)"}],"links":[{"text":"Projects","url":"https://lucioduran.com/projects"},{"text":"Lucio Durán","url":"https://lucioduran.com/"},{"text":"MIT","url":"https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE"},{"text":"Repository","url":"https://github.com/lucioduran/agent-memory-lifecycle"},{"text":"Original evidence","url":"https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/results/evaluation.json"},{"text":"Release v0.1.0","url":"https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0"},{"text":"Design and trust boundaries","url":"https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/semantics.md"},{"text":"Related architecture article","url":"https://lucioduran.com/blog/agentic-ai-architecture-patterns"},{"text":"d185070cadfd4d0b36e58d957ab7054ae90bdf18","url":"https://github.com/lucioduran/agent-memory-lifecycle/commit/d185070cadfd4d0b36e58d957ab7054ae90bdf18"},{"text":"7b9a6b77399c38e461544c7897f812bab6e96ebd","url":"https://github.com/lucioduran/agent-memory-lifecycle/commit/7b9a6b77399c38e461544c7897f812bab6e96ebd"},{"text":"v0.1.0","url":"https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0"},{"text":"README and usage","url":"https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/README.md"},{"text":"MIT license","url":"https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE"},{"text":"Measurement methodology","url":"https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/evaluation.md"},{"text":"Original fixtures","url":"https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/examples/scenarios.json"}],"structuredData":[{"@context":"https://schema.org","@graph":[{"@type":"Person","@id":"https://lucioduran.com/#person","name":"Lucio Durán","url":"https://lucioduran.com/"},{"@type":"WebSite","@id":"https://lucioduran.com/#website","url":"https://lucioduran.com/","name":"Lucio Durán","inLanguage":["en","es"],"publisher":{"@id":"https://lucioduran.com/#person"}},{"@type":"WebPage","@id":"https://lucioduran.com/projects/agent-memory-lifecycle#page","url":"https://lucioduran.com/projects/agent-memory-lifecycle","name":"Agent Memory Lifecycle","description":"Auditable memory events with provenance, corrections, expiry, deletion and session-scoped lexical retrieval.","inLanguage":"en","author":{"@id":"https://lucioduran.com/#person"},"publisher":{"@id":"https://lucioduran.com/#person"},"isPartOf":{"@id":"https://lucioduran.com/#website"},"isAccessibleForFree":true,"mainEntity":{"@id":"https://lucioduran.com/projects/agent-memory-lifecycle#software"},"datePublished":"2026-11-09","dateModified":"2026-11-09","breadcrumb":{"@id":"https://lucioduran.com/projects/agent-memory-lifecycle#breadcrumb"}},{"@type":"SoftwareSourceCode","@id":"https://lucioduran.com/projects/agent-memory-lifecycle#software","name":"Agent Memory Lifecycle","description":"Auditable memory events with provenance, corrections, expiry, deletion and session-scoped lexical retrieval.","inLanguage":"en","url":"https://lucioduran.com/projects/agent-memory-lifecycle","codeRepository":"https://github.com/lucioduran/agent-memory-lifecycle","programmingLanguage":"Python","runtimePlatform":"Python 3.11.13","license":"https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/LICENSE","version":"v0.1.0","identifier":{"@type":"PropertyValue","propertyID":"git-commit","value":"d185070cadfd4d0b36e58d957ab7054ae90bdf18"},"author":{"@type":"Person","@id":"https://lucioduran.com/#person","name":"Lucio Durán","url":"https://lucioduran.com"},"isAccessibleForFree":true,"citation":["https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/README.md","https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/results/evaluation.json","https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/semantics.md","https://github.com/lucioduran/agent-memory-lifecycle/blob/d185070cadfd4d0b36e58d957ab7054ae90bdf18/docs/evaluation.md","https://raw.githubusercontent.com/lucioduran/agent-memory-lifecycle/d185070cadfd4d0b36e58d957ab7054ae90bdf18/examples/scenarios.json","https://github.com/lucioduran/agent-memory-lifecycle/releases/tag/v0.1.0"],"publisher":{"@id":"https://lucioduran.com/#person"},"mainEntityOfPage":{"@id":"https://lucioduran.com/projects/agent-memory-lifecycle#page"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Projects","item":"https://lucioduran.com/projects"},{"@type":"ListItem","position":2,"name":"Agent Memory Lifecycle","item":"https://lucioduran.com/projects/agent-memory-lifecycle"}],"@id":"https://lucioduran.com/projects/agent-memory-lifecycle#breadcrumb"}]}],"contentHash":"6e4c452dbc4aaa1e352223bdf6d2c2ca14611e4ea0d08156848857110245b294","provenance":{"method":"Deterministic serialization of the server-rendered main element","source":"https://lucioduran.com/projects/agent-memory-lifecycle","hashAlgorithm":"sha256","hashScope":"JSON document fields before contentHash and provenance","sourceHTMLBytes":41491,"contentBytes":5639}}
