memory-router

SKILLAI 工具
AI 工具 未标注权限 许可证不明确
安装这个技能

来自 user_15292d5a 的 Agent Skill,适用于 主流 AI 客户端。

一句话选型结论

按资料字段整理

memory-router是AI 工具类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类AI 工具 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_15292d5a/yjkj-memory-router
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

AI 工具
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_15292d5a仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 community
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791737363
正文体量16.0 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
组合多个 AI 能力

把写作、检索、总结串成一条流程。

搭工作流

把固定流程做成可重复调用的步骤。

做提示词与评测

整理提示词并对比输出效果。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在AI 工具场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
memory-router当前 未标注权限 未标注 未标注 未标注 有
执行计划 只读 GitHub 仓库 151.5 万 Codex、Claude、Cursor 有
Playwright MCP 测试 浏览器控制 ClawHub 市场 136.5 万 OpenClaw 有
完成前的验证 未标注权限 GitHub 仓库 131.9 万 Codex、Claude、Cursor 有
子 Agent 驱动开发 只读 GitHub 仓库 131.2 万 Codex、Claude、Cursor 有
前端设计 执行命令 GitHub 仓库 125.6 万 Codex、Claude、Cursor 有

SKILL.md 全文

16.0 KB
模型实际读到的说明书原文,来自技能仓库

MemoryRouter ⚡

Never lose context. Never forget decisions. Never repeat mistakes.

The memory problem is the single biggest reason agents feel dumb over time. Not the models. Not the prompts. Memory management.

MemoryRouter fixes it with one tool, zero dependencies, zero setup.

The Problem — In 30 Seconds

Agent memory files grow unbounded. After a week, you've got thousands of lines across dozens of files. Every session loads everything — even when the user asks "what's the weather?"

That's tokens burned on irrelevant memories, every interaction, forever.

Then compaction kicks in and details vanish.

The bottleneck isn't the model. It's what the model gets to see.

Why Memory Fails

Failure Mode Cause Fix
Forgets everything Loads irrelevant files, context window fills up Smart manifest — load only what matters
Repeats mistakes Lessons not captured or loaded Entity index + audit for conflicts
Repeats work No session state persistence WAL protocol — write state before responding
Slow responses Loads 50+ files when only 3 matter Token budgeting — cap context window
Duplicates everywhere No automated cleanup --audit finds high-similarity pairs

The Architecture

┌──────────────────────────────────────────────────────┐
│              MEMORYROUTER ⚡                          │
├──────────────────────────────────────────────────────┤
│                                                      │
│  ┌──────────────┐    ┌──────────────┐               │
│  │  AUTO-TIER   │    │  MANIFEST    │               │
│  │  MEMORY.md   │ →  │  GENERATOR   │               │
│  │              │    │              │               │
│  │ Core (always │    │ Required:    │               │
│  │ loaded)      │    │ MEMORY.md    │               │
│  │ + Archive    │    │ Recent logs  │               │
│  │ (on demand)  │    │ Boosted:     │               │
│  └──────────────┘    │ entity files │               │
│                      └──────┬───────┘               │
│                             │                        │
│              ┌──────────────▼──────────────┐         │
│              │  ENTITY RESOLUTION          │         │
│              │  "alice" → preferences.md,         │         │
│              │  notes.md, decisions.md│         │
│              └──────────────┬──────────────┘         │
│                             │                        │
│              ┌──────────────▼──────────────┐         │
│              │  TOKEN BUDGET FILTER        │         │
│              │  20K budget → 7 files       │         │
│              │  100K budget → 16 files     │         │
│              └──────────────┬──────────────┘         │
│                             │                        │
│              ┌──────────────▼──────────────┐         │
│              │  AGENT LOADS ONLY WHAT      │         │
│              │  MATTERS → 70-85% REDUCTION │         │
│              └─────────────────────────────┘         │
└──────────────────────────────────────────────────────┘

Quick Start

Fix a bloated MEMORY.md in one command

node skills/memory-router/memory-router.js --tier

Output:

[memory-router] MEMORY.md: 7809 lines, 309254 chars
[memory-router] ✅ Pre-tier backup: memory/backups/MEMORY-backup-2026-05-23-1234567890.md (7809 lines saved)
[memory-router] Tiered: 202 core sections, 1002 archived
[memory-router] MEMORY.md reduced from 7809 lines to 2222 lines

Preview tiering without making changes

node skills/memory-router/memory-router.js --tier --dry-run

Output:

[memory-router] MEMORY.md: 7809 lines, 309254 chars
[memory-router] ✅ Pre-tier backup: memory/backups/MEMORY-backup-2026-05-23-1234567890.md (7809 lines saved)
[memory-router] ── DRY RUN ──
[memory-router] Would archive: memory/active/MEMORY-archive-2026-05-23.md
[memory-router] Would reduce MEMORY.md from 7809 lines to ~2222 lines
[memory-router] Core sections: 202, Archive sections: 1002
[memory-router] No files were modified.

Restore MEMORY.md from latest backup

node skills/memory-router/memory-router.js --restore

Restores MEMORY.md from the most recent pre-tier backup in memory/backups/.

Generate a smart manifest in one command

node skills/memory-router/memory-router.js --compact

Creates memory/memory-manifest.json — the agent's shopping list of what to load.

With entity boosting

node skills/memory-router/memory-router.js --compact --query "alice"

Files linked to "alice" get priority. No AI, no embeddings — just fast entity resolution.

With a token budget

node skills/memory-router/memory-router.js --compact --budget 20000

Only loads files that fit within 20K tokens. Tight budgets load core only. Generous budgets load archive on demand.

Other commands

node skills/memory-router/memory-router.js --audit      # Find duplicates & conflicts
node skills/memory-router/memory-router.js --status      # Health overview
node skills/memory-router/memory-router.js --entity add alice person preferences.md

How It Works

The Core Insight

Memory management is the bottleneck, not model capability. Every agent system hits the same wall — context window fills up, everything loads, irrelevant memories dilute the signal.

MemoryRouter takes a routing approach rather than a compression approach:

  1. Auto-tiering splits MEMORY.md into core sections (identity, preferences, boundaries — always loaded) and archive sections (everything else, loaded on demand)
  2. Manifest generation creates a per-session file list: which files to load, which to skip, which to boost
  3. Entity-aware boosting links people, projects, and systems to files — search for "alice" → load preferences.md first
  4. Token budgeting caps how many files load based on available context window

The Flow

User query → --compact --query "alice"
              ↓
         Manifest generated
              ↓
         Load required files (MEMORY.md, recent daily logs)
              ↓
         Boost entity-matched files (preferences.md, notes.md)
              ↓
         Agent loads only what matters → 70-85% context reduction

The 4 Engines

⚡ Engine 1: Auto-Tier (--tier)

When MEMORY.md exceeds configurable thresholds (default: 500 lines or 25KB), splits into:
- Core file — Identity, preferences, relationships, projects, patterns, boundaries
- Archive files — Everything else, stored with timestamps in memory/active/

Safety features (v2):
- Pre-tier backup — Every --tier creates a full backup in memory/backups/ before modifying MEMORY.md
- --dry-run — Preview what tiering would do without making changes
- Minimum core size — Aborts if core sections would fall below minCoreLines/minCoreChars thresholds
- --restore — Restore MEMORY.md from the latest backup

Sections are classified by header keywords (identity, preferences, etc.) or by content heuristics.

📋 Engine 2: Manifest Generator (--compact)

Creates memory/memory-manifest.json with a file list:

{
  "generated": "2026-05-21",
  "files": [
    { "path": "MEMORY.md", "tier": "core", "required": true, "size": 50346 },
    { "path": "memory/2026-05-21.md", "tier": "recent", "required": true, "size": 2034 },
    { "path": "self-improving/memory.md", "tier": "domain", "required": false, "size": 670 }
  ]
}

Options:
| Flag | Description |
|------|-------------|
| --query "text" | Entity-aware boosting — files linked to matching entities get priority |
| --budget N | Token budget — only loads files that fit within N tokens |

🔍 Engine 3: Audit Scanner (--audit)

Scans all memory files for:
- High-similarity pairs — Files with >70% text overlap (potential duplicates)
- Revision keywords — "revised", "updated", "changed", "no longer", "actually", "correction" (facts that may have been superseded)

Output: memory/memory-audit-report.md

🏥 Engine 4: Health Monitor (--status)

Quick snapshot of MEMORY.md line/char counts, file counts per directory, archive count, manifest status, entity index size, and WAL state.

Additional Tools

Entity Index (--entity)

Command Description
--entity add <name> <type> <files...> Add entity (e.g., alice person preferences.md)
--entity list List all entities
--entity search <query> Search entities (direct and fuzzy match)

WAL Protocol (--wal)

Command Description
--wal init Initialize SESSION-STATE.md with template
--wal get Show current session state
--wal update <section> --content "<text>" Update a section

Configuration

Edit config.json to customize behavior:

{
  "thresholds": {
    "memoryMdMaxLines": 500,
    "memoryMdMaxChars": 25000,
    "tierArchiveMinAgeDays": 3,
    "auditMaxFiles": 50
  },
  "tiering": {
    "archiveDir": "memory/active",
    "retentionDays": 90,
    "keepInMemory": [
      "identity", "preferences", "relationships",
      "projects", "patterns", "boundaries", "key_facts"
    ]
  },
  "manifest": {
    "generateOnTier": true,
    "manifestPath": "memory/memory-manifest.json"
  },
  "audit": {
    "reportPath": "memory/memory-audit-report.md",
    "duplicateThreshold": 0.7,
    "conflictKeywords": [
      "revised", "updated", "changed", "no longer",
      "actually", "correction", "mistake"
    ]
  }
}
Setting Default Description
memoryMdMaxLines 500 Auto-tier trigger (lines)
memoryMdMaxChars 25000 Auto-tier trigger (characters)
tierArchiveMinAgeDays 3 Minimum age before archiving
retentionDays 90 Archive retention period
keepInMemory see above Headers/keywords that stay in core
generateOnTier true Auto-generate manifest after tiering
duplicateThreshold 0.7 Similarity score to flag as duplicate
conflictKeywords see above Words that signal fact revision
backupDir memory/backups Directory for pre-tier backups
minCoreLines 20 Abort if core sections below this
minCoreChars 1000 Abort if core chars below this

Agent Memory Loading Protocol

When the agent wakes up, use the manifest instead of loading all memory files:

  1. Read memory/memory-manifest.json
  2. Load all required: true files
  3. For required: false files, use memory_search to check relevance
  4. Load only the top 3-5 most relevant optional files

Result: 70–85% context reduction — load what matters, skip the rest.

Heartbeat Integration

Add to your HEARTBEAT.md:

### ⚡ MemoryRouter

- Run `node skills/memory-router/memory-router.js --tier` if MEMORY.md is bloated
- Run `node skills/memory-router/memory-router.js --compact` to update manifest
- Run `node skills/memory-router/memory-router.js --audit` to check for issues
- Check `memory/memory-audit-report.md` for any flagged conflicts

Performance

Metric Result
Tiering speed (8K lines) 25ms
Tiering speed (15K lines) 30ms
Token reduction 96% (7,809 → 222 lines)
File count reduction 53 → 15 files
Memory footprint ~2MB (Node.js runtime)

Comparison

Approach Tokens Saved Setup Effort Maintenance Privacy
Raw file injection 0% None Manual ✅
MemoryRouter 70–85% None Automated ✅
Obsidian vault 40–60% High Medium ⚠️ Cloud
Vector DB (ChromaDB) 70–85% Very High High ✅
mem0 70–85% High Medium ⚠️ Cloud

MemoryRouter gives you the best token savings of the vector DB approach with zero setup effort.

Entity Naming

Pick one canonical name per entity and reuse it consistently:

  • Use full descriptive names: "machine learning" not "ML", "JavaScript" not "JS"
  • Same string after lowercasing = same entity. Different strings = different entities
  • Call --entity search periodically to verify your index

Examples:

# ✅ Good — consistent, descriptive
node memory-router.js --entity add alice person preferences.md
node memory-router.js --entity add openclaw system AGENTS.md

# ❌ Bad — inconsistent, ambiguous
node memory-router.js --entity add alice person preferences.md
node memory-router.js --entity add Alice person notes.md
node memory-router.js --entity add JS person docs.md

Manifest Format

The manifest JSON tells the agent which files to load:

{
  "generated": "2026-05-21",
  "version": 2,
  "query": "memory management",
  "budget": 20000,
  "files": [
    {
      "path": "MEMORY.md",
      "tier": "core",
      "required": true,
      "size": 50346
    },
    {
      "path": "memory/2026-05-21.md",
      "tier": "recent",
      "ageDays": 0,
      "required": true,
      "size": 2034
    },
    {
      "path": "self-improving/memory.md",
      "tier": "domain",
      "required": false,
      "size": 670
    }
  ]
}
Field Type Description
tier string core, recent, domain, or archive
required bool Always load this file
size int File size in bytes
boosted bool Entity match — higher priority
entityMatch string Entity name that matched
load bool Included under budget mode
budgetUsed int Total tokens loaded (budget mode)
budgetEfficiency string Percentage remaining (budget mode)

Troubleshooting

Problem Fix
"No MEMORY.md found" Create one: echo "# MEMORY.md" > MEMORY.md
"Memory directory not found" Create it: mkdir -p memory
Tiering not working Check thresholds — if under 500 lines and 25KB, nothing happens (by design)
Manifest shows wrong files Run --compact again — it regenerates fresh each time
Entity search returns nothing Add entities first: --entity add <name> <type> <files...>
Budget too small Core files always load. Budget only controls optional files.

Security

Built with defense-in-depth:

  • Path validation — rejects file paths outside workspace root
  • Regex escaping — prevents injection in WAL section names
  • Symlink protection — refuses to read/write symlinks
  • Size limits — 10MB max file size
  • Entity name validation — alphanumeric + hyphens/underscores only
  • Content sanitization — prevents header injection in WAL updates
  • Audit keyword validation — rejects regex metacharacters in conflict keywords

Design Principles

  1. Zero user friction — Everything runs automatically during heartbeats
  2. No external dependencies — Pure Node.js, no npm packages
  3. Configurable — Thresholds, keywords, retention policies
  4. Transparent — Generates reports, nothing is silently deleted
  5. Reversible — Archives use dated filenames, original content preserved
  6. Privacy-first — All local, no cloud APIs

常见问题

5 问
答案由本站依据条目字段整理
memory-router怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_15292d5a/yjkj-memory-router。安装方式为未标注。装完刷新技能列表或重开客户端。

memory-router支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

memory-router权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

memory-router收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

memory-router用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。