Introduction¶
The default full-text search (unicode61) in DeepSeek Harness (DSH) cannot match Chinese substrings, resulting in low retrieval efficiency in scenarios that require cross-session memory. dsh-knowledge-sqlite is designed to solve this problem. Based on the V1.11 community proposal, it provides DSH with a cross-session knowledge management solution that supports Chinese substring retrieval and query expansion.
What Is It?¶
This is a plugin maintained by NinjaSln-labs, with its core built around the ctx.knowledge service interface and knowledge_* model tools. It stores knowledge in SQLite files, uses FTS5 trigram indexes to implement Chinese word-segmentation retrieval, and integrates an L1 query expansion mechanism. The Chinese version of the README (README.zh.md) is the authoritative version.
Core Features¶
The plugin provides the following core capabilities:
- Knowledge management tools: Supports
knowledge_write(write),knowledge_update(update),knowledge_list(list),knowledge_delete(delete), andknowledge_probe(probe/experiment). - Chinese retrieval: Based on SQLite FTS5 trigram, it supports Chinese substring retrieval and solves the problem that traditional full-text search cannot match Chinese text.
- Query expansion: L1 query expansion is enabled by default, improving recall through a single small-model call.
- Data persistence: Supports TTL expiration, the Tombstone mechanism, and DedupeKey deduplication.
- Event emission: Emits
knowledge/written,knowledge/updated, andknowledge/deletedevents when data is written, updated, or deleted. - Permissions and isolation: Implements workspace isolation based on
session.header.cwd; Ask-gated permission control is enabled by default, requiring user approval for writes and deletions.
Installation and Activation¶
Use the official installation command to add the plugin:
dsh plugin add dsh-knowledge-sqlite
Typical Usage¶
Configure plugin parameters in DSH configuration files, such as cordis.patch.yml.
- Configure permissions: Ask-gated is enabled by default and requires user approval. To skip approval, set
gating: 'none'. - Configure database path: Customize the location of the SQLite database file.
- Configure retrieval: Adjust the number of retrieval candidates and the expansion timeout.
# cordis.patch.yml / profile row
- id: knowledge-sqlite
name: 'dsh-knowledge-sqlite'
config:
gating: 'ask'
databasePath: '/custom/data/knowledge.sqlite'
queryExpansion:
enabled: true
timeoutMs: 3000
retrieval:
topN: 20
maxCandidates: 200
authorization:
allowedGlobalWriters: []
Use Cases and Notes¶
- Use cases: Building DSH agents that require long-term memory and precise Chinese retrieval.
- Notes:
- This plugin is based on the V1.11 community proposal and is not an official DeepSeek feature.
- Identity verification is based on
session.header.cwd, ensuring data isolation between different workspaces. - Check the source code and license (MIT) before installation.
- Ask-gated is enabled by default, so the approval logic should be considered in headless deployments.
Conclusion¶
This plugin uses SQLite FTS5 technology to address DSH’s pain point in Chinese retrieval, making it suitable for agent development that requires long-term memory and precise retrieval. See the GitHub repository for more details.