Long-term user memory for Dify apps — recall relevant context before LLM calls, remember new facts, search memories, and manage them across conversations, apps, and every other MemorySync surface.
MemorySync is a hosted memory service: facts a user shares in one conversation are recallable in every later conversation — and from any other MemorySync-connected surface (LangChain, Flowise, n8n, Zapier, Claude Code, and more).
- Source repository: https://github.com/memorysyncio/memorysync-dify
- Documentation: https://docs.memorysync.io/guides/dify
- Privacy policy: PRIVACY.md
- A MemorySync account and API key — sign up at app.memorysync.io (free plan available).
- Outbound HTTPS access from your Dify instance to
api.memorysync.io(or your configured base URL). No inbound connections, webhooks, or other services are required.
- Install the plugin from the Dify Marketplace (or import the
.difypkg). - In app.memorysync.io go to Settings → API Keys and create a key inside a project.
- In Dify, open Plugins → MemorySync → Authorize and paste the key
(
ms_...). Leave Base URL empty for the MemorySync cloud — it exists only for staging environments. Credentials are validated against the live API on save.
| Tool | What it does |
|---|---|
| Recall Context | Returns a prompt-ready block of the user's relevant memories for a query — wire it into any LLM node's context. |
| Remember | Sends the user's message (or a fact about the user) to fact extraction; only the durable facts in it are stored as memories, each with its own id. Node re-runs and retries of the same message are recognised and not processed twice. Assistant messages are not stored as memories. |
| Search Memories | Scored JSON list of matching memories (capped at 25), each with a usable numeric id. |
| Forget Memory | Deletes exactly ONE memory by numeric id, loudly. There is deliberately no delete-everything tool. |
A typical chatflow wires two tools:
- Recall Context runs before your LLM node — pass the user's message as
queryand inject the returnedcontextinto the LLM's system prompt. - Remember runs after the reply — pass the user's message as
content. MemorySync extracts the durable facts in it so future conversations recall them. Assistant replies are not stored as memories, so there is no need to remember them.
Remember reports what happened in its JSON output: status is accepted
(sent to fact extraction, stored_as: "facts"), skipped (nothing saved —
processing_status says why: an assistant message, a message with nothing
worth remembering, or the monthly quota; already_exists: true when the same
message was already sent) or error.
User identity resolves automatically from Dify's runtime user, so each of
your end users gets their own private memory space; an optional user_id
parameter overrides it per call. Sessions are recorded as
dify::<conversation_id>.
Behavior under failure: every call runs under a 10-second budget and returns
structured, branchable JSON (status: ok / error) instead of raising —
a slow or unreachable memory service never hangs a workflow node. Monthly
plan limits degrade silently server-side (writes accepted without storing,
recalls return empty) so production flows keep answering.