长期记忆 #484
le-temps
started this conversation in
Show Your Plugins!
长期记忆
#484
Replies: 0 comments
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.
做了一个小插件,让 agent 在不同会话之间保留记忆。
思路很简单:不在后台自动总结,而是直接给 agent 几个工具(core_memory_append、core_memory_replace、core_memory_delete、core_memory_reflect),让它自己决定记什么、改什么、删什么。记忆存在项目下的 .agents/memory.json 里,每次会话启动时注入到 system prompt 中。
这样 agent 就能记住项目上下文、用户习惯和以前踩过的坑,不需要额外的数据库或向量存储。
方案参考了 MemGPT 的 core memory 设计,做成了 Cordis 插件的形式。
仓库地址:https://github.com/le-temps/dsh-plugins-hub/tree/main/packages/agent-memory
如果官方已经有类似的规划,或者有比 systemPrompt.section() 更合适的接入点,欢迎指出。
All reactions