Skip to content

[DOC] Add agentic memory retention policy documentation - #12825

Open
AirFunnyB wants to merge 11 commits into
opensearch-project:mainfrom
AirFunnyB:add-agentic-memory-retention
Open

[DOC] Add agentic memory retention policy documentation#12825
AirFunnyB wants to merge 11 commits into
opensearch-project:mainfrom
AirFunnyB:add-agentic-memory-retention

Conversation

@AirFunnyB

@AirFunnyB AirFunnyB commented Jul 22, 2026

Copy link
Copy Markdown

Description

Adds a new documentation page for the agentic memory retention policy feature in ML Commons, covering retention policy structure, per-memory-type rules (retention_days/max_count), pinning, the background retention job, cluster settings, and troubleshooting.

New page: _ml-commons-plugin/agentic-memory-retention.md (parent: Memory and context, nav_order 30).

Issues Resolved

Closes #12854

Version

Introduced 3.8

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions

Copy link
Copy Markdown

Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Merged.

Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer.

When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference).

@github-actions github-actions Bot added the Tech review PR: Tech review in progress label Jul 22, 2026
@AirFunnyB
AirFunnyB force-pushed the add-agentic-memory-retention branch 2 times, most recently from 822850a to 1222bbc Compare July 22, 2026 19:49
Comment thread _ml-commons-plugin/agentic-memory-retention.md
Signed-off-by: Erfan Ballew <ballewer@amazon.com>
@AirFunnyB
AirFunnyB force-pushed the add-agentic-memory-retention branch from 1222bbc to cb5e079 Compare July 22, 2026 20:48
@kolchfa-aws kolchfa-aws added release-notes PR: Include this PR in the automated release notes v3.8.0 labels Jul 22, 2026
- Fix interval guidance: retention_job_interval_hours is set in opensearch.yml
  at initial setup (runtime change planned for a future release)
- Fix 403 attribution: container APIs gate retention_policy, memory update
  API gates pinned
- Fix working memory scope: working_memory_ttl_days applies to session-less
  containers, orphan_ttl_days to session-enabled containers
- Remove unsupported per-type null example; clarify OR/dedup in Example 4
- Update recommended starting values and memory-types overview

Signed-off-by: Erfan Ballew <ballewer@amazon.com>
Comment on lines +34 to +35
- `working_memory_ttl_days` ages out working memory in session-less containers. It is off by default.
- `orphan_ttl_days` sweeps working memory whose parent session no longer exists.

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.

Suggest mention the full setting path, for example plugins.ml_commons.memory.working_memory_ttl_days

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Comment on lines +34 to +35
- `working_memory_ttl_days` ages out working memory in session-less containers. It is off by default.
- `orphan_ttl_days` sweeps working memory whose parent session no longer exists.

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.

Is there any default for orphan_ttl_days?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes 7 days

@nathaliellenaa nathaliellenaa 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 on the technical side

Erfan Ballew and others added 3 commits July 22, 2026 14:57
- Add experimental-feature .warning notice (mingshl review comment)
- Use full plugins.ml_commons.memory.* paths on first mention of
  working_memory_ttl_days and orphan_ttl_days (nathaliellenaa review)

Signed-off-by: Erfan Ballew <ballewer@amazon.com>
- Retention policy retention_days/max_count truncate decimals to whole
  numbers (89.5 becomes 89)
- Cluster default settings reject decimal values

Signed-off-by: Erfan Ballew <ballewer@amazon.com>

## Cluster-level settings for administrators

Cluster administrators can configure retention behavior using dynamic cluster settings. All settings use the prefix `plugins.ml_commons.memory.` and can be updated at runtime without a restart, with one exception: `retention_job_interval_hours` is configured in `opensearch.yml` during initial setup and is applied once, when the retention job is first scheduled. The ability to change it on a running cluster is planned for a future release.

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.

@AirFunnyB This seems not entirely true. Looking at the setting, it's declared as dynamic. Does the retention_job_interval_hours setting need to be configured in opensearch.yml or can users configure it via the Cluster Settings API?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's declared dynamic so the Cluster Settings API won't reject an update, but in this release that update isn't actually applied to the running retention job — the interval only takes effect when the job is first scheduled at cluster startup. So opensearch.yml at initial cluster setup is the only way to reliably set it today. Wiring a runtime change through to the live job is planned for a future release.

@kolchfa-aws kolchfa-aws added Doc review PR: Doc review in progress and removed Tech review PR: Tech review in progress labels Jul 28, 2026
Comment thread _ml-commons-plugin/agentic-memory-retention.md
Erfan Ballew and others added 2 commits July 28, 2026 14:47
Long-term and history retention rules only act on stored memory, which
requires llm_id + strategies + embedding. Show a fully-configured
container in the quick-start example and note the assumption on the
other create examples.

Signed-off-by: Erfan Ballew <ballewer@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Comment thread .github/vale/styles/Vocab/OpenSearch/Words/accept.txt Outdated
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

@kolchfa-aws kolchfa-aws 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.

Thank you, @AirFunnyB! Doc review complete. Please review the rewritten version and verify that everything looks good, and we'll be ready to merge the PR.

Comment thread _ml-commons-plugin/api/agentic-memory-apis/create-memory-container.md Outdated
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Doc review PR: Doc review in progress release-notes PR: Include this PR in the automated release notes v3.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC] Add agentic memory retention policy documentation

4 participants