Knowledge Pro
[Image blocked: Knowledge Pro]
Author: abesticode
Version: 0.0.6
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
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:
[Image blocked: Authorization Setup]
- 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:
[Image blocked: Dataset ID]
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:
[Image blocked: Create Metadata]
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:
[Image blocked: List Metadata]
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:
[Image blocked: Config Part 1]
Chunk Method & Process Rules:
[Image blocked: Config Part 2]
Metadata Assignment:
[Image blocked: Config Part 3]
Step 6: Example Output
Successful Document Creation:
[Image blocked: Output Success]
Document with Metadata:
[Image blocked: Output 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
Support
For issues and feature requests, please contact abesticode.
License
This plugin is provided as-is for use with the Dify platform.