app icon
Knowledge Toolbox
0.0.4

Small tools for working with Dify Knowledge API.

kurokobo/knowledge_toolbox1874 installs

📦 Knowledge Toolbox - Small tools for working with Dify Knowledge API

✨ Overview

Small tools for working with Dify Knowledge API:

  • Get Full Doc
    • Retrieve the full doc by concatenating all the chunks of the specified document in Knowledge.
  • ⚠️ Add File URL to Citations
    • This tool does not work with versions newer than 1.8.1. See below for details.
    • Retrieves download URLs for files included in the results of the Knowledge Retrieval node and returns a list.
  • ⚠️ Download File
    • This tool does not work with versions newer than 1.8.1. See below for details.
    • Retrieve the uploaded file in Knowledge as a JSON, download URL, file object, or file content.

▶️ Demo App

The DSL file of the demo app for this plugin is available on GitHub.

📕 Setup Instructions

After installing the plugin, navigate to the or page and then click on the Knowledge Toolbox plugin to configure it.
By clicking on the button, you can set following fields to use this plugin in your app.

    • The name of the authorization configuration, e.g. , , etc.
    • The base URL of the Dify Knowledge API, with trailing .
    • For example, for Dify Cloud, or for Docker-based self-hosted Dify.
    • The API key for the Dify Knowledge API.
    • You can generate it at > > in the Dify Console.

You can add multiple authorizations for different Dify Knowledge APIs, and can select one of them when using the tools in your app.

🛠️ Bundled Tools

✅ Get Full Doc

This is a tool to retrieve the full doc by concatenating all the chunks of the specified document in Knowledge.
With this tool, for example, you can force the LLM node to always refer to the entire content of a specific document, which is quite useful.

Parameters

    • The ID of the Knowledge to retrieve the uploaded file from.
    • You can find this ID in the URL of each Knowledge page ().
    • The ID of the document that contains the uploaded file.
    • You can find this ID in the URL of each document page ().
    • The string inserted between each chunk while joining them together.

Output Format

As output variable, you can get the full doc of the specified document as a single (big, long) string by concatenating all of its chunks using the specified delimiter.

✅ Add File URL to Citations

⚠️ USE WITH CAUTION ⚠️

  • This tool does not work with Dify versions newer than 1.8.1.
  • This is because the endpoint of the Dify Knowledge API, which this tool relies on, has been removed (see here).
  • If a similar API is implemented again in the future, I'll update this tool, but I don't have an ETA.

This is a tool to retrieve the download URLs for files included in the results of the Knowledge Retrieval node.
With this tool, you can provide the download URLs of the files in the workflow results.

Parameters

    • The result of the Knowledge Retrieval node.
    • However, since Array[Object] cannot be selected directly here, please convert it to a string using a Template node or similar before inputting.
    • See the following section for details.
    • The format of the output. See following section for details.

How to Input

You can input the result of the Knowledge Retrieval node to the parameter as follows:

  • Connect new Template node to the Knowledge Retrieval node.
  • Select () as the of the Template node.
  • Connect new Add File URL to Citations node to the Template node.
  • Select () of the Template node as the of the Add File URL to Citations node.

Output Format

You can choose the output format:

    • Returns a complete object with the metadata of the Knowledge Retrieval node results, adding a field.
    • You can specify this as a context variable in the LLM node. For example, by using prompts such as, "Please present the document you referred to with a download link using the URL in the field", you can show users the actual document instead of just chunks.
    • However, due to technical limitations, if you specify this as a context variable in the LLM node, the chatbot's "Citations" feature will not work.
    • Additionally, depending on the accuracy of the LLM model, the URL may get rewritten during generation, resulting in invalid links.
    • Returns a JSON string with basic information such as file names and download URLs of the referenced documents.
    • For instance, if you provide this JSON to the LLM along with the usual context and have it present download links when needed, you can generate download links while still utilizing the chatbot's Citations feature.
    • However, depending on the accuracy of the LLM model, the URL may get rewritten during generation, resulting in invalid links.
    • Returns a list of Markdown formatted download links for the referenced documents.
    • By including this directly in the Answer node, you can completely prevent the issue of the URL being unintentionally altered by the LLM model and becoming unusable.
    • Returns a collapsible Markdown that contains the referenced chunks and download links for the documents.
    • This can be used to replace the default Citations feature of the chatbot, by placing the output of this tool in the Answer node directly.

✅ Download File

⚠️ USE WITH CAUTION ⚠️

  • This tool does not work with Dify versions newer than 1.8.1.
  • This is because the endpoint of the Dify Knowledge API, which this tool relies on, has been removed (see here).
  • If a similar API is implemented again in the future, I'll update this tool, but I don't have an ETA.

This is a tool to retrieve the uploaded file in Knowledge.
With this tool, you can use Knowledge like a simple file server. This is useful when you want to retrieve specific files or their contents within your workflow and use them as templates, for example.

If you want to retrieve the contents of a file that isn't plain text, the ✅ Get Full Doc tool might be appropriate.

Parameters

    • The ID of the Knowledge to retrieve the uploaded file from.
    • You can find this ID in the URL of each Knowledge page ().
    • The ID of the document that contains the uploaded file.
    • You can find this ID in the URL of each document page ().
    • Format of the output. See following section for details.

Output Format

You can choose the output format of the file:

    • As output variable.
    • Raw response from the Knowledge API: ().
    • As output variable.
    • Download URL of the file.
    • As output variable.
    • Markdown download link of the file.
    • As output variable.
    • File object of the file.
    • As output variable.
    • Content of the file as a string.

🕙 Changelog

See the CHANGELOG.md on GitHub for the latest updates and changes to this plugin.

📜 Privacy Policy

See the PRIVACY.md on GitHub for details on how we handle user data and privacy.

ℹ️ Contact Us

If you have any questions, suggestions, or issues regarding this plugin, please feel free to reach out to us through the following channels:

🔗 Related Links

CATEGORY
Tool
VERSION
0.0.4
kurokobo·09/18/2025 02:50 AM
REQUIREMENTS
Maximum memory
256MB