| Plugin | Backend | Auth |
|---|---|---|
Cognee (cognee) | Cognee Cloud (hosted) | API key |
Cognee (Self-Hosted) (cognee-sdk) | Your own Cognee OSS server | Email + password |
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:
| Field | Value |
|---|---|
base_url | https://tenant-xxx.aws.cognee.ai/api |
api_key | Your Cognee API key |
Tools
| Tool | Description |
|---|---|
| Create Dataset | Create a new dataset (or return an existing one with the same name) |
| Add Data | Ingest text content into a dataset |
| Add File | Upload files (PDF, DOCX, TXT, …) into a dataset |
| Cognify | Process dataset(s) into a searchable knowledge graph |
| Search | Query the knowledge graph (14 search strategies, top_k, only_context, …) |
| Get Datasets | List all datasets for the authenticated user |
| Get Dataset Data | List all data items in a dataset |
| Delete Dataset | Permanently delete a dataset and its data |
| Delete Data | Delete a specific data item from a dataset |
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:| Field | Value |
|---|---|
base_url | http://localhost:8000 |
user_email | default_user@example.com |
user_password | default_password |
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
| Tool | Description |
|---|---|
| Add Data | Add text data to a dataset |
| Cognify | Build memory from one or more datasets |
| Search | Search the knowledge graph for relevant information |
| Update Data | Replace an existing data item and re-integrate it into memory |
| Delete Dataset | Delete a dataset and all its data |
| Delete Data | Delete a specific data item |
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