Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
---
layout: post
title: "OpenSearch Agentic Memory Integration with LangGraph and Strands"
authors:
- nathhjo
date: 2025-12-09
categories:
- technical-post
meta_keywords: OpenSearch 3.3, agentic memory solution, AI agents, persistent memory, machine learning, agentic memory, context awareness, LLM, language models, memory containers, semantic search, AI development, agent frameworks, intelligent agents, context management, LangGraph, Strands, Strands Agent
meta_description: "Learn how OpenSearch 3.3 enables AI agents to remember and learn with agentic memory. Includes LangGraph and Strands integration examples and notebooks."
---

An AI agent's effectiveness depends on its memory. Without the ability to recall past interactions, maintain context across conversations, or learn from previous decisions, even the most sophisticated agents lose their effectiveness the moment a conversation ends. This is where agentic memory becomes critical. With OpenSearch 3.3.0, we're introducing agentic memory capabilities that enable AI agents to store, retrieve, and reason over their interaction history. In this post, we'll show you how to integrate this powerful features with two popular AI agent frameworks - LangGraph and Strands - to build agents that truly remember and evolve.

## Quick Start 🚀

Check failure on line 15 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.HeadingCapitalization] 'Quick Start 🚀' is a heading and should be in sentence case. Raw Output: {"message": "[OpenSearch.HeadingCapitalization] 'Quick Start 🚀' is a heading and should be in sentence case.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 15, "column": 4}}}, "severity": "ERROR"}

We’ve prepared two paths to explore OpenSearch agentic memory capabilities with LangGraph and Strands.

1. Real use case Notebooks - Interactive Jupyter notebooks with complete implementations
2. Framework demo scripts - Focused Python scripts to learn core concepts

Requirements for both paths:

* Python 3.10+
* OpenSearch 3.3.2+
* AWS credentials for Amazon Bedrock access

### 🎯 See It In Action: Real Use Case Notebooks

Check failure on line 28 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.HeadingCapitalization] '🎯 See It In Action: Real Use Case Notebooks' is a heading and should be in sentence case. Raw Output: {"message": "[OpenSearch.HeadingCapitalization] '🎯 See It In Action: Real Use Case Notebooks' is a heading and should be in sentence case.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 28, "column": 5}}}, "severity": "ERROR"}

**Want to see a real use case example?** We've prepared two interactive notebooks demonstrating agentic memory with different AI agent frameworks, LangGraph and Strands . Choose one to start, or try both to see how different frameworks handle memory.

#### 1. Fitness Coach Assistant with LangGraph

Check failure on line 32 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.HeadingCapitalization] '1. Fitness Coach Assistant with LangGraph' is a heading and should be in sentence case. Raw Output: {"message": "[OpenSearch.HeadingCapitalization] '1. Fitness Coach Assistant with LangGraph' is a heading and should be in sentence case.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 32, "column": 6}}}, "severity": "ERROR"}

A fitness coaching assistant that tracks your workout history, learns your goals, and provides personalized training recommendations.

**Setup for Notebook:**

```bash
# Clone and navigate
git clone https://github.com/opensearch-project/opensearch-py-ml.git
cd docs/source/examples/agentic_memory

# Open the notebook
jupyter notebook langgraph/demo_fitness_assistant.ipynb
```

View notebook on Github → [notebook_link](..)

Check failure on line 47 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'GitHub' instead of 'Github'. Raw Output: {"message": "[Vale.Terms] Use 'GitHub' instead of 'Github'.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 47, "column": 18}}}, "severity": "ERROR"}

Check failure on line 47 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.Spelling] Error: Github. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks. Raw Output: {"message": "[OpenSearch.Spelling] Error: Github. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 47, "column": 18}}}, "severity": "ERROR"}

**What you’ll experience:**

* Workout history tracking - Agent remembers exercises and progress
* Goal-oriented coaching - Adapts to your objectives
* Progress analysis - Suggests improvements
* Context-aware guidance - Advice based on history

#### 2. Travel Agent Assistant with Strands Agent

Check failure on line 56 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.HeadingCapitalization] '2. Travel Agent Assistant with Strands Agent' is a heading and should be in sentence case. Raw Output: {"message": "[OpenSearch.HeadingCapitalization] '2. Travel Agent Assistant with Strands Agent' is a heading and should be in sentence case.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 56, "column": 6}}}, "severity": "ERROR"}

A travel planning assistant that remembers your preferences, past trips, and builds personalized recommendations over time.

**Setup for Notebook:**

```bash
# Clone and navigate
git clone https://github.com/opensearch-project/opensearch-py-ml.git
cd docs/source/examples/agentic_memory

# Open the notebook
jupyter notebook strands/demo_travel_assistant.ipynb
```
View notebook on Github → [notebook_link](..)

Check failure on line 70 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'GitHub' instead of 'Github'. Raw Output: {"message": "[Vale.Terms] Use 'GitHub' instead of 'Github'.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 70, "column": 18}}}, "severity": "ERROR"}

Check failure on line 70 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.Spelling] Error: Github. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks. Raw Output: {"message": "[OpenSearch.Spelling] Error: Github. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 70, "column": 18}}}, "severity": "ERROR"}

**What you’ll experience:**

* Multi-session memory - Agent remembers you across sessions
* Preference learning - Understands your travel style and preferences
* Context-aware recommendations - Uses past conversations to personalize suggestions
* Semantic memory retrieval - Finds relevant past interactions intelligently

### 🔧 Start with the Basics: Framework Demos

Check failure on line 79 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.HeadingCapitalization] '🔧 Start with the Basics: Framework Demos' is a heading and should be in sentence case. Raw Output: {"message": "[OpenSearch.HeadingCapitalization] '🔧 Start with the Basics: Framework Demos' is a heading and should be in sentence case.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 79, "column": 5}}}, "severity": "ERROR"}

**Prefer to start simple?** Run our standalone demos to understand the fundamentals before diving into the complete use case.

#### What’s included:

* Short-term vs long-term memory patterns

Check warning on line 85 in _posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.LatinismsSubstitution] Use 'compared to or compared with' instead of 'vs'. Raw Output: {"message": "[OpenSearch.LatinismsSubstitution] Use 'compared to or compared with' instead of 'vs'.", "location": {"path": "_posts/2025-12-04-OpenSearch-Agentic-Memory-Integration-with-LangGraph-and-Strands.md", "range": {"start": {"line": 85, "column": 14}}}, "severity": "WARNING"}
* Basic conversation storage and retrieval
* Framework integration examples (e.g., LangGraph and Strands Agent)

View complete documentation in the [README](..)

#### Prerequisites

1. Clone and navigate

```bash
git clone https://github.com/opensearch-project/opensearch-py-ml.git
cd docs/source/examples/agentic_memory
```

2. Install dependencies

```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
```

#### Strands Demos:

* Short-Term Memory

What you'll see: An agent that maintains context during a conversation but starts fresh in new sessions.

```bash
# Configure environment
cp strands/.env.strands-short.example strands/.env.strands-short

# Edit .env.strands-short file with the required configurations

# Run the script
python strands/strands_short_term.py
```

* Long-Term Memory

What you'll see: An agent that recalls information from previous sessions and builds knowledge over time.

```bash
# Configure environment
cp strands/.env.strands-long.example strands/.env.strands-long

# Edit .env.strands-long file with the required configurations

# Run the script
python strands/strands_long_term.py
```

#### LangGraph Demos:

* Short-Term Memory

What you'll see: An agent that maintains context during a conversation but starts fresh in new sessions.

```bash
# Configure environment
cp langgraph/.env.langgraph-short.example langgraph/.env.langgraph-short

# Edit .env.langgraph-short file with the required configurations

# Run the script
python langgraph/langgraph_short_term.py
```

* Long-Term Memory

What you'll see: An agent that recalls information from previous sessions and builds knowledge over time.

```bash
# Configure environment
cp langgraph/.env.langgraph-long.example langgraph/.env.langgraph-long

# Edit .env.langgraph-long file with the required configurations

# Run the script
python langgraph/langgraph_long_term.py
```

### 💡 Which memory type should you use?

**Short-term memory** is ideal for:

* Chatbots and conversational assistants
* Single-session tasks
* Temporary context that doesn't need persistence

**Long-term memory** is ideal for:

* Personal assistants that learn over time
* Customer support with historical context
* Applications requiring knowledge accumulation

## Conclusion

Agentic memory transforms AI agents from tools that forget into intelligent assistants that learn and evolve. With OpenSearch 3.3.0, you now have a powerful, scalable foundation to build agents that remember user preferences, maintain context across conversations, and provide truly personalized experiences.

Whether you're building customer support systems, personal assistants, or conversational applications, the integration examples in this post provide a solid starting point. From the fitness and travel agent notebook to the LangGraph and Strands demos, you have practical patterns to build upon. The choice between short-term and long-term memory patterns gives you the flexibility to match your specific use case, from brief chat sessions to knowledge-building systems that improve over time.

With OpenSearch's agentic memory capabilities, you can create agents that remember, reason, and continuously improve with every interaction.

## What’s next?

* Explore the official documentation for [agentic memory](https://docs.opensearch.org/latest/ml-commons-plugin/agentic-memory/)
* Share your feedback on [OpenSearch forum](https://forum.opensearch.org/)
* Stay tuned for updates as agentic memory capabilities expand in future releases
Loading