memos-memory-guide

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MemOS Local Memory — Agent Guide

MemOS Local Memory — Agent指南

This skill describes how to use the MemOS memory tools so you can reliably search and use the user's long-term conversation history, share knowledge across agents, and discover public skills.
本技能介绍了如何使用MemOS内存工具,让你能够可靠地搜索和调用用户的长期对话历史、在Agent之间共享知识,以及发现公共技能。

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.
  • Memory isolation: Each agent can only see its own memories and memories marked as
    public
    . Other agents' private memories are invisible to you.
  • 自动召回(hook):在每轮对话开始时,系统会根据用户当前消息运行内存搜索,并将相关的过往内存注入到你的上下文当中。你无需调用任何工具即可获取这些内容。
  • 当自动召回不足以满足需求时:如果用户的消息过长、表述模糊,或者自动搜索未返回任何内存结果,你应当自行生成简短、聚焦的查询语句并主动调用
    memory_search
  • 内存隔离机制:每个Agent只能查看自身的内存以及标记为
    public
    的公共内存。其他Agent的私有内存对你不可见。

Tools — what they do and when to call

工具说明——功能与调用时机

memory_search

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
    . Only returns memories belonging to the current agent or marked as public.
  • When to call:
    • The automatic recall did not run or returned nothing.
    • The user's query is long or unclear — generate a short query yourself and call
      memory_search(query="...")
      .
    • You need to search with a different angle (e.g. filter by
      role='user'
      ).
  • Parameters:
    query
    (required), optional
    minScore
    ,
    role
    .
  • 功能:通过自然语言查询搜索用户存储的对话内存,返回包含
    chunkId
    (可选包含
    task_id
    )的相关片段列表。仅返回当前Agent的内存或公共内存。
  • 调用时机
    • 自动召回未运行或未返回任何结果时。
    • 用户的查询过长或表述模糊时——自行生成简短查询语句并调用
      memory_search(query="...")
    • 你需要从不同角度进行搜索时(例如,通过
      role='user'
      进行筛选)。
  • 参数
    query
    (必填),可选参数
    minScore
    role

memory_write_public

memory_write_public

  • What it does: Writes a piece of information to public memory. Public memory is visible to all agents — any agent doing
    memory_search
    can find it.
  • When to call: In multi-agent or collaborative scenarios, when you have persistent information useful to everyone (e.g. shared decisions, conventions, configurations, workflows). Do not write session-only or purely private content.
  • Parameters:
    content
    (required),
    summary
    (optional).
  • 功能:将一段信息写入公共内存。公共内存对所有Agent可见——任何Agent调用
    memory_search
    都可以找到这些内容。
  • 调用时机:在多Agent协作场景中,当你拥有对所有Agent都有用的持久化信息时(例如,共享决策、约定配置、工作流程等)。请勿写入仅会话有效或纯私有的内容。
  • 参数
    content
    (必填),
    summary
    (可选)。

task_summary

task_summary

  • What it does: Returns the full task summary for a given
    task_id
    : title, status, and the complete narrative summary.
  • When to call: A
    memory_search
    hit included a
    task_id
    and you need the full story of that task.
  • Parameters:
    taskId
    (from a search hit).
  • 功能:根据给定的
    task_id
    返回完整的任务摘要:标题、状态以及完整的叙述性摘要。
  • 调用时机:当
    memory_search
    的结果中包含
    task_id
    ,且你需要获取该任务的完整背景信息时。
  • 参数
    taskId
    (来自搜索结果)。

skill_get

skill_get

  • What it does: Returns the content of a learned skill (experience guide) by
    skillId
    or by
    taskId
    .
  • When to call: A search hit has a
    task_id
    and the task has a "how to do this again" guide. Use this to follow the same approach or reuse steps.
  • Parameters:
    skillId
    (direct) or
    taskId
    (lookup).
  • 功能:通过
    skillId
    taskId
    返回已学习的技能(经验指南)内容。
  • 调用时机:当搜索结果中包含
    task_id
    ,且该任务有“如何重复执行此任务”的指南时。使用该工具可以遵循相同的方法或复用步骤。
  • 参数
    skillId
    (直接指定)或
    taskId
    (通过任务查找)。

skill_search

skill_search

  • What it does: Searches available skills (capabilities/guides) by natural language. Can search your own skills, other agents' public skills, or both — controlled by the
    scope
    parameter.
  • When to call: The current task requires a capability or guide you don't have. Use
    skill_search
    to find one first; after finding it, use
    skill_get
    to read it, then
    skill_install
    to load it for future turns. Set
    scope
    to
    public
    to only see others' public skills,
    self
    for only your own, or leave as default
    mix
    for both.
  • Parameters:
    query
    (required, natural language description of the need),
    scope
    (optional, default
    mix
    : self + public;
    self
    : own only;
    public
    : public only).
  • 功能:通过自然语言搜索可用的技能(能力/指南)。可以搜索自身技能、其他Agent的公共技能,或两者都搜索——由
    scope
    参数控制。
  • 调用时机:当前任务需要你不具备的能力或指南时。先使用
    skill_search
    找到相关技能;找到后,使用
    skill_get
    读取内容,再使用
    skill_install
    将其加载到工作区以便后续使用。将
    scope
    设置为
    public
    仅查看其他Agent的公共技能,
    self
    仅查看自身技能,默认
    mix
    则同时查看两者。
  • 参数
    query
    (必填,对需求的自然语言描述),
    scope
    (可选,默认
    mix
    :自身+公共;
    self
    :仅自身;
    public
    :仅公共)。

skill_install

skill_install

  • What it does: Installs a skill (by
    skillId
    ) into the workspace for future sessions.
  • When to call: After
    skill_get
    when the skill is useful for ongoing use.
  • Parameters:
    skillId
    .
  • 功能:将指定
    skillId
    的技能安装到工作区,以便后续会话使用。
  • 调用时机:在使用
    skill_get
    获取技能内容后,若该技能对后续工作有用时。
  • 参数
    skillId

skill_publish

skill_publish

  • What it does: Makes a skill public so other agents can discover and install it via
    skill_search
    .
  • When to call: You have a useful skill that other agents could benefit from, and you want to share it.
  • Parameters:
    skillId
    .
  • 功能:将技能设置为公共可见,以便其他Agent可以通过
    skill_search
    发现并安装它。
  • 调用时机:当你拥有对其他Agent有帮助的实用技能,并希望共享时。
  • 参数
    skillId

skill_unpublish

skill_unpublish

  • What it does: Makes a skill private again. Other agents will no longer discover it.
  • When to call: You want to stop sharing a previously published skill.
  • Parameters:
    skillId
    .
  • 功能:将技能重新设置为私有。其他Agent将无法再发现该技能。
  • 调用时机:当你希望停止共享之前发布的技能时。
  • 参数
    skillId

memory_timeline

memory_timeline

  • What it does: Expands context around a single memory chunk: returns the surrounding conversation messages.
  • When to call: A
    memory_search
    hit is relevant but you need the surrounding dialogue.
  • Parameters:
    chunkId
    (from a search hit), optional
    window
    (default 2).
  • 功能:扩展单个内存片段的上下文:返回该片段前后的对话消息。
  • 调用时机:当
    memory_search
    的结果相关,但你需要查看该片段周围的完整对话时。
  • 参数
    chunkId
    (来自搜索结果),可选参数
    window
    (默认值为2)。

memory_viewer

memory_viewer

  • What it does: Returns the URL of the MemOS Memory Viewer web dashboard.
  • When to call: The user asks how to view their memories or open the memory dashboard.
  • Parameters: None.
  • 功能:返回MemOS Memory Viewer网页仪表盘的URL。
  • 调用时机:当用户询问如何查看或管理他们的内存时。
  • 参数:无。

Quick decision flow

快速决策流程

  1. No memories in context or auto-recall reported nothing → Call
    memory_search
    with a self-generated short query.
  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=...)
    . Optionally
    skill_install(skillId)
    for future use.
  4. You need the exact surrounding conversation of a hit → Call
    memory_timeline(chunkId=...)
    .
  5. You need a capability/guide that you don't have → Call
    skill_search(query="...", scope="mix")
    to discover available skills.
  6. You have shared knowledge useful to all agents → Call
    memory_write_public(content="...")
    to persist it in public memory.
  7. You want to share a useful skill with other agents → Call
    skill_publish(skillId=...)
    .
  8. User asks where to see or manage their memories → Call
    memory_viewer()
    and share the URL.
  1. 上下文无内存内容或自动召回未返回任何结果 → 调用
    memory_search
    ,传入自行生成的简短查询语句
  2. 搜索结果包含
    task_id
    ,且你需要完整上下文
    → 调用
    task_summary(taskId)
  3. 任务有可遵循的经验指南 → 调用
    skill_get(taskId=...)
    skill_get(skillId=...)
    。若该技能后续有用,可选择调用
    skill_install(skillId)
  4. 你需要获取搜索结果片段的完整周边对话 → 调用
    memory_timeline(chunkId=...)
  5. 当前任务需要你不具备的能力/指南 → 调用
    skill_search(query="...", scope="mix")
    发现可用技能。
  6. 你拥有对所有Agent都有用的共享知识 → 调用
    memory_write_public(content="...")
    将其持久化到公共内存中。
  7. 你希望与其他Agent共享实用技能 → 调用
    skill_publish(skillId=...)
  8. 用户询问如何查看或管理他们的内存 → 调用
    memory_viewer()
    并分享返回的URL。

Writing good search queries

撰写优质搜索查询的技巧

  • Prefer short, focused queries (a few words or one clear question).
  • Use concrete terms: names, topics, tools, or decisions.
  • 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.
  • 优先使用简短、聚焦的查询语句(几个词或一个清晰的问题)。
  • 使用具体术语:名称、主题、工具或决策内容。
  • 如果用户的消息过长,提炼出一两个子查询,而非粘贴整条消息。
  • 当你专门需要查找用户的发言时,使用
    role='user'
    参数。",