Skip to main content
Integrate Mem0 with Strands Agents, AWS’s open-source SDK for building AI agents. The strands-mem0 package ships a native MemoryStore, so recall and writes happen automatically inside the agent loop, not as tool calls the model has to remember.

Overview

  1. A MemoryStore the MemoryManager drives on every turn: it searches Mem0 and injects the results into the prompt, and writes memory back when extraction is enabled.
  2. Server-side extraction: because the store implements add_messages, enabling extraction routes raw conversation turns to Mem0’s own extraction pipeline, with no extra client-side model call.
  3. Works with the hosted Mem0 Platform (an API key) or self-hosted Mem0 OSS (a config dict).

Prerequisites

Before setting up Mem0 with Strands, ensure you have:
  1. Installed the required packages:
  1. A valid API key:

Basic Integration Example

Hand a Mem0MemoryStore to a MemoryManager, and the agent gets automatic recall and memory writes:
Scope memories with any of user_id, agent_id, run_id, or app_id (app_id is platform-only). Pass max_search_results to bound how many memories are injected per turn.

Self-hosted Mem0 (OSS)

To run against self-hosted Mem0 instead of the platform, pass a config dict:

Explicit memory tool

If you want the model to call memory explicitly instead of (or alongside) the automatic store, use the mem0_memory tool from strands-agents-tools. A store and the tool can share the same Mem0 backend and namespace.

Learn more