Cognee (Cloud)
Targets the hosted Cognee Cloud API.Setup
- Get your Base URL and API key from the Cognee Cloud dashboard.
- Install the Cognee plugin from the Dify Marketplace.
- Configure the plugin credentials:
Tools
Cognee (Self-Hosted)
Targets a local or self-hosted Cognee OSS server. Tested with Cogneev0.5.5.
Run a Cognee server
LLM_API_KEY (via .env for Docker) and start the server, then verify it:
Setup
In the Dify plugins page, find Cognee (Self-Hosted) and configure:
The plugin validates the configuration with a health check and login.
The plugin runs on your host (not inside Docker), so use
localhost. If you run the plugin inside Docker too, use host.docker.internal. Change the default credentials before production use.Tools
The self-hosted plugin authenticates with email + password (not an API key), adds an Update Data tool, and does not include the cloud-only Add File / Create Dataset tools.
Typical Workflow
Both plugins follow the same pattern inside a Dify app or workflow:- Add Data (or Add File) to ingest content into a dataset
- Cognify to build the knowledge graph
- Search before LLM calls to pull relevant context from memory
- Delete Dataset / Delete Data to clean up
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).
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 just the retrieved context (instead of a Cognee-generated answer) and feed it into your own prompt. 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.Cloud plugin source
View the Cognee Cloud Dify plugin
Self-hosted plugin source
View the self-hosted Dify plugin