zilliztech/memsearch--plugins-dsh2.6k

@zilliz/memsearch-dsh

提供智能体间共享的Markdown记忆与上下文注入

AI 分析

适合需要跨智能体共享记忆、自动捕获对话并注入历史上下文的复杂任务。

套件
@zilliz/memsearch-dsh
版本
0.1.5
授權
MIT
最近更新
2026年9月12日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zilliztech/memsearch#f863056e0b113d44e860dd6abf5bb892781e29ca&path:plugins/dsh

Configuration

The plugin is configured through the profile's cordis.patch.yml config block (patch the memsearch row you inserted). All keys are optional.

KeyTypeDefaultMeaning
captureEnabledbooltrueCapture completed turns into memory.
injectEnabledbooltrueInject returned memory candidates before each turn's first step.
summarizeEnabledbooltrueSummarize turns before writing (on failure a short unavailable note is written, never a raw dump).
summarizeModestringautoSummarizer backend. auto (default) mirrors the other platform plugins: if [plugins.dsh.summarize] provider is set in memsearch config, it uses custom-llm; otherwise dsh-headless (zero-config DSH agent). Explicit dsh-headless / custom-llm pin the backend.

Everything else — provider/model, Milvus, collection, memory dir — comes from memsearch config / environment, exactly like the other platform plugins (no per-plugin config fields):

  • Summarize provider/model[plugins.dsh.summarize] provider / model in ~/.memsearch/config.toml (or [llm.providers.*]; see the custom-llm section below).
  • Milvus[milvus] uri in memsearch config.
  • Collection → derived from the project path (derive-collection.sh), or --collection passed to the memsearch CLI.
  • Memory dirMEMSEARCH_DIR env (explicit → global scope), else /.memsearch.

Maintenance tasks (PROJECT.md / USER.md / skills)

Optional background upkeep, aligned with the other platform plugins. Each task is disabled by default; enable the ones you want in ~/.memsearch/config.toml:

[plugins.dsh.project_review]
enabled = true            # maintain .memsearch/PROJECT.md
[plugins.dsh.user_profile]
enabled = true            # maintain .memsearch/USER.md
[plugins.dsh.memory_to_skill]
enabled = true            # distill recurring workflows into skill candidates
min_occurrences = 3       # how often a workflow must recur before distilling

Common settings per task: provider (native = a one-shot DSH headless agent, default), model, min_interval_hours (default 24), input_dir, output_file. Candidates land in .memsearch/skill-candidates/ (git-tracked) and are never installed automatically — installing is a human step (see the memory-to-skill skill in the other platform plugins).

Example override layer (add this to the profile's own cordis.patch.yml):

- id: memsearch
  config:
    summarizeMode: dsh-headless   # pin the headless backend (default is auto)

Summarization modes

Two backends are available, selected by summarizeMode — the same "configured choice" the Claude Code / Codex / OpenClaw / OpenCode plugins offer (each can summarize with their own LLM or a headless agent + small model). The default (auto) matches theirs: configure a provider and you get a direct LLM call; configure nothing and you get a headless agent.

  • auto (default) — mirrors the other platform plugins:
    • if [plugins.dsh.summarize] provider is set in memsearch config (~/.memsearch/config.toml, same place the other plugins read), use custom-llm with that provider/model;
    • otherwise use dsh-headless (zero-config DSH agent). This means the plugin behaves like the other four: configure a provider → direct LLM; configure nothing → headless.
  • dsh-headless — boots a one-shot DSH headless agent (dsh --profile headless "") to write the notes, mirroring how the other plugins reuse their own agent's headless mode. Zero-config for anyone already using DSH: the sub-agent's model is the deployment's agent-default-model — the user layer of ~/.dsh/settings.yaml (the same selection the Web UI model settings write) wins over any patch, so the [plugins.dsh.summarize] provider/model do NOT apply here — change the model in DSH settings (agent-default-model: in ~/.dsh/settings.yaml, or the Web UI model picker) instead. The boot is asynchronous and fire-and-forget, so the few seconds of headless startup never block the conversation. Requires dsh on PATH or DSH_CLI set to the CLI entry. The sub-agent is booted with MEMSEARCH_DSH_SUMMARIZE=1; the plugin checks that flag and stays inert (no capture / inject / skill) inside the summarizer, so the summarizer's own session is never re-captured in a loop.
  • custom-llmscripts/summarize.py imports memsearch's [llm.providers.*] config and calls the LLM directly. Lightweight: one python process, no DSH boot, no extra CLI dependency. Choose this when you want a specific small model (e.g. an official deepseek-v4-flash key in memsearch config) without booting an agent. Provider selection (most specific first):
    1. [plugins.dsh.summarize] provider (or the summarizeProvider CLI argument summarize.py receives from it) — looked up in [llm.providers.]; a missing entry fails loudly (visible error), never a silent empty write.
    2. llm.provider when it names a configured provider or is a raw type.
    3. compact.llm_provider (deprecated) or openai as a final default.

There is no automatic fallback between modes: the backend you configure (or auto resolves) is the backend used. If it fails (missing dsh CLI, bad provider config), a short unavailable note is written with the reason — the plugin never silently switches to an LLM you did not configure.

A failed summarization writes a short unavailable note (mirroring Claude Code's behavior — memory stays clean, the transcript anchor keeps the raw content reachable for progressive disclosure), and logs a visible warning through the DSH logger.