Introduction¶
When running agents in DeepSeek Harness (DSH), tool failures, non-zero command exits, and LLM request errors are common. The model debugs from scratch every time, while humans often have already fixed similar issues in a previous round or another session. Writing solutions into ERRORS.md or chat logs can help, but retrieval relies on keywords—if the environment changes slightly, the match may fail—and it is also difficult to feed known fixes back to the model before a failure occurs.
Error Knowledge Base takes a different path: locally sanitize, normalize, and fingerprint failures, then write them into PostgreSQL; when the same failure occurs again, it first returns the recorded solution, matched cause, and trust score from the database—without invoking the model or making external network requests at the core level. The DSH adapter package in the repository is named dsh-errkb, sharing the same backend with the CLI, daemon, and MCP. Below is what it is, what it can do, and what to watch for when using it alongside DSH.
What Is This¶
Error Knowledge Base (error-knowledge-base) is a local error knowledge base for LLM tool and command-line workflows, maintained by jingchangzhao-gif. On the DSH side, it is integrated via the Cordis plugin err-kb (npm package dsh-errkb): the adapter converts host events into ErrorEvent v1, passes them via Named Pipe to the local errkb daemon, so that classification, sanitization, fingerprinting, storage, and retrieval are not reimplemented in each host.
Project status (2026-10-22): the README marks it as an acceptance candidate, not yet officially released; core, schema, CLI, daemon, MCP, DSH/Codex/Claude connectors, and the Windows Web toolbox are implemented, while clean-VM acceptance and tagged official releases are still in progress. The GitHub repository currently has about 1 star. The community directory SkillHub classifies it as “memory”; it has no official affiliation with DeepSeek / High-Flyer, and is merely a third-party listing site in the DSH ecosystem.
Core Features¶
Closed-Loop Capabilities Related to DSH¶
| Stage | What it roughly corresponds to in DSH |
|---|---|
| Observe | Plugin hooks capture failures from tool, command, llm, agent sources (capture configurable) |
| Protect | Sanitize keys, credentials, emails, and home directory paths before writing to the DB, per spec/redact.cue |
| Identify | Normalize text and compute a 12-hex-digit fingerprint; the same failure yields the same fingerprint |
| Retrieve | Exact match first, then limited fuzzy candidates (up to 3; approximate matches require manual confirmation) |
| Reuse | Inject known solutions before the model diagnoses again: resident system-prompt hints, post-execute / pre-step notifications |
| Learn | Record solution success/failure via errkb feedback or connectors; trust computed by SQL function errkb_trust() |
The connector matrix (tested 2026-10-20) records: DSH 0.2.0-rc.2 + this tree’s dsh-errkb 0.0.0 uses Channel A (plugin hooks), supporting pre-diagnosis return—different from the generic CLI wrapper (which prints solutions only after failure). Acceptance record see EKB-039 / PR #66; the tools/result path in real sessions remains listed under the “unverified” gap.
Five Tool Categories Exposed by the Plugin¶
The adapter registers five tools with DSH (via the local core, without reimplementing matching logic):
err_lookup: retrieve known issues and solutions by id, fingerprint, or texterr_record: record issues from messages (can work with core capture)err_list: list issues or solutionserr_forget: mark an issue as wontfix (no physical deletion)err_stats: counts and notification statistics
Additionally, there is an agent/request-error waterfall hook: it records LLM request failures bypass, without changing downstream retry strategies.
Default Connections and Example Configuration¶
The plugin communicates with the daemon via Named Pipe \\.\pipe\errkb by default (pipeTimeoutMs defaults to 10000). The bundle example in cordis.patch.yml only writes out the two fields from the README example; the remaining fields use the defaults from Config in src/index.ts:
- insert:
- id: err-kb
name: dsh-errkb
config:
fuzzyThreshold: 0.72
inject: hit-only
package.json declares dsh.bundle.patch: ./cordis.patch.yml; after adding this package to a profile, it automatically merges the above layer without manual profile patch edits. Peer dependencies include @deepseek-ai/cordis 4.0.2, @deepseek-ai/dsh-llm / @deepseek-ai/dsh-tools ^0.1.5-rc.2, etc.; the README records the plugin built against lockfile-resolved 0.1.5-rc.3, with host 0.2.x (tested 0.2.0-rc.2).
Installation and Enabling¶
The DSH plugin depends on a locally migrated PostgreSQL and a running errkb daemon. The README emphasizes: there is currently no supported one-click install; do not mix dist\ with dist\release\....
1. Prepare PostgreSQL and the errkb Backend¶
Development workspace flow (Windows, excerpted from the README quick start):
- Install PostgreSQL 16 (or create a dedicated instance on port 5433 via the installer), note the DSN.
- Build and migrate the schema:
go build -o errkb.exe ./cmd/errkb
.\errkb.exe db migrate --dsn "postgres://postgres@127.0.0.1:5433/errkb?sslmode=disable" --migrations .\db\migrations
- Start the background service:
.\errkb.exe daemon --dsn "postgres://postgres@127.0.0.1:5433/errkb?sslmode=disable"
The daemon provides a Named Pipe API; HTTP is disabled by default. errkb doctor can run eight read-only environment checks.
2. Build the DSH Adapter¶
The repository root is the npm package dsh-errkb, requiring Node.js >= 22.13 (packageManager: pnpm 11.7.0). Commands from the development section:
pnpm install
pnpm build
pnpm build uses tsdown to produce lib/, the connector bundle loaded by DSH.
3. Install into the DSH Profile¶
The README’s known limitations states: the DSH plugin is still awaiting store review; manual installation is currently the supported path. The SkillHub directory page shows it as installable, version v0.0.0, but this does not replace the above status note. Before installing, read the repository source and the MIT license yourself; the plugin runs with the same permissions as the DSH process.
The official documentation does not provide a standalone dsh plugin add … excerpt; the manual path means: after completing pnpm build locally, per the documentation of your DSH version, install the repository root directory (including lib/, cordis.patch.yml, package.json) as a third-party bundle into the target profile—the bundle patch automatically registers err-kb. If instead you use the errkb run -- wrapper for agent commands, the plugin hook is bypassed, and host fields like session_id, tool_name are lost (the degradation note in the connector matrix).
Typical Usage¶
First Verify the “Model-Free” CLI Closed Loop¶
Before connecting DSH, you can use the wrapper to confirm the backend and retrieval chain work (README and docs/e2e-cli-loop.zh-CN.md):
.\errkb.exe run --connector cli --session demo --project demo -- cmd /c "exit 9"
The first failure creates an issue with no solution yet; after writing a solution via MCP (err_record_solution) or the product API, running the same command again will make the wrapper print the known solution, source, and trust score. No chat model is invoked throughout.
Expected Behavior in DSH Sessions¶
When the daemon is reachable and the plugin is loaded (matrix-tested environment):
- Failures are written to the core via the adapter, and post-execution notifications may be received in the session.
- Resident system-prompt hints and settings like
inject: hit-onlycontrol whether long text is injected only on hits. - The agent can proactively call tools like
err_lookupto query records in the database.
The specific log format depends on your local DSH 0.2.x and headless/desktop profile; do not treat rows not tested in the matrix as supported capabilities.
Common Operational Commands¶
The errkb CLI (same binary) alongside the plugin supports search, statistics, and feedback, e.g.:
.\errkb.exe search <issue-id|fingerprint|text>
.\errkb.exe feedback <issue-id> <solution-version-id> --outcome success --json
.\errkb.exe stats --json
Configuration is a single YAML, validated by spec/config.cue; it shares database.dsn, retention, and other fields with the daemon (see the “Configuration” section of the README).
Applicable Scenarios and Cautions¶
For whom: Developers on Windows who long-term use DSH for coding agents, want to distill recurring technical errors into a locally searchable knowledge base with measurable trust, and are willing to maintain PostgreSQL and the errkb service.
What it is not: Not a chat model, not a full log archive, not a cloud service; approximate matches are not automatically reused, and the UI and JSON will mark APPROXIMATE — confirm before reuse.
Environment and delivery: The background service, Named Pipe, and Windows connector target Windows 10/11 x64; PostgreSQL 16 is a hard runtime dependency. As of 2026-10-22, the release package remains an acceptance candidate, and the installer and dist/ artifacts have not been finally signed off on a clean VM.
Security and privacy: Data stays local; sanitization is done before writing to the DB. Installing unsigned release artifacts may trigger SmartScreen; the README recommends verifying SHA256SUMS.
Conclusion¶
Error Knowledge Base turns “diagnose once, return the fix directly next time” into a local closed loop; the DSH plugin dsh-errkb handles capture on the host side and pre-diagnosis injection, without reimplementing fingerprinting and retrieval in the backend. If you want to verify functional boundaries and the tested matrix, refer to the repository documentation.
- Community directory: https://www.skillhub.cn/plugins/jingchangzhao-gif/error-knowledge-base
- Source and README: https://github.com/jingchangzhao-gif/error-knowledge-base (includes README.zh-CN.md)