Integration

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.

Ask it in chat

Say what should happen.
The workflow builds itself.

When this happens, do that in Dify Knowledge.Built from the 45 Dify Knowledge tools below, on the connection you add once.

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

  • create_knowledge_baseCreate knowledge basePOSTCreate an Empty Knowledge Base.
  • delete_knowledge_baseDelete knowledge baseDELETEDelete Knowledge Base.
  • get_knowledge_baseGet knowledge baseGETGet Knowledge Base.
  • list_knowledge_basesList knowledge basesGETList Knowledge Bases.
  • update_knowledge_baseUpdate knowledge basePATCHUpdate Knowledge Base.

Metadata, 5 operations

  • create_metadata_fieldCreate metadata fieldPOSTCreate Metadata Field.
  • delete_metadata_fieldDelete metadata fieldDELETEDelete Metadata Field.
  • list_metadata_fieldsList metadata fieldsGETList Metadata Fields.
  • rename_metadata_fieldRename metadata fieldPATCHUpdate Metadata Field.
  • set_document_metadataSet document metadataPOSTUpdate Document Metadata in Batch.

Segment, 5 operations

  • create_chunksCreate chunksPOSTCreate Chunks.
  • delete_chunkDelete chunkDELETEDelete Chunk.
  • get_chunkGet chunkGETGet Chunk.
  • list_chunksList chunksGETList Chunks.
  • update_chunkUpdate chunkPOSTUpdate Chunk.

Tag, 5 operations

  • create_knowledge_tagCreate knowledge tagPOSTCreate Knowledge Tag.
  • delete_knowledge_tagDelete knowledge tagDELETEDelete Knowledge Tag.
  • list_knowledge_base_tagsList knowledge base tagsGETGet Knowledge Base Tags.
  • list_knowledge_tagsList knowledge tagsGETList Knowledge Tags.
  • update_knowledge_tagUpdate knowledge tagPATCHUpdate Knowledge Tag.

Child chunk, 4 operations

  • create_child_chunkCreate child chunkPOSTCreate Child Chunk.
  • delete_child_chunkDelete child chunkDELETEDelete Child Chunk.
  • list_child_chunksList child chunksGETList Child Chunks.
  • update_child_chunkUpdate child chunkPATCHUpdate Child Chunk.

Document, 4 operations

  • delete_documentDelete documentDELETEDelete Document.
  • get_documentGet documentGETGet Document.
  • list_documentsList documentsGETList Documents.
  • replace_document_fileReplace document filePATCHUpdate Document.

Built in, 2 operations

  • list_built_in_metadata_fieldsList built in metadata fieldsGETGet Built-in Metadata Fields.
  • set_built_in_metadata_fieldsSet built in metadata fieldsPOSTUpdate Built-in Metadata Field.

Binding, 1 operation

  • bind_tags_to_knowledge_baseBind tags to knowledge basePOSTCreate Tag Binding.

Create by file, 1 operation

  • create_document_from_fileCreate document from filePOSTCreate Document by File.

Create by text, 1 operation

  • create_document_from_textCreate document from textPOSTCreate Document by Text.

Datasource plugin, 1 operation

  • list_datasource_pluginsList datasource pluginsGETList Datasource Plugins.

Download, 1 operation

  • get_document_download_urlGet document download urlGETDownload Document.

Download zip, 1 operation

  • download_documents_as_zipDownload documents as zipPOSTDownload Documents as ZIP.

File upload, 1 operation

  • upload_pipeline_fileUpload pipeline filePOSTUpload Pipeline File.

Indexing statu, 1 operation

  • get_document_indexing_statusGet document indexing statusGETGet Document Indexing Status.

Model type, 1 operation

  • list_workspace_modelsList workspace modelsGETGet Available Models.

Retrieve, 1 operation

  • retrieve_chunksRetrieve chunksPOSTRetrieve Chunks from a Knowledge Base / Test Retrieval.

Run, 1 operation

  • run_knowledge_pipelineRun knowledge pipelinePOSTRun Pipeline.

Statu, 1 operation

  • set_document_statusSet document statusPATCHUpdate Document Status in Batch.

Unbinding, 1 operation

  • unbind_tag_from_knowledge_baseUnbind tag from knowledge basePOSTDelete Tag Binding.

Update by file, 1 operation

  • update_document_from_fileUpdate document from filePOSTUpdate Document by File.

Update by text, 1 operation

  • update_document_from_textUpdate document from textPOSTUpdate 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