v1.6.1. Other versions may expose different API endpoints.
Setup
Install the Cognee plugin in your Dify workspace, then configure the provider credentials:
You need either an API key or both an email and a password. If you set both, the plugin uses the API key. On save, the plugin runs a health check against the server. It then lists datasets with the API key, or logs in with the email and password.
Cognee Cloud
- Get your tenant URL and API key from the Cognee Cloud dashboard.
- Enter them as Cognee Server URL and API Key. Leave the email and password empty.
Self-hosted server
Run a Cognee1.6.1 server that the plugin can reach:
LLM_API_KEY in a .env file next to the compose file, then run docker compose up -d. Verify that the server is up:
http://localhost:8000 and either an API key or the email and password.
To use an API key with a self-hosted server, create one with POST /api/v1/auth/api-keys:
key into API Key and leave the email and password empty.
If the plugin runs on your host and not inside Docker, use
localhost. If the plugin also runs in Docker, use host.docker.internal. Change the default credentials before production use.Tools
The five memory tools cover most workflows:
The lower-level tools give you finer control:
Remember, Cognify, Improve and Update Data can run for a long time on large datasets. If they time out, raise Dify’s own limits, such as
PLUGIN_DAEMON_TIMEOUT and GUNICORN_TIMEOUT in Dify’s docker/.env.Typical Workflow
- Remember to store text and build the memory in one step.
- Recall before the LLM node, wiring its
answer(orresults_text) into the prompt.
Migrating from Cognee (Self-Hosted)
Earlier versions shipped a separate Cognee (Self-Hosted) plugin (providertopoteretes/cognee_sdk) for email and password login. The Cognee plugin replaces it. It has the same tools, parameters and output variables, plus API-key auth and the tools that used to be cloud-only. An installed cognee_sdk plugin keeps working but gets no more updates. To switch:
- Install Cognee alongside it and configure the same server URL and credentials (or an API key).
- In each workflow, replace every
cognee_sdktool node with the same tool from Cognee. In agent apps, swap the tool in the agent’s tool list. - Uninstall
cognee_sdk.
Trigger Cognee over HTTP (no plugin)
If you already run the conversational layer in Dify and just want to pull memory into a prompt with minimal setup, skip the marketplace plugin and call Cognee’s REST API directly from a Dify HTTP Request node. This works against any self-hosted Cognee OSS server — all routes live under/api/v1/*. See the HTTP API reference and the Deploy a REST API server guide.
1. Get a token
Unless the server runs with auth off (ENABLE_BACKEND_ACCESS_CONTROL=false), first exchange credentials for a JWT. POST /api/v1/auth/login expects form-encoded fields:
{ "access_token": "...", "token_type": "bearer" }. Store access_token in a Dify variable and send it as Authorization: Bearer {{access_token}} on every later call. Tokens expire after JWT_LIFETIME_SECONDS (default 3600), and are revoked earlier if the user’s password changes (see Session revocation on password change).
2. Search from your workflow
Add an HTTP Request node that queries memory before your LLM node, passing the user’s message as thequery:
"only_context": true to get back the prompt Cognee would have sent (instead of a Cognee-generated answer) and feed it to your own model. See search basics for the available search_type values.
To ingest and process data over HTTP too, use
POST /api/v1/add (multipart form: data files + datasetName) followed by POST /api/v1/cognify (JSON: { "datasets": ["my-dataset"] }). Point the URL at whichever backend you deploy — http://localhost:8000 for a local server, or your hosted host name.Plugin source
View the Cognee Dify plugin on GitHub