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()
# Everything the crew remembered is now durable server rows: it survives
# redeploys, is shared by every service using this user_id, and shows up
# in Memory Explorer.
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")
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 — every write carries an idempotency seed; CrewAI's background-executor replays store nothing twice, and updates supersede safely.
- Loud failures — CrewAI's save executor silently drops
RuntimeError, so this package never raises one. 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). MIT licensed.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crewai_memorysync-1.0.0.tar.gz.
File metadata
- Download URL: crewai_memorysync-1.0.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b74429b207474496af6daf1ce113850c4eea7f07c2769b75f8cdef79e756aebe
|
|
| MD5 |
a3ef2c89347df0bc25b06e022c429a54
|
|
| BLAKE2b-256 |
a3191ea8c918143430a1247308990e836a842c2895baacad941dad6986aa9b9d
|
File details
Details for the file crewai_memorysync-1.0.0-py3-none-any.whl.
File metadata
- Download URL: crewai_memorysync-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57f635a8aa3f4de5a14626123989b84dc87778d7fd2f13145f23216cf0d2e7d1
|
|
| MD5 |
41642eec13644671311ae4f45bd5a650
|
|
| BLAKE2b-256 |
2e5e76142940a94801f6f9c948d11ac8e6cca1ed00bcf79737b2ba4368d70eb6
|