Knowledge Pro
Author: abesticode
Version: 1.0.0
Type: tool
Repo: https://github.com/abesticode/dify-plugin-knowledge-pro
Description
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.
Features
📁 Dataset Operations
📄 Document Operations
🧩 Chunk/Segment Operations
👶 Child Chunk Operations (Hierarchical Mode)
🏷️ Metadata Operations
🏷️ Knowledge Tag Operations
🤖 Model & Datasource Operations
🔄 Pipeline Operations
Installation
- Install the plugin from the Dify Marketplace or upload the file
- Navigate to your Dify workspace settings
- Add the Knowledge Pro tool to your agent
- Configure the required credentials:
- API Key: Your Dify Knowledge Base API key
- Base URL: Your Dify API endpoint (e.g., )
Getting API Credentials
- Go to your Dify Knowledge Base
- Navigate to the API ACCESS page from the left navigation
- Generate a new API key from the API Keys section
- Copy the API key and base URL for configuration
How to Use
Step 1: Authorization
The and credentials come from the Dify Knowledge Base API Access page:
- API Key: Copy from the API Keys section
- Base URL: Your Dify API endpoint (e.g., )
Step 2: Get Dataset ID
The can be found in the Knowledge Base URL or settings:
Copy the Dataset ID to use in the tool parameters.
Step 3: Create Metadata Field
Before assigning metadata to documents, you need to create metadata fields first:
Use the Add Metadata Field tool to define custom fields like , , etc.
Step 4: Get List of Metadata IDs
To assign metadata values, you need the metadata field IDs:
Use the List Metadata tool to get the UUIDs of your metadata fields.
Step 5: Configure Create/Update Document
When creating or updating documents, configure the following parameters:
Basic Configuration:
Chunk Method & Process Rules:
Metadata Assignment:
Step 6: Example Output
Successful Document Creation:
Document with Metadata:
Usage Examples
Creating a Knowledge Base
Adding Documents with Metadata
Searching Knowledge
Managing Metadata
Advanced Usage
Process Rules
The parameter controls how documents are segmented and processed. The default is , but you can customize it based on your chunk method.
Automatic Mode (default):
Custom Mode for General or Q&A Chunk Method:
When your is or , use this format:
Hierarchical Mode for Parent-child Chunk Method:
When your is , use this format:
Process Rule Parameters:
Metadata Assignment
To assign metadata when creating/updating documents:
- First, use List Metadata to get the metadata field IDs
- Then provide the metadata as JSON in the format:
Configuration
Error Handling
The plugin provides descriptive error messages for common issues:
- Invalid API key or authentication failures
- Missing required parameters
- Resource not found errors
- API rate limiting
Best Practices
- Use List Tools First: Before updating or deleting resources, use the corresponding list tools to get the correct IDs
- Monitor Indexing: After creating documents, use Get Indexing Status to track embedding progress
- Organize with Metadata: Use metadata fields to categorize and filter documents effectively
- Choose Search Methods Wisely:
- Use for meaning-based queries
- Use for exact matches
- Use for best of both
Changelog
v0.0.1
- Initial release
- Full CRUD operations for Datasets, Documents, and Chunks
- Metadata management support
- Multiple search methods for retrieval
- Auto create/update document feature
v0.0.2
- Bug fixes and improvements
- Enhanced error handling
v0.0.3
- Added animated SVG icon with floating cubes and search effect
- Updated documentation
v0.0.4
- Added Get Chunk Details tool for retrieving complete chunk information
- Added Child Chunk Operations for hierarchical document structures:
- List Child Chunks
- Create Child Chunk
- Update Child Chunk
- Delete Child Chunk
- Updated API utility module with new endpoints
- Enhanced documentation
v0.0.5
- Added Keyword Search to List Documents tool for filtering documents by name
- Improved List Documents output with document names and IDs
- Added tag to plugin manifest
v0.0.6
- ✨ Embedding Cost Calculation Feature:
- Added configurable Embedding Model selection in provider credentials
- Added Custom Cost input for custom embedding models (cost per 1M tokens)
- Supports preset models: OpenAI (ada-002, 3-small, 3-large), Cohere, Voyage
- All cost calculations now use the configured model rate
- 📊 JSON Response Enhancement:
- Added object to JSON response for easy data extraction
- Fields include: , , ,
- No more regex needed - directly select cost values from JSON!
- 🛠️ Tools Updated with Cost Info:
- Create/Update Document - shows estimated tokens and cost
- Add Chunks - shows actual/estimated tokens and cost
- Get Indexing Status - shows actual tokens and cost after indexing
- 📁 New utility: for centralized cost calculations
v1.0.0
🎉 Major Release — Comprehensive expansion of the Knowledge Pro plugin with 19 new tools and significant improvements.
New Dataset Operations
- Get Dataset — Retrieve detailed info about a specific knowledge base
- Update Dataset — Modify knowledge base settings (name, description, permissions, embedding model, retrieval model, etc.)
New Document Operations
- Get Document — Retrieve detailed info about a specific document including metadata
- Update Document by Text — Update existing document content and settings separately from create
- Update Document Status — Batch enable, disable, archive, or unarchive documents
Knowledge Tag Management (NEW category)
- List Knowledge Tags — View all workspace-level tags
- Create Knowledge Tag — Create new tags for organizing knowledge bases
- Update Knowledge Tag — Rename existing tags
- Delete Knowledge Tag — Remove tags permanently
- List Dataset Tags — View tags bound to a specific knowledge base
- Bind Knowledge Tags — Attach tags to a knowledge base
- Unbind Knowledge Tags — Remove tags from a knowledge base
Built-in Metadata Management (NEW category)
- List Built-in Metadata — View all built-in metadata fields
- Toggle Built-in Metadata — Enable or disable built-in metadata fields
Model & Datasource Discovery (NEW category)
- List Available Models — Browse available embedding and reranking models
- List Datasource Plugins — View available datasource plugins
Pipeline Operations (NEW category)
- 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 pipeline processing
Improvements
- Enhanced existing tools with improved parameter handling and error messages
- Fixed response parsing for API compatibility
- Updated API utility module with all new endpoints
- Expanded provider configuration to register all 41 tools
Support
For issues and feature requests, please contact abesticode.
License
This plugin is provided as-is for use with the Dify platform.