Skip to content

[doc] Support TTL on ShortTermMemory in User Documentation#784

Merged
wenjin272 merged 2 commits into
apache:mainfrom
da-daken:doc_shortMemory_ttl
Jun 8, 2026
Merged

[doc] Support TTL on ShortTermMemory in User Documentation#784
wenjin272 merged 2 commits into
apache:mainfrom
da-daken:doc_shortMemory_ttl

Conversation

@da-daken

@da-daken da-daken commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

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-needed
  • doc-not-needed
  • doc-included

@github-actions github-actions Bot added doc-label-missing The Bot applies this label either because none or multiple labels were provided. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue. doc-included Your PR already contains the necessary documentation updates. and removed doc-label-missing The Bot applies this label either because none or multiple labels were provided. labels Jun 6, 2026
@da-daken

da-daken commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

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 weiqingy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the literals themselves, along with a single line of additional explanation, are sufficient; therefore, I agree with keeping it brief.

@wenjin272 wenjin272 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenjin272 wenjin272 merged commit da62dcb into apache:main Jun 8, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-included Your PR already contains the necessary documentation updates. fixVersion/0.3.0 The feature or bug should be implemented/fixed in the 0.3.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants