crewai-memorysync
MemorySync memory for CrewAI: the native StorageBackend for CrewAI 1.x. Point Memory(storage=...) at MemorySync and your crews get durable, shared, cross-execution memory driven by CrewAI's own save/recall loop — no manual wiring in your tasks.
pip install crewai-memorysync
The native backend
from crewai import Agent, Crew, Task
from crewai.memory import Memory
from crewai_memorysync import MemorySyncStorage
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
memory=Memory(storage=MemorySyncStorage(user_id="support-crew")),
)
crew.kickoff()
# Every record the crew saved is now stored on MemorySync: it survives
# redeploys and is shared by every service using this user_id. The facts
# in those records show up in Memory Explorer and in recall everywhere.
Or register once and use a string spec anywhere:
from crewai_memorysync import register_memorysync
from crewai.memory import Memory
register_memorysync(user_id="support-crew")
memory = Memory(storage="memorysync")
How records are stored: each CrewAI record is one value in MemorySync's state store — namespace ["crewai"], key = the record id — kept exactly as CrewAI wrote it, embedding included. Records are framework state, not memories, so they do not appear in memory lists or search themselves. Their content is also sent to fact extraction: the durable facts in it become memories, visible in Memory Explorer and recallable from every MemorySync surface (the SDKs, MCP, the other integrations, get_crew_context). Updating a record replaces the facts of its previous version; deleting or resetting records deletes their facts too.
Design guarantees:
- Full protocol — save, vector search, delete, update, get, list, scopes, categories, count, reset, plus honest async twins. Records round-trip exactly, embeddings included.
- Built-in parity — search uses the same score scale (
1/(1+distance)) and filter semantics as CrewAI's bundled LanceDB backend. - Retry-safe — a record has exactly one live value. Saving an identical record again (CrewAI's background executor replays saves) stores and extracts nothing twice; an update replaces the previous version in place.
- Loud failures — CrewAI's save executor silently drops
RuntimeError, so this package never raises one. API failures raiseMemorySyncAPIError; dimension mismatches raise CrewAI's ownEmbeddingDimensionMismatchError; deletes that remove nothing raiseMemorySyncDeleteRefusedError. - Full-wipe guard —
reset(None)and criteria-less deletes are refused unless you construct withallow_full_reset=True.
Agent tools
from crewai import Agent
from crewai_memorysync import create_memorysync_tools
agent = Agent(
role="Personal assistant",
goal="Help using what you know about the user",
backstory="You remember the user's preferences.",
tools=create_memorysync_tools(user_id="customer-7"),
)
Five tools — add_memory, search_memory, list_memories, update_memory, delete_memory — that never raise (failures come back as readable strings) with idempotent writes. read_only=True returns search + list only.
Task context
from crewai_memorysync import get_crew_context
context = get_crew_context("travel preferences", user_id="customer-7")
task = Task(description=f"Plan the trip.\nKnown preferences:\n{context}", ...)
Observability
from crewai_memorysync import attach_memory_logging
attach_memory_logging() # logs every MemorySave*/MemoryQuery* event
Version support
| Package | Requires | Runtime |
|---|---|---|
crewai-memorysync |
crewai >=1.0 <2 | Python 3.10+ |
On an older CrewAI the import fails with a sentence naming the fix — never a half-working crew.
Documentation
Full guide: https://docs.memorysync.io/guides/crewai
Set MEMORYSYNC_API_KEY in the environment (create a key at memorysync.io). The key needs read and write access; deletes and resets also need delete access. MIT licensed.
Metadata
Release files for crewai-memorysync 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| crewai_memorysync-1.1.0.tar.gz | 18.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crewai_memorysync-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.9 kB
Release files / crewai_memorysync-1.1.0.tar.gz
| Download URL | crewai_memorysync-1.1.0.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd3bf5b335aa0164e3e6063211a68c9e963396a8dfea166ad24faeb98cf8ada3
|
|
BLAKE2b-256 checksum How to use checksums |
fd4c528de0bf5b373c728c905cdeeb21d7e6816d76dac68f08d11713d695286a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Release files / crewai_memorysync-1.1.0-py3-none-any.whl
| Download URL | crewai_memorysync-1.1.0-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
090a1fc0fa487429e649718d160f6b262f5c50e2bb7c257fb5ce54f4c5d12a7b
|
|
BLAKE2b-256 checksum How to use checksums |
6ebeae8e4dec9a280b47b39e20f58411298d0f57347105212bbebadfca276be4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Security for crewai-memorysync 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.