ChatDev Memory
A memorysync store type for ChatDev (DevAll), OpenBMB’s zero-code multi-agent platform. One pip install makes type: memorysync valid in workflow YAML and adds it to the web console’s store dropdown — semantic recall under a hard budget, honest timestamps, fact extraction from each writing node’s input, and idempotent writes.
How it works
- Install
chatdev-memorysyncinto your ChatDev environment. - A
.pthhook auto-registers the store —type: memorysyncbecomes valid in YAML and appears in the web console dropdown. No code changes to ChatDev. - Declare the store once in your workflow’s
memory:block and attach it to agents. - Retrieved memories arrive in ChatDev’s standard
===== Related Memories =====prompt block; each writing node’s input is sent for fact extraction automatically.
Before you start
- A MemorySync API key. Create one in the dashboard under Settings → API Keys, inside a project.
- A ChatDev (DevAll) checkout running on Python 3.12 or newer.
Install
Inside your ChatDev checkout’s environment:
uv pip install chatdev-memorysync
Activation is automatic: the .pth hook registers the store whenever ChatDev’s modules are importable and silently no-ops anywhere else — installing this package can never affect an unrelated Python environment.
Wire it into a workflow
Step 1 — declare the store
Add a memorysync store to the workflow’s top-level memory: list. user_id is REQUIRED — the config parser rejects a store without it:
graph:memory:- name: user_memorytype: memorysyncconfig:api_key: ${MEMORYSYNC_API_KEY}user_id: customer-42 # REQUIREDsession_id: support
Step 2 — attach it to an agent
Reference the store by name from any agent node. ChatDev’s own attachment knobs (top_k, read, write, retrieve_stage, similarity_threshold) are honored — similarity_threshold filters on real scores:
graph:nodes:- id: writertype: agentconfig:# ... model config ...memories:- name: user_memorytop_k: 5retrieve_stage: [gen]read: truewrite: true
After each agent node that writes to the store (write: true, ChatDev’s default) runs, the store sends that node’s input — the request it received, with ChatDev’s === INPUT FROM … === pipeline headers stripped — to MemorySync as the user’s turn. MemorySync extracts the durable facts in it (preferences, constraints, details about the user) and only those facts become memories; the input text itself is not stored. Agent outputs are not sent. Facts carry surface: chatdev, your session_id, and role: input.
A downstream node’s input is what the upstream nodes produced, and it is sent the same way. To learn only from the user’s own words, keep write: true on the node that receives the user’s request and set write: false on the others (they can still read).
Step 3 — or click it together
In the ChatDev web console, memorysync appears in the store-type dropdown like any built-in store — fill in the same fields and attach it to agents visually. Run the workflow; retrieved memories show up in the agent’s ===== Related Memories ===== block.
Configuration
| Field | Default | Meaning |
|---|---|---|
api_key | ${MEMORYSYNC_API_KEY} | MemorySync API key |
user_id | — (required) | End user the memories belong to — the config parser rejects a store without it |
session_id | chatdev | Session label, recorded on the extracted facts as session_id |
recall_timeout | 1.2 | Hard recall budget in seconds |
store_outputs | false | Accepted for existing workflows; has no effect (agent outputs are not stored as memories) |
base_url | cloud | Override for staging |
Quotas and plan limits
Hitting a monthly plan limit never breaks a workflow run. Over-limit writes are accepted without storing and recalls return empty — agents keep working without the Related Memories block. Evaluation keys instead surface a truthful 429, so limits show up in testing, not production.
Troubleshooting
- `type: memorysync` rejected — the package isn’t installed in the SAME environment ChatDev runs from. Reinstall with
uv pip install chatdev-memorysyncinside the checkout’s venv and restart. - Config error about `user_id` — deliberate: the store refuses to start with all operators sharing one memory partition. Set a real per-user value.
- No Related Memories block — first runs have nothing to recall yet; also check the attachment has
read: trueand the store’s recall didn’t exceed the 1.2s fail-open budget (the log line carries the HTTP status if the service was unreachable). - Re-running a workflow duplicated nothing — that’s the deterministic idempotency seeds working; a re-run of the same input in the same session is recognised server-side and extracted once.
- Facts from agent outputs are missing — by design: agent outputs are not stored as memories, and
store_outputshas no effect. Only the durable facts in a writing node’s input are kept.
Supported versions
| Surface | Requires | Verified on |
|---|---|---|
chatdev-memorysync 1.1.0 | A ChatDev (DevAll) checkout, Python 3.12+ | 38 CI checks against a FRESH clone of OpenBMB/ChatDev main on every push: its real config parser (rejects a missing user_id), registry + dropdown schema visibility, MemoryFactory construction, MemoryManager end to end (our fact lands in the Related Memories block), read/write attachment flags, node-input-only sending (pipeline headers stripped, agent outputs never sent), honest timestamps, budget fail-open with status-bearing logs, seed idempotency, quota modes, and the .pth autoload no-op outside ChatDev |
How it compares
| Mem0 (in-tree store) | Zep | Supermemory | MemorySync | |
|---|---|---|---|---|
| User scoping | ✗ demo YAML hardcodes user_id: project-user-123 — every operator shares one partition | — nothing at all | — nothing at all | ✓ user_id is a REQUIRED config field |
| Slow or down backend | ✗ SDK call with no timeout — the whole agent turn stalls | — | — | ✓ hard 1.2s budget, fails open to no memories |
| Timestamps | ✗ every item stamped time.time() — corrupts ChatDev’s own time-decay scorer (0.7 of ranking weight) | — | — | ✓ the row’s real created_at |
| Retries / re-runs | ✗ duplicate extractions on every re-send | — | — | ✓ deterministic speaker seeds — a re-sent input is recognised server-side and extracted once |
| Failure diagnosis | ✗ bare log + [] — quota, auth, network all look identical | — | — | ✓ fail-open logs carry the HTTP status |