Skip to main content
W

dsh-context-kb

why774/dsh-context-kb

Turn long conversations into a searchable per-project memory of raw text, conclusion indexes pinned to exact lines, and pitfalls, so a model that lost its context can still find the original decision and code.

Install

dsh plugin --profile web add github:why774/dsh-context-kb

README

dsh-context-kb

A context knowledge base for DeepSeek Harness. It keeps the raw conversation text, conclusion indexes that point at exact lines, pitfalls, and tool-usage notes in a per-project store, and exposes them to the model as kb_* tools.

The backend is the bundled why774/context-kb command line (vendor/kb/), executed with the local Python 3 interpreter. Nothing leaves the machine.

Tools

ToolPurpose
kb_logAppend raw text to the project knowledge base (initialized on first call)
kb_sealSeal the current segment: move its raw text from session/ to archive/
kb_indexWrite a conclusion index for a sealed segment, optionally pinned to a line range
kb_searchSearch conclusion indexes first, then dig into raw text; long searches the cross-conversation store
kb_readRead raw text by coordinate, e.g. archive/T-20261120-001-p1.md:5
kb_contextTiered context assembly: raw text nearby, summaries further back, pointers far away
kb_hotThe hottest entries for the project (or long for the global store)
kb_statsCounts plus a project-directory sanity check
kb_closeClose the conversation and merge the short-term store into ~/.context-kb

Storage:

  • <project>/.context-kb/talks/<talk id>/ — short-term store, one per conversation; commit it with the project
  • ~/.context-kb/ — the long-term store, one per machine

Requirements

  • Python 3. Interpreter lookup order: DSH_CONTEXT_KB_PYTHON, then the DSH runtime under $DSH_HOME/dsh-runtimes/*/dependencies/python, then python3 / python on PATH.
  • DSH 0.2.x.

Optional environment variables: DSH_CONTEXT_KB_PYTHON (interpreter path) and DSH_CONTEXT_KB_TIMEOUT (per-command timeout in milliseconds, default 60000).

Limitations

  • The short-term store's "current conversation" is tracked per project directory via .context-kb/current. Parallel DSH sessions on the same project share one segment until you seal it.
  • The bundled CLI prints hints such as python scripts/kb.py ...; the plugin appends a note so the model uses the kb_* tools instead.
  • Text memory only — it does not resolve code symbols to definitions.

License

MIT. vendor/kb/ is taken from why774/context-kb, also MIT.

Related plugins