---
title: "Introducing memory retention for agentic memory in OpenSearch"
url: https://daily.dev/posts/introducing-memory-retention-for-agentic-memory-in-opensearch-ekprxjgyu
source_url: https://opensearch.org/blog/introducing-memory-retention-for-agentic-memory-in-opensearch
type: article
source: "OpenSearch"
published: 2026-08-23T12:22:27.133Z
updated: 2026-08-23T12:55:27.466Z
tags: ["ai-agents", "vector-search", "opensearch"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introducing memory retention for agentic memory in OpenSearch

**[OpenSearch](https://daily.dev/sources/opensearch)** · 7 min read · 0 upvotes · 0 comments

## Summary

OpenSearch 3.8 adds an experimental, opt-in memory retention feature for agentic memory containers, letting operators set age-based (retention_days) and count-based (max_count) limits on sessions, long-term memory, and history to control storage growth and keep agent context fresh. Individual memories can be pinned to exempt them from deletion, cluster-wide defaults can be configured for consistency, and a safe rollout sequence exists for enabling retention on clusters that already hold data without accidental loss. Safety controls include a 50,000-document-per-pass cap, a dynamic kill switch, orphaned-message sweeps, and up to a 24-hour delay before expired memories disappear from query results.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://opensearch.org/blog/introducing-memory-retention-for-agentic-memory-in-opensearch>

## Questions this post answers

### How do I set up retention policies for agentic memory in OpenSearch 3.8?

OpenSearch 3.8 introduces an experimental memory retention feature controlled by the flag plugins.ml_commons.memory.retention_enabled, disabled by default. You can set retention_days (age-based, measured from last_updated_time) and max_count (count-based, deletes oldest first) per memory type on sessions, long-term memory, and history when creating a container, or configure cluster-wide defaults for containers without their own policy.

_daily.dev surfaces practical rollout guides like this for teams tuning agentic memory storage costs._

### How can I safely enable memory retention on an OpenSearch cluster that already has months of data without losing anything?

Enable retention_enabled first while leaving all defaults at -1, which only exposes the retention APIs without deleting anything. Then set explicit policies on containers whose workload you understand, exempting any with retention_policy set to null. Finally configure cluster-wide defaults for the remaining containers, which adopt them on the next scheduled job run.

_Engineers rolling out storage lifecycle changes can track guidance like this on daily.dev._

### Can I exempt specific conversations or facts from OpenSearch agentic memory retention deletion?

Yes, pinning a memory exempts it from retention enforcement regardless of age or count limits. Pinning a session protects the entire conversation and all its messages, and pinned memories don't count toward max_count. Only sessions and long-term memories can be pinned; working memory and history cannot.

_daily.dev helps developers keep up with fine-grained controls like pinning in evolving data platforms._

## Similar posts on daily.dev

- [Agent memory as a moat: how context compounds](https://daily.dev/posts/agent-memory-as-a-moat-how-context-compounds-yklbppnd6) · Redis · 0 upvotes · 0 comments
- [How Agentic Memory Enables Reliable AI Agents Across Enterprise Users](https://daily.dev/posts/how-agentic-memory-enables-reliable-ai-agents-across-enterprise-users-gofuqzdna) · Salesforce Engineering · 57 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#vector-search](https://daily.dev/tags/vector-search), [#opensearch](https://daily.dev/tags/opensearch)

[View this post on daily.dev](https://daily.dev/posts/introducing-memory-retention-for-agentic-memory-in-opensearch-ekprxjgyu)
