← 返回 Skills 市场
siyu-hu

local-memory-skill

作者 siyu-hu · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
418
总下载
2
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install agent-local-memory
功能描述
Persistent local memory system for AI agents across conversations — file-based, zero external dependencies. Trigger when: (1) user asks to "remember" somethi...
使用说明 (SKILL.md)

Agent Local Memory

Persistent local memory across conversations — store user preferences, project context, and behavioral feedback as plain files. No external services, no network calls, no credentials required.

Storage Paths

Platform Default Memory Path
Claude Code ~/.claude/memory/
OpenClaw ~/.openclaw/memory/
Cross-platform ~/.agent-memory/

MEMORY.md Index

Maintain a MEMORY.md file in the memory directory as a persistent index:

  • Each memory = one .md file with YAML frontmatter (name / description / type)
  • MEMORY.md stores only links to memory files + one-line descriptions, never full content
  • Trim and merge old entries when the index exceeds 200 lines

At conversation start: Check whether MEMORY.md exists. If it does, read the index and surface relevant memories to the user.

Before context limit: Proactively write important content from the current session into memory files and update MEMORY.md, so the next session can resume seamlessly.

Memory File Format

---
name: memory-name
description: One-line summary (used to assess relevance from the index)
type: user | feedback | project | reference
---

Memory content here.

Four Memory Types

user — User Profile

Stores the user's role, goals, preferences, and knowledge background.

When to write: When you learn about the user's role, tech stack, or communication style.

---
name: user_profile
description: Senior Go engineer, new to React frontend
type: user
---

- 10 years of Go experience, strong backend background
- Just getting started with React — frame frontend concepts as backend analogues
- Communication style: concise and direct, dislikes verbose explanations

feedback — Behavior Correction

Records behaviors the user has corrected. Highest priority — always follow these rules in future sessions.

When to write: When the user says "don't do that", "stop doing…", or any explicit correction.

Lead with the rule, then **Why:** (reason given) and **How to apply:** (scope).

---
name: feedback_no_db_mock
description: Integration tests must use a real database, never mocks
type: feedback
---

Integration tests must connect to a real database — mocking is not allowed.

**Why:** A prior incident where mocked tests passed but the prod migration failed.

**How to apply:** Any test involving database operations must connect to the test database directly.

project — Project Context

Records goals, key decisions, owners, and deadlines that cannot be inferred from the codebase.

When to write: When you learn the motivation behind a decision, a milestone, or a constraint.

Always convert relative dates ("next Friday") to absolute dates before writing.

---
name: project_auth_rewrite
description: Auth middleware rewrite is compliance-driven, not tech debt
type: project
---

Auth middleware rewrite. Target completion: 2026-04-01.

**Why:** Legal flagged session token storage as non-compliant with new regulations.

**How to apply:** Scope decisions should prioritize compliance over engineering elegance.

reference — External Resources

Records locations and purposes of external systems for quick lookup.

When to write: When you learn about a Linear project, Slack channel, dashboard, or any external resource.

---
name: ref_linear_bugs
description: Pipeline bugs tracked in Linear project INGEST
type: reference
---

Pipeline bugs are tracked in Linear project "INGEST". Check there before investigating data pipeline issues.

Write Rules

Before writing, scan MEMORY.md — update an existing entry if one applies, do not create duplicates.

Never write to memory:

  • Passwords, API keys, tokens, or any credentials
  • Secrets, private keys, or sensitive authentication data
  • Code structure, file paths, or architecture conventions (derivable from the codebase)
  • Temporary state from the current conversation
  • Anything already in project documentation or git history

Conversation Start Prompt

If MEMORY.md exists, output at conversation start:

Local memory detected (N entries). Relevant memories: [list]

安全使用建议
This skill appears to be what it says: a local, file-based persistent memory system that does not use network calls or require credentials. Before enabling it, consider: (1) It will read/write files under your home directory (~/.claude, ~/.openclaw, or ~/.agent-memory); review those files (MEMORY.md and per-memory .md) regularly. (2) The skill relies on the agent to avoid storing secrets — do not ask the agent to 'remember' passwords, API keys, or other sensitive data. (3) The SKILL.md does not require or set file permissions or encryption; if your environment has other users or backups, sensitive content in plain files could be exposed — consider restricting permissions (chmod 600) or using an encrypted store. (4) If you want tighter control, require explicit user confirmation before each write, disable autonomous invocation for this skill, or test it in an isolated account first. (5) If you need auditability, ask for a change that logs writes and exposes a way to purge or export memories securely.
功能分析
Type: OpenClaw Skill Name: agent-local-memory Version: 1.0.1 The skill bundle defines a persistent local memory system for AI agents using Markdown files stored in the user's home directory (e.g., `~/.agent-memory/`). It contains instructions for the agent to categorize and retrieve user preferences, feedback, and project context across sessions. The instructions in `SKILL.md` explicitly forbid the storage of sensitive information such as passwords, API keys, or secrets, and there is no evidence of data exfiltration, malicious execution, or unauthorized access.
能力评估
Purpose & Capability
Name/description match the behavior: an instruction-only, file-based local memory system. It requires no binaries, secrets, or network access and only reads/writes under well-defined home-directory paths (~/.claude, ~/.openclaw, ~/.agent-memory), which is proportionate to the stated purpose.
Instruction Scope
SKILL.md instructs the agent to check MEMORY.md at conversation start and to proactively write session content before context limits. That is consistent with a local memory skill, but 'proactively write important content' is subjective and relies on the agent to correctly identify what is safe to persist. The instructions include explicit 'Never write' rules for passwords/keys, which is good, but enforcement is left to runtime behavior (no automatic filtering or validation specified).
Install Mechanism
Instruction-only skill with no install spec and no code files. Nothing will be downloaded or written during install, so there is low installation risk.
Credentials
No environment variables, credentials, or unrelated config paths are requested. The set of requested resources (local file paths under home) is appropriate for a local memory feature.
Persistence & Privilege
The skill creates persistent files in users' home directories but does not specify file permissions, owner, or any encryption/locking. Although it forbids storing secrets, there is no technical enforcement. Persistent, unencrypted files under the home directory may be accessible to other local users/processes or backups — assess local threat model and consider requiring the agent to set restrictive permissions or an optional encryption step.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-local-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-local-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Initializes git version control for the project, adding all standard git metadata and hooks. - Updates memory type documentation: removes external "memory-types.md" file and consolidates all details directly into SKILL.md. - Expands memory type definitions with clear examples and new "when to write" guidelines for each type. - Clarifies storage rules, explicitly prohibiting the storage of sensitive data and credentials. - Improves documentation on index management and user prompts at conversation start.
v1.0.0
- Initial release of persistent local memory for AI agents with zero external dependencies. - Stores memories as plain files with YAML frontmatter, categorized by type (user, feedback, project, reference). - Uses a `MEMORY.md` index with links and descriptions for fast lookup and context at conversation start. - Automatically saves important context before reaching context limits; checks and loads memories at each session start. - Simple memory write rules to prevent duplication and avoid storing temporary or redundant information.
元数据
Slug agent-local-memory
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

local-memory-skill 是什么?

Persistent local memory system for AI agents across conversations — file-based, zero external dependencies. Trigger when: (1) user asks to "remember" somethi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 418 次。

如何安装 local-memory-skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-local-memory」即可一键安装,无需额外配置。

local-memory-skill 是免费的吗?

是的,local-memory-skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

local-memory-skill 支持哪些平台?

local-memory-skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 local-memory-skill?

由 siyu-hu(@siyu-hu)开发并维护,当前版本 v1.0.1。

💬 留言讨论