MemorySync
Getting Started

Strands Agents Memory

A MemoryStore for Strands Agents: automatic recall injected before every model call under a hard budget, duplicate-proof turn-by-turn extraction, and a crash-proof lifecycle — with zero framework dependencies. Install strands-memorysync from PyPI.

What installs

pip install strands-memorysync

The MemoryManager consults the store before every model call — automatic injection, not tool-gated recall — and routes conversation turns to the store’s extraction sink. The store implements the MemoryStore Protocol by duck typing, so this package has zero framework dependencies and can never version-conflict with your Strands release.

Mem0 (`mem0_memory` tool)Zep (`zep-strands`)SupermemoryMemorySync
Automatic injection✗ tool-gated — the LLM must decide to recall— nothing at all
initialize() safetyshipped an event-loop crash (fix unreleased)✓ deliberately inert; a test asserts zero network calls
First-turn recall✗ 5-turn extraction lag — early recalls return nothing✓ turn-by-turn extraction works from the first exchange
Failure blast radius✗ sync client blocks the event loop✗ errors surface as unhandled AggregateMemoryError✓ search and extraction fail open; only explicit add() raises
Model-facing danger✗ exposes a `delete` action — prompt injection wipes memories✓ search + save only; identity never model-facing
Data at rest✗ default FAISS in /tmp — wiped on restartcloud✓ MemorySync cloud
Framework pinstrands-agents>=1.45✓ zero dependencies
Python floor✗ 3.11 only✓ 3.10 (matches the framework)

Turn-by-turn extraction — no first-turn amnesia

Strands batches conversation turns to the store’s add_messages sink on a configurable cadence. zep-strands keeps the default five-turn batch, so a user’s first exchanges are simply not stored yet — early recalls return nothing by design. MemorySync’s add_turn is cheap and idempotent (deterministic seeds mean a manager retry converges on the same row), so turn-by-turn cadence is safe and recommended: memories are recallable from the very first exchange.

GuaranteeHow
A model call is never stalledsearch waits at most recall_timeout (default 1.2s), then fails open to no memories
A memory outage never breaks the agentsearch returns []; extraction logs and continues — no AggregateMemoryError into your code
Manager retries never duplicateSeeds from role + session + content hash; sequence_numbers recorded for ordering
Tool noise never persistsOnly user and assistant turns store; tool/system messages are skipped
Prompt injection cannot destroy dataNo delete tool exists; deletion stays a human/API action

Memory as agent tools

# The manager exposes its own managed search tool by default; the
# store also offers its @tool pair:
tools = store.get_tools() # memorysync_search + memorysync_save

The official Mem0 strands tool exposes a model-callable delete action — one prompt injection can wipe a user’s memories. Here the model can search and save, nothing else, and the user identity is never a tool parameter.

Configuration

ParameterDefaultMeaning
user_id— (required)End user the memories belong to
session_iddefaultTranscript scope: strands::<session>
top_k5Memories considered per model call
recall_timeout1.2Hard recall budget in seconds
min_prompt_chars8Skip recall for trivial queries
writableTrueAllow the extraction sink to store turns
extractionTrueStrands extraction wiring — {"cadence": 1} recommended
expose_toolsTrueReturn memorysync_search/memorysync_save from get_tools()

Supported versions

SurfaceRequiresVerified on
strands-memorysync 1.0.0A strands-agents release with the MemoryManager seam (2026+, Python 3.10+); the store itself has no framework dependency22 CI checks against the latest strands-agents: the REAL MemoryManager search path and a REAL Agent turn via a stub Model — injected context verifiably reaching the model, the inert-initialize regression (zep-strands’ event-loop crash), fail-open search under the budget, seeded duplicate-proof extraction with sequence metadata, the no-delete-tool assertion, and both monthly-quota server modes

Where to go next

Was this page helpful?