[doc] Support TTL on ShortTermMemory in User Documentation#784
Conversation
|
hi @xintongsong @GreatEugenius , I have added user documentation and configuration documentation about short-term memory TTL, but I'm not sure if it meets the requirements. PTAL~ |
weiqingy
left a comment
There was a problem hiding this comment.
Thanks for adding this — nice that the Python and Java snippets mirror the real e2e/integration tests exactly, and every config key, default, and enum value matches AgentExecutionOptions / core_options.py. One optional question inline.
|
|
||
| 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. |
There was a problem hiding this 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.
There was a problem hiding this comment.
I think 'controls whether TTL is refreshed on create/write or on read/write.' already sufficiently explains the above situation, so I don't intend to provide any additional supplements. Thank you for such a prompt reply.
There was a problem hiding this comment.
I believe the literals themselves, along with a single line of additional explanation, are sufficient; therefore, I agree with keeping it brief.
Linked issue: #753 #580
Purpose of change
Add a document for Support TTL on Short Term Memory
Tests
No need to test
API
no api
Documentation
doc-neededdoc-not-neededdoc-included