Moyu AI Agent Secure Memory Toolkit
Paste the following prompt into your AI chat to install this skill:
Please install @user_cac30d95/moyu into your AI assistant following https://skillhub.cn/install/skillhub.md.
About this skill
Problem
Persistent memory in AI agents creates three concrete risks: injected or poisoned writes, PII such as phone numbers, IDs, and API keys left in local files, and loss of key decisions when context limits force truncation. Many memory systems depend on external vector stores, LLM APIs, or cloud tenancy, which makes offline and zero-infrastructure deployment awkward.
How it works
Moyu treats the memory layer as a stack of defense, retrieval, and lifecycle stages. Before writes, content passes through 613 regex checks and LLM review; suspected injection, PII, or abnormal write bursts are blocked, masked, or rolled back. Retrieval combines semantic, BM25, recency, entity, and staged-content signals, then uses search feedback to tune weights. After storage, memories are compressed, forgotten, and merged by heat, scene, and semantic review, while original text is retained for audit. It favors local execution: ONNX embeddings, SQLite FTS5, and Markdown files carry the core state; LLM features are on by default but degrade to rule-based paths without an API key.
Limits
The defense chain is layered deterrence, not a silver bullet. It covers known injection patterns, accidental corruption, and common PII reasonably well, but targeted bypasses or metaphor-style semantic injection can still succeed. Strict compliance, cross-tenant isolation, high availability, or advanced knowledge-graph requirements should be handled with an organization-level gateway, encryption, and audit strategy rather than relying only on a local memory toolkit.
Use Cases
- Add long-term memory to a personal AI assistant and block prompt injection while masking phone numbers, API keys, and other PII before writes.
- When a long session nears the context limit, compress old turns while retaining key facts, generate a task map, and trigger compression warnings.
- Audit abnormal memory writes by checking defense logs, verifying SHA256 signatures, and restoring backups that pass signature checks.
- Configure cross-session bridging for an agent so the new session receives the previous summary, decisions, and pending tasks for continuity.
Best For
- Backend engineers maintaining long-term memory for AI agents who need prompt-injection defense, PII masking, and context-loss control
- Independent developers who want assistant memory in local Markdown files without Docker or databases
- Security engineers auditing abnormal writes, restoring backups, and reviewing defense-event logs
- AI application engineers handling long-session compression, retrieval tuning, and cross-session state bridging
Related Skills
A free matrix publishing assistant for Skill developers, guiding distribution to Tencent SkillHub, XiaLiao, XiaYou SkillHub, GitHub, and ClawHub with create, update, and delete safeguards.
A guide for writing Seedance 2.0 video prompts, covering @ references, camera moves, time segments, audio direction, and common pitfalls.
Collects daily conversations, task logs, and errors, then runs a nine-module review to surface blind spots, generate actions, and update memory.
Local long-term memory for AI agents that appends key facts and daily logs, supports cross-session context and search recall, and auto-archives old diaries to gzip files.