MemOS Lite Memory — Agent Guide
This skill describes how to use the MemOS memory tools so you can reliably search and use the user's long-term conversation history.
How memory is provided each turn
- - Automatic recall (hook): At the start of each turn, the system runs a memory search using the user's current message and injects relevant past memories into your context. You do not need to call any tool for that.
- When that is not enough: If the user's message is very long, vague, or the automatic search returns no memories, you should generate your own short, focused query and call
memory_search yourself. For example:
- User sent a long paragraph → extract 1–2 key topics or a short question and search with that.
- Auto-recall said "no memories" or you see no memory block → call
memory_search with a query you derive (e.g. the user's name, a topic they often mention, or a rephrased question).
- - When you need more detail: Search results only give excerpts and IDs. Use the tools below to fetch full task context, skill content, or surrounding messages.
Tools — what they do and when to call
memory_search
- - What it does: Searches the user's stored conversation memory by a natural-language query. Returns a list of relevant excerpts with
chunkId and optionally task_id. - When to call:
- The automatic recall did not run or returned nothing (e.g. no
<memory_context> block, or a note that no memories were found).
- The user's query is long or unclear —
generate a short query yourself (keywords, rephrased question, or a clear sub-question) and call
memory_search(query="...").
- You need to search with a different angle (e.g. filter by
role='user' to find what the user said, or use a more specific query).
- - Parameters:
query (required), optional minScore, role (e.g. "user"). - Output: List of items with role, excerpt,
chunkId, and sometimes task_id. Use those IDs with the tools below when you need more context.
task_summary
- - What it does: Returns the full task summary for a given
task_id: title, status, and the complete narrative summary of that conversation task (steps, decisions, URLs, commands, etc.). - When to call: A
memory_search hit included a task_id and you need the full story of that task (e.g. what was done, what the user decided, what failed or succeeded). - Parameters:
taskId (from a search hit). - Effect: You get one coherent summary of the whole task instead of isolated excerpts.
skill_get
- - What it does: Returns the content of a learned skill (experience guide) by
skillId or by taskId. If you pass taskId, the system finds the skill linked to that task. - When to call: A search hit has a
task_id and the task is the kind that has a "how to do this again" guide (e.g. a workflow the user has run before). Use this to follow the same approach or reuse steps. - Parameters:
skillId (direct) or taskId (lookup). - Effect: You receive the full SKILL.md-style guide. You can then call
skill_install(skillId) if the user or you want that skill loaded for future turns.
skill_install
- - What it does: Installs a skill (by
skillId) into the workspace so it is loaded in future sessions. - When to call: After
skill_get when the skill is useful for ongoing use (e.g. the user's recurring workflow). Optional; only when you want the skill to be permanently available. - Parameters:
skillId.
memory_timeline
- - What it does: Expands context around a single memory chunk: returns the surrounding conversation messages (±N turns) so you see what was said before and after that excerpt.
- When to call: A
memory_search hit is relevant but you need the surrounding dialogue (e.g. who said what next, or the exact follow-up question). - Parameters:
chunkId (from a search hit), optional window (default 2). - Effect: You get a short, linear slice of the conversation around that chunk.
memory_viewer
- - What it does: Returns the URL of the MemOS Memory Viewer (web UI) where the user can browse, search, and manage their memories.
- When to call: The user asks how to view their memories, open the memory dashboard, or manage stored data.
- Parameters: None.
- Effect: You can tell the user to open that URL in a browser.
Quick decision flow
- 1. No memories in context or auto-recall reported nothing
→ Call
memory_search with a
self-generated short query (e.g. key topic or rephrased question).
- 2. Search returned hits with
task_id and you need full context
→ Call
task_summary(taskId).
- 3. Task has an experience guide you want to follow
→ Call
skill_get(taskId=...) (or
skill_get(skillId=...) if you have the id). Optionally
skill_install(skillId) for future use.
- 4. You need the exact surrounding conversation of a hit
→ Call
memory_timeline(chunkId=...).
- 5. User asks where to see or manage their memories
→ Call
memory_viewer() and share the URL.
Writing good search queries
- - Prefer short, focused queries (a few words or one clear question).
- Use concrete terms: names, topics, tools, or decisions (e.g. "preferred editor", "deploy script", "API key setup").
- If the user's message is long, derive one or two sub-queries rather than pasting the whole message.
- Use
role='user' when you specifically want to find what the user said (e.g. preferences, past questions).
MemOS Lite 记忆 — 智能体指南
本技能描述如何使用MemOS记忆工具,以便您能够可靠地搜索和使用用户的长期对话历史。
每轮对话如何提供记忆
- - 自动召回(钩子): 每轮对话开始时,系统会使用用户当前消息运行记忆搜索,并将相关的过往记忆注入到您的上下文中。您无需为此调用任何工具。
- 当自动召回不足时: 如果用户消息非常长、模糊不清,或者自动搜索返回无记忆,您应自行生成简短、聚焦的查询并调用memory_search。例如:
- 用户发送长段落 → 提取1-2个关键主题或一个简短问题,并用其进行搜索。
- 自动召回显示无记忆或您未看到记忆块 → 使用您推导出的查询(如用户姓名、他们常提及的主题或重新表述的问题)调用memory_search。
- - 当您需要更多细节时: 搜索结果仅提供摘录和ID。使用以下工具获取完整任务上下文、技能内容或周围消息。
工具 — 功能及调用时机
memory_search
- - 功能: 通过自然语言查询搜索用户存储的对话记忆。返回带有chunkId和可选task_id的相关摘录列表。
- 调用时机:
- 自动召回未运行或未返回任何内容(例如,没有
块,或提示未找到记忆)。
- 用户查询较长或不清晰 — 自行生成简短查询(关键词、重新表述的问题或清晰的子问题)并调用memory_search(query=...)。
- 您需要从不同角度搜索(例如,按role=user过滤以查找用户所说内容,或使用更具体的查询)。
- - 参数: query(必填),可选minScore、role(例如user)。
- 输出: 包含角色、摘录、chunkId以及有时包含task_id的项目列表。当您需要更多上下文时,使用这些ID配合以下工具。
task_summary
- - 功能: 返回给定taskid的完整任务摘要:标题、状态以及该对话任务的完整叙述摘要(步骤、决策、URL、命令等)。
- 调用时机: memorysearch命中结果包含task_id,且您需要该任务的完整故事(例如,完成了什么、用户决定了什么、什么失败或成功)。
- 参数: taskId(来自搜索命中结果)。
- 效果: 您获得整个任务的一个连贯摘要,而非孤立的摘录。
skill_get
- - 功能: 通过skillId或taskId返回已学习技能(经验指南)的内容。如果传入taskId,系统会找到与该任务关联的技能。
- 调用时机: 搜索命中结果包含taskid,且该任务属于具有如何再次执行指南的类型(例如,用户之前运行过的工作流程)。使用此工具遵循相同方法或重用步骤。
- 参数: skillId(直接)或taskId(查找)。
- 效果: 您收到完整的SKILL.md风格指南。如果用户或您希望该技能在未来轮次中加载,可以随后调用skillinstall(skillId)。
skill_install
- - 功能: 将技能(通过skillId)安装到工作区,以便在未来的会话中加载。
- 调用时机: 在skill_get之后,当该技能对持续使用有用时(例如,用户的重复工作流程)。可选;仅在您希望该技能永久可用时调用。
- 参数: skillId。
memory_timeline
- - 功能: 扩展单个记忆块周围的上下文:返回周围的对话消息(±N轮),以便您看到该摘录前后的内容。
- 调用时机: memory_search命中结果相关,但您需要周围的对话(例如,接下来谁说了什么,或确切的后续问题)。
- 参数: chunkId(来自搜索命中结果),可选window(默认2)。
- 效果: 您获得该块周围对话的一个简短、线性的片段。
memory_viewer
- - 功能: 返回MemOS记忆查看器(Web UI)的URL,用户可以在其中浏览、搜索和管理他们的记忆。
- 调用时机: 用户询问如何查看他们的记忆、打开记忆仪表板或管理存储的数据。
- 参数: 无。
- 效果: 您可以告诉用户在浏览器中打开该URL。
快速决策流程
- 1. 上下文中无记忆或自动召回未报告任何内容
→ 使用自行生成的简短查询(例如,关键主题或重新表述的问题)调用memory_search。
- 2. 搜索返回包含task_id的命中结果,且您需要完整上下文
→ 调用task_summary(taskId)。
- 3. 任务有您想遵循的经验指南
→ 调用skillget(taskId=...)(或skillget(skillId=...)如果您有ID)。可选地,为将来使用调用skill_install(skillId)。
- 4. 您需要命中结果的确切周围对话
→ 调用memory_timeline(chunkId=...)。
- 5. 用户询问在哪里查看或管理他们的记忆
→ 调用memory_viewer()并分享URL。
编写良好的搜索查询
- - 优先使用简短、聚焦的查询(几个词或一个清晰的问题)。
- 使用具体术语:姓名、主题、工具或决策(例如,首选编辑器、部署脚本、API密钥设置)。
- 如果用户消息较长,推导一个或两个子查询,而非粘贴整条消息。
- 当您特别想查找用户所说的内容(例如,偏好、过去的问题)时,使用role=user。