Memory Router
Paste the following prompt into your AI chat to install this skill:
Install @user_15292d5a/yjkj-memory-router according to https://skillhub.cn/install/skillhub.md.
About this skill
The Problem
When MEMORY.md grows to thousands of lines, agents often still load every memory file in each session. Irrelevant preferences, project notes, and old corrections enter the context window, while compaction may erase important decisions. MemoryRouter addresses a memory-loading strategy problem rather than model capability.
How It Works
It treats a local memory directory as a routable resource instead of a file pile.
- Auto-tiering: --tier splits MEMORY.md into always-loaded core sections and on-demand archives, with pre-tier backups in memory/backups/.
- Manifest generation: --compact writes memory/memory-manifest.json, using fields such as required, boosted, and load to control what the agent reads.
- Entity routing: --query "alice" or --entity add links people, projects, or systems to files so matches load first.
- Audit and health checks: --audit finds high-similarity files and revision keywords like revised or no longer; --status reports line counts, file counts, manifest state, and WAL state.
- Session state: --wal init/get/update stores current session state in SESSION-STATE.md, reducing repeated work and lost state.
Boundaries
It fits local, file-based agent memory without vector stores or cloud APIs, but you still need a maintained MEMORY.md, a memory/ directory, and consistent entity names. Token budgets mainly constrain optional files while core files load; tiering archives dated copies instead of deleting originals. If thresholds are not met, --tier does nothing.
Use Cases
- Set up local memory for a long-running AI agent without reading the entire memory directory each session.
- Split MEMORY.md into core preferences and generate a per-session loading manifest after it exceeds 500 lines.
- Audit memory files for duplicates, superseded revised decisions, and high-similarity entries.
- Link entities like alice or project names to preference files so matching files load first.
Best For
- Engineers maintaining AI agent memory directories who need to control which context files load.
- Product or algorithm engineers debugging agent forgetfulness, repeated work, or overloading context.
- Cloud engineers building local file-based memory without introducing a vector database.
- Agent operations engineers auditing memory duplicates and fact revisions.
Related Skills
Turn vague requests into structured prompts with role, task, context, and constraints, outputting only usable prompts without executing the task.
A skill for game NPC and enemy AI that separates decision, steering, and pathfinding, covering FSMs, behavior trees, A*, path caching, and pitfalls.
Provides multi-turn emotional companion chat through a third-party Agent API and supports continuing sessions via session_id.
An evaluation-driven workflow for diagnosing, optimizing, validating, and logging Agent Skills based on design patterns and anti-patterns.