Get started free
All integrations

Dify Knowledge integration

The knowledge base half of the Dify Service API, for the retrieval corpus a Dify app answers from. Create and configure knowledge bases, add documents from text or from an uploaded file, follow their indexing, read and rewrite the chunks and child chunks a document was split into, run a retrieval query against a base to see exactly what it would return, define and fill the metadata fields used to filter that retrieval, organise bases with tags, drive a knowledge pipeline over an external datasource, and list the embedding, rerank, LLM, text-to-speech, speech-to-text and moderation models the workspace has configured. The host is part of the credential: use api.dify.ai for Dify Cloud, or your own hostname for a self-hosted install. Authentication is a knowledge base API key sent as a bearer token in the Authorization header. That key is issued in the Knowledge section and is NOT the same as an application API key, which is what the separate Dify API uses.

45 toolsTokenAPI docs

What you can do with Dify Knowledge

Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.

Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.

Dataset, 5 operations

  • POSTcreate_knowledge_base

    Create an Empty Knowledge Base.

  • DELETEdelete_knowledge_base

    Delete Knowledge Base.

  • GETget_knowledge_base

    Get Knowledge Base.

  • GETlist_knowledge_bases

    List Knowledge Bases.

  • PATCHupdate_knowledge_base

    Update Knowledge Base.

Metadata, 5 operations

  • POSTcreate_metadata_field

    Create Metadata Field.

  • DELETEdelete_metadata_field

    Delete Metadata Field.

  • GETlist_metadata_fields

    List Metadata Fields.

  • PATCHrename_metadata_field

    Update Metadata Field.

  • POSTset_document_metadata

    Update Document Metadata in Batch.

Segment, 5 operations

  • POSTcreate_chunks

    Create Chunks.

  • DELETEdelete_chunk

    Delete Chunk.

  • GETget_chunk

    Get Chunk.

  • GETlist_chunks

    List Chunks.

  • POSTupdate_chunk

    Update Chunk.

Tag, 5 operations

  • POSTcreate_knowledge_tag

    Create Knowledge Tag.

  • DELETEdelete_knowledge_tag

    Delete Knowledge Tag.

  • GETlist_knowledge_base_tags

    Get Knowledge Base Tags.

  • GETlist_knowledge_tags

    List Knowledge Tags.

  • PATCHupdate_knowledge_tag

    Update Knowledge Tag.

Child chunk, 4 operations

  • POSTcreate_child_chunk

    Create Child Chunk.

  • DELETEdelete_child_chunk

    Delete Child Chunk.

  • GETlist_child_chunks

    List Child Chunks.

  • PATCHupdate_child_chunk

    Update Child Chunk.

Document, 4 operations

  • DELETEdelete_document

    Delete Document.

  • GETget_document

    Get Document.

  • GETlist_documents

    List Documents.

  • PATCHreplace_document_file

    Update Document.

Built in, 2 operations

  • GETlist_built_in_metadata_fields

    Get Built-in Metadata Fields.

  • POSTset_built_in_metadata_fields

    Update Built-in Metadata Field.

Binding, 1 operation

  • POSTbind_tags_to_knowledge_base

    Create Tag Binding.

Create by file, 1 operation

  • POSTcreate_document_from_file

    Create Document by File.

Create by text, 1 operation

  • POSTcreate_document_from_text

    Create Document by Text.

Datasource plugin, 1 operation

  • GETlist_datasource_plugins

    List Datasource Plugins.

Download, 1 operation

  • GETget_document_download_url

    Download Document.

Download zip, 1 operation

  • POSTdownload_documents_as_zip

    Download Documents as ZIP.

File upload, 1 operation

  • POSTupload_pipeline_file

    Upload Pipeline File.

Indexing statu, 1 operation

  • GETget_document_indexing_status

    Get Document Indexing Status.

Model type, 1 operation

  • GETlist_workspace_models

    Get Available Models.

Retrieve, 1 operation

  • POSTretrieve_chunks

    Retrieve Chunks from a Knowledge Base / Test Retrieval.

Run, 1 operation

  • POSTrun_knowledge_pipeline

    Run Pipeline.

Statu, 1 operation

  • PATCHset_document_status

    Update Document Status in Batch.

Unbinding, 1 operation

  • POSTunbind_tag_from_knowledge_base

    Delete Tag Binding.

Update by file, 1 operation

  • POSTupdate_document_from_file

    Update Document by File.

Update by text, 1 operation

  • POSTupdate_document_from_text

    Update Document by Text.

Use Dify Knowledge from Claude Code, Cursor or Codex

Connect Dify Knowledge in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its Dify Knowledge operations become tools the client can call, next to every other integration you connected.

Claude Code
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"
Codex (~/.codex/config.toml)
[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"

[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"
Cursor, Claude Desktop and other JSON configs
{
  "mcpServers": {
    "livecontext": {
      "type": "http",
      "url": "https://livecontext.ai/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Set up the MCP server step by step

How to connect Dify Knowledge

  1. Create your workspace

    Sign up free. Nothing to install.

  2. Connect Dify Knowledge once

    Add your Dify Knowledge connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.

  3. Describe the job in chat

    The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.

Dify Knowledge integration FAQ

What can you do with the Dify Knowledge integration?
LiveContext exposes 45 operations on Dify Knowledge, covering dataset, metadata, segment and tag.

Popular integrations

Browse the whole catalog