--- title: "Dify memory: the past.dev plugin for dated recall" description: "Dify memory lasts one conversation. The past.dev plugin on the Dify Marketplace adds Ingest, Recall and Delete data point tools for memory across conversations." canonical: https://past.dev/integrations/dify last-updated: 2026-10-28 --- # Add memory to Dify apps Source: https://past.dev/integrations/dify Dify memory is scoped to one conversation: the LLM node's memory, an Agent app's memory and conversation variables all end with the chat. The past.dev plugin on the Dify Marketplace adds three tools, Ingest, Recall and Delete data point, for Workflow, Chatflow and Agent apps. Recall returns a person's ranked memories with dates and source excerpts, across conversations and apps. The app builder sets the identity in the tool's settings, so the model never chooses it. ## Dify memory scope The [LLM node](https://docs.dify.ai/en/cloud/use-dify/nodes/llm) can enable Memory to include previous interactions of a Chatflow conversation in its prompts. That memory belongs to the node and does not persist between conversations. In an [Agent app](https://docs.dify.ai/en/cloud/use-dify/build/new-agent/overview), each conversation has its own memory, bounded by the model's context window, and a new conversation starts fresh. [Conversation variables](https://docs.dify.ai/en/cloud/use-dify/nodes/variable-assigner) persist across the turns of one chat session. The Variable Assigner node writes them, and later turns read them. - **Memory ends with the conversation.** A returning user starts a new conversation with none of it. - **Conversation variables are application state.** They hold what the workflow writes, for one session. - **History is bounded.** The Agent node's memory window and the model's context window cap how much history the model receives. ## Install the past.dev plugin 1. In the [past.dev console](https://app.past.dev), open **Build › API keys** and create a project key. It starts with `past_sk_`. 2. In Dify, install **past dev** from the [Dify Marketplace](https://marketplace.dify.ai/plugins/pastdotdev/pastdotdev). 3. Open **Tools**, find **past dev** and click **To authorize**. 4. Paste the key into **API key**, leave **API host** empty and click **Save**. Dify checks the key by listing the project's audiences, which uses no credits. Each Ingest and each Recall uses credits from your plan, and Delete data point doesn't. The plugin's source and README are in the [pastdotdev/dify-plugin repository](https://github.com/pastdotdev/dify-plugin). ## The three tools | Tool | Set by the model or the workflow | Set by the app builder | | --- | --- | --- | | Ingest | Content, Label, Occurred at | Identity, Audience, Source ID, Metadata, Idempotency key | | Recall | Query, Occurred from, Occurred to | Identity, Level or Max tokens, Limit, Sort, Query timestamp | | Delete data point | Source ID | None | Recall has two outputs: `text`, the ranked memories with their dates, kinds, source ids and excerpts, ready for a model to read; and `json`, the full API response. Add Delete data point to an Agent app only if the model should be able to delete data points. ## Set the identity in the tool settings Each tool that takes an identity has an **Identity source** setting. **Identity field** uses the value in **Identity**: in a Workflow or a Chatflow, insert a variable such as `{{#sys.user_id#}}` or a user id from your start node. **Dify end-user ID** uses the id Dify gives the person who runs the app, so each end user gets a separate memory. In an Agent app that many people use, pick Dify end-user ID. > **Identity** > > The application sets the identity. The model never chooses it. Recall returns what the identity in the request may read, so take the identity from the signed-in user in code, and keep it out of every value that the model fills. Through the Dify API, `sys.user_id` carries the `user` value your application sends with each call, and Dify does not authenticate that value ([end user identity](https://docs.dify.ai/en/api-reference/guides/end-user-identity)). Call the Dify API from your server, with the signed-in user's id as `user`. ## Example: a Chatflow that remembers returning users 1. Before the LLM node, add the **Recall** tool. Set Query to the user's message and Identity source to **Dify end-user ID**. 2. In the LLM node's prompt, insert Recall's `text` output as context. 3. After the LLM node, add the **Ingest** tool with the user's message as Content and the same identity source. Keep the LLM node's own memory for follow-up questions inside one chat. The plugin carries what should reach the same user in the next conversation, in another app or in another workflow. Recall returns ranked documents with dates and source excerpts. The application decides whether those documents support an answer, contain a disagreement, or are insufficient; HTTP failures are handled separately. ## Or connect the MCP server Dify imports tools from MCP servers that use HTTP transport, on the **MCP** tab of **Integrations › Tools** ([Dify tools](https://docs.dify.ai/en/cloud/use-dify/workspace/tools)). MCP tools work in Agent apps, and in Workflow and Chatflow apps as Tool nodes or inside Agent nodes. The project's end-user MCP server then gives the agent `recall`, `answer` and `who_am_i`, plus `remember` while the project's write toggle is on, with no tool code to write. 1. Turn on the project's end-user MCP server on **Build › MCP server** in the console. 2. Mint an access link there, or with the account server's `create_mcp_access_link` tool. The link has the form `https://api.past.dev/mcp//link/`. It is one URL that is one identity, and the server answers it with no sign-in step. 3. Keep the link out of shared documents, tickets and chat. The secret in its path is the credential. Add the server with the access link as its URL, a name and a server identifier. The link carries its own credential, so the server needs no OAuth registration and no custom header. Every user of an app that calls the server acts as the link's identity. An app that serves several people reads memory through the plugin's tools instead, with **Identity source** set to **Dify end-user ID**. Every call through the link runs as its identity, with that identity's audiences. Mint one link per install, so that a revoked link stops one agent only. When the agent serves several people, mint one link per end user, and connect each request with the link of the user who makes it. Never share one link between users. `remember` writes to the identity's own private audience, and only that identity recalls it. Send data that the whole project must recall through the ingest call. The [end-user server documentation](/docs/mcp/serving-your-own-users) describes the tools, the links and revocation. ## When to use which - Follow-up questions inside one conversation: LLM node memory or the Agent app's memory. - State the workflow tracks during one session: conversation variables. - Facts that must reach a returning user, another app or another workflow, with dates and source excerpts: the past.dev plugin or the MCP server above. The [quickstart](/docs/memory-api/quickstart) shows how to ingest, wait until ingestion completes, and recall. The [benchmarks](/benchmarks) document how recall is measured. [Session memory](/glossary/session-memory) defines the layer Dify provides. ## Frequently asked questions ### Does Dify remember users across conversations? Dify memory and conversation variables last one conversation, and a new conversation starts fresh. Memory across conversations needs a store the app calls, such as the past.dev plugin. ### Do I need code to connect Dify to past.dev? No. Install the plugin from the Dify Marketplace, paste a project key and add the tools to your app. ### Can the model choose whose memory it reads? No. Identity is a tool setting that only the app builder can set, either a fixed value, a workflow variable or the Dify end-user ID. ## Related - [Memory for n8n](https://past.dev/integrations/n8n) - [Memory for Zapier](https://past.dev/integrations/zapier) - [Memory for Flowise](https://past.dev/integrations/flowise) - [Memory for CrewAI](https://past.dev/integrations/crewai) - [Session memory](https://past.dev/glossary/session-memory) - [Quickstart](https://past.dev/docs/memory-api/quickstart)