Skip to content

Agent Zero AI framework

Guide memory staleness with timestamps

Alessandro120d55d2713a
diff --git a/plugins/_memory/prompts/agent.system.memories.md b/plugins/_memory/prompts/agent.system.memories.md
index cea89884e..15be8f4fa 100644
--- a/plugins/_memory/prompts/agent.system.memories.md
+++ b/plugins/_memory/prompts/agent.system.memories.md
@@ -1,6 +1,8 @@
# Memories on the topic
- following are memories about current topic
- do not overly rely on them they might not be relevant
+- when timestamps are present, use them as a soft staleness signal: newer/current memories usually win for mutable facts
+- old memories can still be valid durable preferences or project facts; do not ignore or forget them only because they are old
- if memories conflict, prefer the newest/current fact and ignore superseded older fragments
- use `memory_forget` for stale, false, superseded, duplicated, or unwanted memories; it also cleans exact matches and derived fragment/solution records
diff --git a/plugins/_memory/prompts/agent.system.tool.memory.md b/plugins/_memory/prompts/agent.system.tool.memory.md
index 9b29a21d7..36a91f025 100644
--- a/plugins/_memory/prompts/agent.system.tool.memory.md
+++ b/plugins/_memory/prompts/agent.system.tool.memory.md
@@ -9,8 +9,10 @@ notes:
- `threshold` is similarity from `0` to `1`
- `filter` is a metadata expression (e.g. `area=='main'`)
- confirm destructive changes when accuracy matters
+- memories usually include timestamp metadata; use it as a soft recency signal, not a hard TTL
- when the user updates a durable fact/preference, load related memories first, forget/delete superseded versions, then save one complete current version
- do not append a second memory for the same mutable subject when the new statement replaces the old one
+- do not forget a memory only because it is old; forget it when current evidence shows it is stale, false, superseded, duplicated, or unwanted
- `memory_forget` also cleans exact matches and derived fragment/solution records related to removed memories
- use `memory_save` for stable current facts, not short-lived test markers, greetings, or one-off conversation events
diff --git a/plugins/_memory/prompts/memory.consolidation.sys.md b/plugins/_memory/prompts/memory.consolidation.sys.md
index 3a3aa2ba0..2d4fabf15 100644
--- a/plugins/_memory/prompts/memory.consolidation.sys.md
+++ b/plugins/_memory/prompts/memory.consolidation.sys.md
@@ -23,9 +23,11 @@ Default bias: for mutable user preferences, project state, configuration choices
### 1. Temporal Intelligence
- **Newer information** generally supersedes older information
+- **Timestamps are soft recency signals, not automatic TTLs**; age alone does not make a durable memory invalid
- **Preserve historical context** only when the user explicitly needs history or an audit trail
- **Do not keep old preferences as equally important memories** when the new memory clearly gives the current state
- **Consider recency** - more recent memories are usually more relevant for mutable facts
+- **Keep stable old facts** when they remain useful and are not contradicted by newer/current information
### 2. Content Relationships
- **Complementary information** should be merged into comprehensive memories
diff --git a/plugins/_memory/prompts/memory.memories_filter.sys.md b/plugins/_memory/prompts/memory.memories_filter.sys.md
index ca6a05050..aca80331a 100644
--- a/plugins/_memory/prompts/memory.memories_filter.sys.md
+++ b/plugins/_memory/prompts/memory.memories_filter.sys.md
@@ -13,6 +13,7 @@
- Focus on USER MESSAGE if provided, use HISTORY for context
- Keep in mind that these memories should be helpful for continuing the conversation and solving problems by AI
- Consider if each memory holds real information value for the context or not
+- If memories include timestamps, treat recency as a soft signal: newer/current memories are usually better for mutable facts, while old durable facts may still be useful
- If multiple memories conflict about the same mutable user/project fact, include only the newest/current one when it is identifiable
- Exclude superseded, historical, duplicate, or low-detail fragments when a more complete current memory is available