weiqingy commented on code in PR #784:
URL: https://github.com/apache/flink-agents/pull/784#discussion_r3367998404


##########
docs/content/docs/development/memory/sensory_and_short_term_memory.md:
##########
@@ -263,4 +266,56 @@ Sensory Memory is automatically cleared by the framework 
after each agent run co
 
 {{< hint info >}}
 During execution, sensory memory data is checkpointed by Flink for fault 
tolerance. However, once the run completes, all sensory memory is cleared and 
will not be available in subsequent runs.
-{{< /hint >}}
\ No newline at end of file
+{{< /hint >}}
+
+### Short-Term Memory
+
+Short-term memory can be configured with a time-to-live (TTL) so that older 
state expires automatically. This is useful for agents that may run for a long 
time: if the agent only needs recent memories, expiring historical data 
directly keeps the stored state focused on the latest context and avoids 
retaining stale information.
+
+Set `short-term-memory.state-ttl.ms` to a value greater than 0 in milliseconds 
to enable TTL. You can also configure how the TTL is refreshed and whether 
expired state can be returned before Flink cleans it up:
+
+- `short-term-memory.state-ttl.update-type`: controls whether TTL is refreshed 
on create/write or on read/write.

Review Comment:
   Both the prose ("older state expires automatically… expiring historical 
data") and the two examples use `ON_READ_AND_WRITE`, the default — under which 
a *read* also resets the TTL clock. So an old entry that's still being read 
periodically won't expire. A reader skimming the intro might take "older" to 
mean by creation time. Would it be worth one clarifying sentence here — that 
with `ON_READ_AND_WRITE` "age" is measured from last access, and 
`ON_CREATE_AND_WRITE` is the one that expires by write/creation time? It's okay 
with me if you'd rather keep it brief.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to