by abesticode ยท v1.0.0
A comprehensive AI Agent tool for managing Dify Knowledge Bases (Datasets). Enables advanced operations including creating, updating, and deleting Datasets and Documents, managing content chunks, retrieving knowledge, and applying granular metadata filtering via the Dify API.
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Author: abesticode
Version: 1.0.0
Type: tool
Repo: https://github.com/abesticode/dify-plugin-knowledge-pro
Knowledge Pro is a comprehensive AI Agent tool designed for managing Dify Knowledge Bases (Datasets) via the Dify API. It provides a complete set of operations for knowledge base maintenance, document management, content chunk manipulation, and metadata filtering.
| Tool | Description |
|---|---|
| Create Dataset | Create new empty knowledge bases |
| List Datasets | Browse available knowledge bases with pagination |
| Get Dataset | Retrieve detailed information about a specific knowledge base |
| Update Dataset | Modify knowledge base settings (name, description, permissions, embedding model, etc.) |
| Delete Dataset | Remove knowledge bases permanently |
| Tool | Description |
|---|---|
| Create Document by Text | Add new documents with text content. Supports advanced options like chunk method, process rules, and metadata assignment |
| List Documents | Browse documents in a knowledge base |
| Get Document | Retrieve detailed information about a specific document |
| Update Document by Text | Update existing document content, process rules, and settings |
| Update Document Status | Enable, disable, archive, or unarchive documents in batch |
| Delete Document | Remove documents permanently |
| Get Indexing Status | Track document embedding progress |
| Tool | Description |
|---|---|
| Add Chunks | Add content segments to documents |
| List Chunks | View all segments in a document |
| Get Chunk Details | Get detailed information of a specific chunk |
| Update Chunk | Modify segment content, keywords, or status |
| Delete Chunk | Remove segments permanently |
| Retrieve Chunks | Search knowledge base with various methods (keyword, semantic, hybrid) |
| Tool | Description |
|---|---|
| List Child Chunks | Get child chunks from a parent segment |
| Create Child Chunk | Add a new child chunk under a parent segment |
| Update Child Chunk | Modify child chunk content |
| Delete Child Chunk | Remove a child chunk from parent segment |
| Tool | Description |
|---|---|
| Add Metadata Field | Define custom metadata fields |
| Update Metadata Field | Rename metadata fields |
| Delete Metadata Field | Remove metadata fields |
| List Metadata | View all defined metadata fields and their IDs |
| List Built-in Metadata | View all built-in metadata fields in a knowledge base |
| Toggle Built-in Metadata | Enable or disable built-in metadata fields |
| Update Document Metadata | Assign metadata values to documents |
| Tool | Description |
|---|---|
| List Knowledge Tags | View all workspace-level knowledge base tags |
| Create Knowledge Tag | Create a new tag for organizing knowledge bases |
| Update Knowledge Tag | Rename an existing knowledge base tag |
| Delete Knowledge Tag | Permanently delete a knowledge base tag |
| List Dataset Tags | View tags bound to a specific knowledge base |
| Bind Knowledge Tags | Attach one or more tags to a knowledge base |
| Unbind Knowledge Tags | Remove one or more tags from a knowledge base |
| Tool | Description |
|---|---|
| List Available Models | Browse available embedding and reranking models |
| List Datasource Plugins | View available datasource plugins for knowledge bases |
| Tool | Description |
|---|---|
| Run Pipeline | Execute a pipeline with specified parameters |
| Run Datasource Node | Run a specific datasource node within a pipeline |
| Upload Pipeline File | Upload a file for use in pipeline processing |
.difypkg filehttps://api.dify.ai/v1)The API_URL and API_KEY credentials come from the Dify Knowledge Base API Access page:
https://api.dify.ai/v1)The Dataset ID can be found in the Knowledge Base URL or settings:
Copy the Dataset ID to use in the tool parameters.
Before assigning metadata to documents, you need to create metadata fields first:
Use the Add Metadata Field tool to define custom fields like product_id, category, etc.
To assign metadata values, you need the metadata field IDs:
Use the List Metadata tool to get the UUIDs of your metadata fields.
When creating or updating documents, configure the following parameters:
Basic Configuration:
Chunk Method & Process Rules:
Metadata Assignment:
Successful Document Creation:
Document with Metadata:
Create a new knowledge base called "Product Documentation" with team access
Add a document named "Getting Started Guide" with the following content to the Product Documentation knowledge base.
Set the product_id metadata to "PROD-001".
Search for information about "installation requirements" in the Product Documentation knowledge base using semantic search
Add a metadata field called "category" to the Product Documentation knowledge base
The PROCESS_RULE parameter controls how documents are segmented and processed. The default is {"mode": "automatic"}, but you can customize it based on your chunk method.
Automatic Mode (default):
{"mode": "automatic"}
Custom Mode for General or Q&A Chunk Method:
When your CHUNK METHOD is General or Q&A, use this format:
{
"mode": "custom",
"rules": {
"pre_processing_rules": [
{"id": "remove_extra_spaces", "enabled": true},
{"id": "remove_urls_emails", "enabled": true}
],
"segmentation": {
"separator": "\n\n",
"max_tokens": 1024,
"chunk_overlap": 50
}
}
}
Hierarchical Mode for Parent-child Chunk Method:
When your CHUNK METHOD is Parent-child, use this format:
{
"mode": "hierarchical",
"rules": {
"pre_processing_rules": [
{
"id": "remove_extra_spaces",
"enabled": true
},
{
"id": "remove_urls_emails",
"enabled": true
}
],
"segmentation": {
"separator": "\n\n",
"max_tokens": 1024,
"chunk_overlap": 50
},
"parent_mode": "full-doc",
"subchunk_segmentation": {
"separator": "\n\n",
"max_tokens": 1024,
"chunk_overlap": 50
}
}
}
| Parameter | Description |
|---|---|
mode | automatic, custom, or hierarchical |
pre_processing_rules | Rules for text cleanup before segmentation |
segmentation.separator | String used to split text into chunks |
segmentation.max_tokens | Maximum tokens per chunk |
segmentation.chunk_overlap | Number of overlapping tokens between chunks |
parent_mode | For hierarchical: full-doc or paragraph |
subchunk_segmentation | Segmentation rules for child chunks (hierarchical only) |
To assign metadata when creating/updating documents:
[
{"id": "actual-field-uuid", "name": "field_name", "value": "field_value"}
]
| Parameter | Required | Description |
|---|---|---|
| API Key | Yes | Dify Knowledge Base API key for authentication |
| Base URL | Yes | Dify API endpoint URL (e.g., https://api.dify.ai/v1) |
The plugin provides descriptive error messages for common issues:
semantic_search for meaning-based querieskeyword_search for exact matcheshybrid_search for best of bothrag tag to plugin manifestcost_info object to JSON response for easy data extractiontokens, cost_usd, embedding_model, cost_per_1m_tokens_usdCostCalculator for centralized cost calculations๐ Major Release โ Comprehensive expansion of the Knowledge Pro plugin with 19 new tools and significant improvements.
retrieve_chunks response parsing for API compatibilityFor issues and feature requests, please contact abesticode.
This plugin is provided as-is for use with the Dify platform.