Dify Knowledge Base icon

Dify Knowledge Base

Manage Dify AI knowledge base datasets, documents, segments, and metadata with comprehensive CRUD operations

Document → Delete

AI-generated

Overview

The node "Dify Knowledge Base" enables managing AI knowledge base components such as datasets, documents, segments, and metadata through a variety of CRUD (Create, Read, Update, Delete) operations. Specifically, the Document - Delete operation allows users to delete a document from a specified dataset within the Dify AI knowledge base.

This operation is useful when you want to remove outdated or irrelevant documents from your knowledge base to keep it clean and up-to-date. For example, if a document contains obsolete information or was added by mistake, deleting it ensures that it no longer influences AI responses or data retrieval.

Properties

Name Meaning
Dataset ID The unique identifier of the dataset containing the document to be deleted.
Document ID The unique identifier of the document that you want to delete from the specified dataset.

Output

  • The output JSON will typically contain confirmation details about the deletion operation, such as success status or any relevant metadata returned by the API after deleting the document.
  • No binary data output is expected for this operation.

Dependencies

  • Requires an API key credential for authenticating with the Dify AI knowledge base service.
  • The node uses the base URL and authorization token provided in the credentials to make HTTP requests to the Dify API.
  • Proper configuration of these credentials in n8n is necessary for successful execution.

Troubleshooting

  • Common Issues:

    • Invalid or missing Dataset ID or Document ID can cause the operation to fail.
    • Insufficient permissions or invalid API key may result in authorization errors.
    • Attempting to delete a non-existent document will likely return an error from the API.
  • Error Messages:

    • "The operation "delete" is not supported for resource "document": This indicates a misconfiguration or typo in the operation name.
    • API errors related to authentication or resource not found will be passed through; ensure credentials are correct and IDs exist.
  • Resolution Tips:

    • Double-check that Dataset ID and Document ID are correctly set and correspond to existing resources.
    • Verify that the API key credential has the necessary permissions.
    • Use the "Get" or "List" operations first to confirm the existence of the document before attempting deletion.

Links and References

Discussion