Long-Term Memory (Hindsight)
2026/9/14 3:17:19 网站建设 项目流程

Long-Term Memory (Hindsight)

【免费下载链接】hindsightHindsight: Agent Memory That Learns项目地址: https://gitcode.com/GitHub_Trending/hindsight2/hindsight

You have access to persistent memory via therecallandretaintools provided by thehindsightMCP server.

At the start of every new task:Callrecall(hindsight server) with a query summarizing the task. Include relevant context from the recalled memories in your response before proceeding.

During a task:Callretain(hindsight server) to store any significant decisions, discoveries, or user preferences as they emerge — don't wait until the end.

At the end of a task:Callretain(hindsight server) with a concise summary of what was accomplished, decisions made, and any patterns worth remembering for future tasks.

Memory persists across sessions. Use it to avoid repeating work and to build on past context.

这段规则把记忆调用切成了三个时机: 1. **任务开始**——用任务摘要作为 query 调 `recall`,把召回到的相关记忆纳入上下文后再动手; 2. **任务进行中**——重要的决策、发现、用户偏好一出现就 `retain`,不等任务结束; 3. **任务结束**——用一段简洁总结(做了什么、做了哪些决策、有哪些值得记住的模式)调 `retain` 落库。 值得注意的实现细节:rules 文件不是安装时临时生成的文本,而是作为包数据随 wheel 一起分发,通过 `importlib.resources` 读取(见 [install.py](https://link.gitcode.com/i/baeb3df69b5ca08d4b13ba5d898fbb63) 的 `rules_text()`),因此无论以 wheel 安装还是从源码运行,写入的内容都来自仓库中的同一份文件。 ## recall 与 retain:Hindsight 暴露的两个 MCP 工具 Hindsight 通过其内置的 `/mcp` 端点恰好暴露两个工具: | 工具 | 说明 | |------|------| | `recall` | 按 query 检索与当前上下文相关的记忆 | | `retain` | 立即将内容写入记忆 | 整条链路可以概括为: ```text New task starts └─ Roo Code rules instruct agent to call recall └─ Relevant memories injected into context Agent working… └─ retain stores decisions/discoveries immediately Task ends └─ Roo Code rules instruct agent to call retain with summary └─ Summary stored for future sessions

【免费下载链接】hindsightHindsight: Agent Memory That Learns项目地址: https://gitcode.com/GitHub_Trending/hindsight2/hindsight

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询