00080000/dsh-project-memory0

dsh-project-memory

为 DSH 代理提供持久化项目记忆:将 PDF/Markdown/文本及代码符号按工作区索引到可检索存储,并可按来源引用召回,保留问题到解决方案的经验记录。

AI 分析

适合长期开发中的智能代理,需要自动检索项目文档、代码与经验的场景;需持续读取/索引仓库文件。

包名
dsh-project-memory
版本
0.1.0
许可证
MIT
最近更新
2026年8月19日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:00080000/dsh-project-memory

Usage

The tools below are invoked by the agent, not typed by the user. In the chat, just ask naturally — e.g. "index this project" or "what does the auth module do?" — and the agent calls the matching tool automatically. By default (lazyIndexing) files are indexed the moment the model reads them, so memory fills in while you work. watch_repo keeps explicitly-watched roots fresh in the background; index_repo forces a full backfill of a project (unchanged files are skipped).

ToolPurpose
index_doc file_pathIndex one document (PDF/MD/txt): chunk → LLM summary → store with path:line. Unchanged files are skipped.
index_repo rootIndex a whole project: docs get LLM summaries, code files get a zero-token symbol table. Incremental, cleans up deleted files, cross-links docs to symbols.
watch_repo rootEnable automatic refresh: a background poll detects new/changed files (mtime + content hash) and re-indexes only those.
query_memory queryBM25 search over docs + symbols + experience, optionally query-expanded by the LLM. Returns ranked hits with sources and doc→symbol references.
remember problem solutionSave an experience note. Similar problems supersede instead of duplicating.
forget id_or_queryDelete stale experience notes.

Configuration

KeyDefaultMeaning
memoryDir.dsh-project-memorystore directory inside each indexed root
chunkChars3000max chars per document chunk
maxChunksPerFile40max chunks per document
llmQueryExpansionfalseexpand queries via ctx.llm before BM25 (off by default to save tokens)
expansionCount6max expansion variants
lazyIndexingtrueindex files the moment the model reads them (fs/observed)
autoIndexOnFirstUsefalsefull scan of the current working directory on plugin load (opt-in)
watchtrueenable the background refresh
watchInterval15poll interval (seconds)

Toggling features

The two most relevant switches are lazyIndexing (index a file the moment the model reads it; default on) and autoIndexOnFirstUse (full scan of the current working directory on plugin load; default off).

Settings live in the plugin's config object. To change them, add an override entry to your profile's cordis.patch.yml — for the web profile that is ~/.dsh/profiles/web/cordis.patch.yml:

- id: project-memory
  config:
    lazyIndexing: true          # on: index files as the model reads them (default)
    autoIndexOnFirstUse: false  # off: no upfront full scan (default)
    llmQueryExpansion: false    # off: do not spend tokens on LLM query expansion (default)
    watch: true                 # on: background refresh for watched roots (default)
    watchInterval: 15           # poll interval in seconds

Only list the keys you want to change; the rest fall back to the plugin defaults. Verify the result with dsh --profile web --dump-config.

For a one-off run without editing the profile, pass the override as a CLI patch overlay:

dsh web --patch ./config.yml

where config.yml contains the same override block.