Token导航 LogoToken导航TokenDH.com
效率只读clawhub未标认证来源可访问clear审计通过

memory-attention-router记忆注意力路由器

Agent Skill

memory-attention-router 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

7,491

周安装

306

GitHub Stars

1

下载量

2,424
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:memory-attention-router(记忆注意力路由器)
来源仓库:https://github.com/kaiqiangh/memory-attention-router
安装命令:
openclaw skills install memory-attention-router
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install memory-attention-router

简介

memory-attention-router 实现确定性长期记忆路由,支持多步骤代理工作的内存刷新与重用。

  • 适用于任务依赖性强、需跨会话保持上下文的复杂代理流程管理。
  • 可路由写入、反映和刷新可重用内存,提升代理连续性与决策一致性。
  • 安装命令为 openclaw skills install memory-attention-router,需配置内存存储路径与访问权限。
  • 使用前应评估令牌开销与安全策略,防止敏感信息持久化存储造成泄露风险。

SKILL.md

name
memory-attention-router
description
Deterministic long-term memory routing for OpenClaw. Route, write, reflect on, and refresh reusable memory for multi-step agent work. Use when the task depends on prior sessions, durable user preferences, reusable procedures, past failures, project summaries, or stale memories that need replacement. Trigger on explicit memory phrases like "from now on", "remember this", "always", "prefer", "avoid", "my rule is", "replace my previous rule", and "going forward", and whenever an agent step needs a compact working-memory packet instead of raw history or plain RAG.

Memory Attention Router Skill

Turn long-term memory into a small, role-aware working-memory packet.

Do not use this skill as plain document RAG. Do not dump raw memory lists into model context. Route to the right memory blocks, compose a compact packet, write back new learnings, and retire stale memory when better evidence appears.

Trigger cues

Trigger immediately when the user states a durable rule or asks to preserve or replace memory, especially with phrases like:

  • from now on
  • remember this
  • always
  • prefer
  • avoid
  • my rule is
  • replace my previous rule
  • going forward

Also trigger when a planning, execution, critique, or response step needs compact memory state rather than raw history.

Step roles

Choose the current step role before reading memory:

  • planner
  • executor
  • critic
  • responder

Current type preferences:

  • planner -> preference, procedure, summary
  • executor -> preference, procedure, episode, reflection
  • critic -> reflection, preference, summary
  • responder -> preference, summary, procedure

Important implication:

  • executor should preserve durable hard constraints as well as reusable procedures

Read flow

  1. Build a route request with:

- goal - step_role - session_id if known - task_id if known - user_constraints - recent_failures - unresolved_questions

  1. Run:

python3 {baseDir}/scripts/memory_router.py route --input-json '<JSON>'

  1. Read the packet.
  2. Use the packet in downstream reasoning.
  3. Inspect debug.selected_blocks and debug.selected_memories when you need to understand why a memory was selected.

The router uses a deterministic two-stage flow:

  1. select the best blocks from task_scoped, session_scoped, durable_global, and recent_fallback
  2. score memories only inside the selected blocks

Write flow

Store memory after important outcomes:

python3 {baseDir}/scripts/memory_router.py add --input-json '<JSON>'

Write memory when:

  • a durable user preference or rule is learned
  • a reusable procedure becomes clear
  • a tool result will matter later
  • a failure pattern should influence future behavior
  • a stable summary is worth keeping

If a new memory replaces an older one, include replaces_memory_id. The router will retire the old memory, link it forward to the replacement, and persist a retirement reason.

Reflect flow

At the end of meaningful work or after a failure cluster, create reflection and optionally procedure memory:

python3 {baseDir}/scripts/memory_router.py reflect --input-json '<JSON>'

Use reflection for:

  • lessons
  • warnings
  • failure patterns
  • reusable procedures derived from successful work

Refresh flow

When new evidence invalidates or replaces older memory:

python3 {baseDir}/scripts/memory_router.py refresh --input-json '<JSON>'

Use refresh to:

  • deactivate stale memories
  • mark replacements with replacement_memory_id
  • persist why the memory was retired with refresh_reason
  • create contradiction links when a replacement exists

Packet rules

A good packet contains:

  • hard_constraints
  • relevant_facts
  • procedures_to_follow
  • pitfalls_to_avoid
  • open_questions
  • selected_memory_ids

Current compactness targets:

  • selected_memory_ids -> cap at 5
  • hard_constraints -> cap at 4
  • relevant_facts -> cap at 3
  • procedures_to_follow -> cap at 3
  • pitfalls_to_avoid -> cap at 3
  • open_questions -> cap at 5

Prefer small, high-signal packets over broad recall.

Routing rules

  • Prefer durable, reusable memory over noisy transient notes.
  • Preserve hard constraints for execution steps, not only planning steps.
  • Use support edges to help validated memories win borderline ranking decisions.
  • Treat contradicts edges directionally: penalize the stale target, not the newer memory asserting the contradiction.
  • Use summary instead of verbose raw history when both carry the same signal.
  • Retire stale memory when replacement is clear; do not allow conflicting active memories to accumulate indefinitely.

Bootstrap

Initialize the database:

python3 {baseDir}/scripts/memory_router.py init

Default DB path behavior:

  • if MAR_DB_PATH is set, that path is used
  • otherwise, when installed at <workspace>/skills/memory-attention-router, the default is <workspace>/.openclaw-memory-router.sqlite3

Inspect stored memories:

python3 {baseDir}/scripts/memory_router.py list --limit 20

Inspect one memory:

python3 {baseDir}/scripts/memory_router.py inspect --memory-id <ID>

File guide

See:

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

94.8%
按下载量换算2,298

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills