ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

Long-Term Memory (Hindsight)

2026/9/14 3:17:19 拓冰建站 浏览量
Long-Term Memory (Hindsight) Long-Term Memory (Hindsight)【免费下载链接】hindsightHindsight: Agent Memory That Learns项目地址: https://gitcode.com/GitHub_Trending/hindsight2/hindsightYou 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 — dont 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 与 retainHindsight 暴露的两个 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),仅供参考