dsh-auto-memory — native persistent memory for your agent (Claude Code-style MEMORY.md, plus auto-consolidation & forgetting) #7790
AskTheWay
started this conversation in
Show Your Plugins!
Replies: 3 comments
|
Bro, give me some advice. |
0 replies
|
非常好的插件,轻量化记忆是对的。但你是如何解决“如何触发自动记忆”的阈值,又如何在对话中自然的通过召回回忆起该有的跨对话记忆的?这对我很重要,期待您的解答 |
0 replies
|
谢谢!这两个问题正好是设计里花时间最多的地方,分开说: 1. 写入触发的“阈值”——两层机制:
2. 召回的“自然性”——靠索引常驻,而不是靠模型想起来: MEMORY.md(一行一条 name + description)注入系统提示词,每个请求都在场——模型不需要“决定要不要查记忆”,开局就知道自己记得什么。这是与 MCP 桥接最本质的区别:MCP 下模型不主动调工具,记忆就不存在。两段式:常驻的只有索引(有字节预算 “自然”的另一半在 description 的质量——它本质是写给未来会话的钩子,所以指导段要求一行讲清这条记忆是什么。 诚实的局限:没有语义检索(无 embedding)。索引到几百条后,靠 description 的字面相关性会变弱——轻量纯文件是这个项目的刻意取舍;几千条记忆 + 语义搜索的场景,MCP 服务器仍然更合适。 更细的取舍在 docs/design.md,欢迎继续讨论。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I kept starting every session from zero — re-telling the agent who I am and what I am building. dsh ships no memory subsystem (the MCP bridge configs need external servers, and nothing reaches the model unless it decides to call a tool), so I ported Claude Code's auto-memory model as a native plugin:
What it does:
user / feedback / project / reference) under$DSH_HOME/memory— plain Markdown, one file per memory, hand-editableMEMORY.mdindex injected into every system prompt: re-evaluated per step, byte-budgeted, and absent entirely when the store is emptymemory_write / read / list / delete / prune / delete_all) with Claude Code's write discipline — dedupe-and-update, absolute dates,[[name]]cross-linksWhy native instead of an MCP bridge: with MCP, memory only exists when the model decides to call a tool, and you run an external server. Here the index rides the system-prompt assembly that already happens every step, so recall is unconditional. (If you need semantic search over thousands of memories, the MCP servers are still the better fit.)
0.2.0 adds things Claude Code doesn't have:
autoSummarize, deduped, capped, silent on failure)memory_readcounts references;staleAfterDayssoft-hides stale zero-read memories from the index;memory_prunelists or deletes themmemory_delete_allrequires human approval — the model can't self-confirm a bulk deleteCrash-safety got the most attention: cross-process locks with orphan-lock recovery, atomic writes, and a guard for the case where a memory named
memorysilently destroysMEMORY.mdon NTFS. 67 tests.No-key demo:
On the awesome-dsh-plugin list, so it shows up in dsh-market too. Feedback welcome — especially on consolidation prompt quality and a sensible default for
staleAfterDays.All reactions