00080000/dsh-project-memory ↗★ 0
dsh-project-memory
为 DSH 代理提供持久化项目记忆:将 PDF/Markdown/文本及代码符号按工作区索引到可检索存储,并可按来源引用召回,保留问题到解决方案的经验记录。
AI 分析
适合长期开发中的智能代理,需要自动检索项目文档、代码与经验的场景;需持续读取/索引仓库文件。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:00080000/dsh-project-memory说明文档
阅读完整 README ↗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).
| Tool | Purpose |
|---|---|
index_doc file_path | Index one document (PDF/MD/txt): chunk → LLM summary → store with path:line. Unchanged files are skipped. |
index_repo root | Index 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 root | Enable automatic refresh: a background poll detects new/changed files (mtime + content hash) and re-indexes only those. |
query_memory query | BM25 search over docs + symbols + experience, optionally query-expanded by the LLM. Returns ranked hits with sources and doc→symbol references. |
remember problem solution | Save an experience note. Similar problems supersede instead of duplicating. |
forget id_or_query | Delete stale experience notes. |
Configuration
| Key | Default | Meaning |
|---|---|---|
memoryDir | .dsh-project-memory | store directory inside each indexed root |
chunkChars | 3000 | max chars per document chunk |
maxChunksPerFile | 40 | max chunks per document |
llmQueryExpansion | false | expand queries via ctx.llm before BM25 (off by default to save tokens) |
expansionCount | 6 | max expansion variants |
lazyIndexing | true | index files the moment the model reads them (fs/observed) |
autoIndexOnFirstUse | false | full scan of the current working directory on plugin load (opt-in) |
watch | true | enable the background refresh |
watchInterval | 15 | poll 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.