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.

Each badge shows the default agent permission of an endpoint (allowed: an agent calls it without asking; ask first: you are asked before an agent calls it, when the agent or chat asks permission for sensitive actions; never: no agent may call it), which every user can change endpoint by endpoint in their credential settings.

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 basePOSTAgents: ask firstCreate an Empty Knowledge Base.
  • delete_knowledge_baseDelete knowledge baseDELETEAgents: ask firstDelete Knowledge Base.
  • get_knowledge_baseGet knowledge baseGETAgents: ask firstGet Knowledge Base.
  • list_knowledge_basesList knowledge basesGETAgents: ask firstList Knowledge Bases.
  • update_knowledge_baseUpdate knowledge basePATCHAgents: ask firstUpdate Knowledge Base.

Metadata, 5 operations

  • create_metadata_fieldCreate metadata fieldPOSTAgents: ask firstCreate Metadata Field.
  • delete_metadata_fieldDelete metadata fieldDELETEAgents: ask firstDelete Metadata Field.
  • list_metadata_fieldsList metadata fieldsGETAgents: ask firstList Metadata Fields.
  • rename_metadata_fieldRename metadata fieldPATCHAgents: ask firstUpdate Metadata Field.
  • set_document_metadataSet document metadataPOSTAgents: ask firstUpdate Document Metadata in Batch.

Segment, 5 operations

  • create_chunksCreate chunksPOSTAgents: ask firstCreate Chunks.
  • delete_chunkDelete chunkDELETEAgents: ask firstDelete Chunk.
  • get_chunkGet chunkGETAgents: ask firstGet Chunk.
  • list_chunksList chunksGETAgents: ask firstList Chunks.
  • update_chunkUpdate chunkPOSTAgents: ask firstUpdate Chunk.

Tag, 5 operations

  • create_knowledge_tagCreate knowledge tagPOSTAgents: ask firstCreate Knowledge Tag.
  • delete_knowledge_tagDelete knowledge tagDELETEAgents: ask firstDelete Knowledge Tag.
  • list_knowledge_base_tagsList knowledge base tagsGETAgents: ask firstGet Knowledge Base Tags.
  • list_knowledge_tagsList knowledge tagsGETAgents: ask firstList Knowledge Tags.
  • update_knowledge_tagUpdate knowledge tagPATCHAgents: ask firstUpdate Knowledge Tag.

Child chunk, 4 operations

  • create_child_chunkCreate child chunkPOSTAgents: ask firstCreate Child Chunk.
  • delete_child_chunkDelete child chunkDELETEAgents: ask firstDelete Child Chunk.
  • list_child_chunksList child chunksGETAgents: ask firstList Child Chunks.
  • update_child_chunkUpdate child chunkPATCHAgents: ask firstUpdate Child Chunk.

Document, 4 operations

  • delete_documentDelete documentDELETEAgents: ask firstDelete Document.
  • get_documentGet documentGETAgents: ask firstGet Document.
  • list_documentsList documentsGETAgents: ask firstList Documents.
  • replace_document_fileReplace document filePATCHAgents: ask firstUpdate Document.

Built in, 2 operations

  • list_built_in_metadata_fieldsList built in metadata fieldsGETAgents: ask firstGet Built-in Metadata Fields.
  • set_built_in_metadata_fieldsSet built in metadata fieldsPOSTAgents: ask firstUpdate Built-in Metadata Field.

Binding, 1 operation

  • bind_tags_to_knowledge_baseBind tags to knowledge basePOSTAgents: ask firstCreate Tag Binding.

Create by file, 1 operation

  • create_document_from_fileCreate document from filePOSTAgents: ask firstCreate Document by File.

Create by text, 1 operation

  • create_document_from_textCreate document from textPOSTAgents: ask firstCreate Document by Text.

Datasource plugin, 1 operation

  • list_datasource_pluginsList datasource pluginsGETAgents: ask firstList Datasource Plugins.

Download, 1 operation

  • get_document_download_urlGet document download urlGETAgents: ask firstDownload Document.

Download zip, 1 operation

  • download_documents_as_zipDownload documents as zipPOSTAgents: ask firstDownload Documents as ZIP.

File upload, 1 operation

  • upload_pipeline_fileUpload pipeline filePOSTAgents: ask firstUpload Pipeline File.

Indexing statu, 1 operation

  • get_document_indexing_statusGet document indexing statusGETAgents: ask firstGet Document Indexing Status.

Model type, 1 operation

  • list_workspace_modelsList workspace modelsGETAgents: ask firstGet Available Models.

Retrieve, 1 operation

  • retrieve_chunksRetrieve chunksPOSTAgents: ask firstRetrieve Chunks from a Knowledge Base / Test Retrieval.

Run, 1 operation

  • run_knowledge_pipelineRun knowledge pipelinePOSTAgents: ask firstRun Pipeline.

Statu, 1 operation

  • set_document_statusSet document statusPATCHAgents: ask firstUpdate Document Status in Batch.

Unbinding, 1 operation

  • unbind_tag_from_knowledge_baseUnbind tag from knowledge basePOSTAgents: ask firstDelete Tag Binding.

Update by file, 1 operation

  • update_document_from_fileUpdate document from filePOSTAgents: ask firstUpdate Document by File.

Update by text, 1 operation

  • update_document_from_textUpdate document from textPOSTAgents: ask firstUpdate 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