Temporary states in long-term memory expire over time. Use the timestamp carried by each memory so the model perceives when it was recorded, avoiding treating stale information as current fact.
Much of what long-term memory stores is a temporary state rather than a permanent fact: an injury recovery period, a short-term dietary restriction, exam preparation, a business trip. If your application injects only memory text into the context, the model cannot tell a state recorded yesterday from one recorded six months ago, and will answer as if an expired state were still true.
This page describes a field-tested approach: use the timestamp carried by each memory so the model perceives how old it is when answering.
Every memory node carries a
After retrieval, format each timestamp as a readable date and inject it into the system prompt together with today's date and an explicit staleness instruction:
With a memory written six weeks ago, "The user is recovering from an ankle sprain and avoids high-intensity lower-body training", the user asks: "I want to schedule squats today. Is that OK?"
Timestamp injection handles freshness at the model-reasoning layer. If a class of memory should become unrecallable after a period, configure memory expiration on the memory rule (7 days / 30 days / 180 days / never; see Configure memory rules). Expired memories no longer participate in retrieval. The two mechanisms stack: expiration enforces hard expiry, while the timestamp lets the model reason about memories that are still within their validity period.
The memory timestamp
Every memory node carries a timestamp field (Unix time in seconds), returned by Search memory, List memories, and Get memory node:
timestampis the message time (when the server received that turn of conversation);created_atis when the memory was written. In real-time integrations they are close; rely ontimestamp.timestampis recorded by the server and cannot be set by the caller. To backfill historical conversations while keeping original dates, write the original date into the memory text itself (for example, "(2026-09-01) The user ...").
Recommended practice
After retrieval, format each timestamp as a readable date and inject it into the system prompt together with today's date and an explicit staleness instruction:
- When memories are recalled, read each node's
timestampand format it as a date (for example,2026-10-12). - Prefix each injected memory with
[Recorded on YYYY-MM-DD]. - In the system instruction, state today's date and explicitly ask the model to judge memory freshness, for example: "Each memory carries its recording date; judge against today's date whether it is still valid, and do not treat clearly expired life-state memories as current facts."
Retrieval defaults to
min_score=0.3 (pro plan), which can filter out relevant memories with modest scores. If recall returns empty, lower min_score first to troubleshoot; see Search memory.Before and after
With a memory written six weeks ago, "The user is recovering from an ankle sprain and avoids high-intensity lower-body training", the user asks: "I want to schedule squats today. Is that OK?"
| Injection style | Model behavior |
|---|---|
| Memory text only | Refuses as a current fact: "Not recommended; you are in recovery." |
| Text + recording date | Still answers as if current; the date goes unused |
| Text + recording date + freshness instruction | Recognizes the memory as expired: "That record is from 6 weeks ago; a typical sprain recovery has ended. You can start with light weights." |
Combine with memory expiration
Timestamp injection handles freshness at the model-reasoning layer. If a class of memory should become unrecallable after a period, configure memory expiration on the memory rule (7 days / 30 days / 180 days / never; see Configure memory rules). Expired memories no longer participate in retrieval. The two mechanisms stack: expiration enforces hard expiry, while the timestamp lets the model reason about memories that are still within their validity period.
Scope
- Applies to applications that orchestrate memory injection themselves through the API. When integrating through the console Agent Harness or the workflow plugin, the platform handles memory injection and this approach does not apply.
- Tune the wording of the freshness instruction to your business, and regression-test it against your production model.