Agent Memory System Guide

Agent Memory System Guide is a skill for Claude Code, Codex from LeoYeAI/openclaw-master-skills. It costs 44 tokens per session (5,594 once invoked), scanned A, original, MIT.

A guide to giving AI agents long-term and short-term memory using files such as MEMORY.md, daily notes, session state, and a working buffer. It also describes optional note-taking and recall tools.

In plain words
What is it for?
Use it to set up durable facts, daily records, recovery notes, temporary working information, and an optional archive in Obsidian or another recall system.
Why use it?
It provides a consistent way to preserve important decisions, unfinished work, and context between sessions.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: mentions Codex; built for openclaw.

Good fit Use it to set up durable facts, daily records, recovery notes, temporary working information, and an optional archive in Obsidian or another recall system.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leoyeai/openclaw-master-skills/agent-memory-system-guide
About the project

OpenClaw Master Skills is a curated, regularly updated collection of skills that extends an AI personal assistant platform with capabilities such as research, browser automation, presentation creation, and prompt work. It is intended for people using OpenClaw or MyClaw.ai to give their agents additional tasks and workflows. The catalogue contains many skills and agents from this collection.

LeoYeAI/openclaw-master-skills · 2,141 stars · on GitHub · myclaw.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeoYeAI/openclaw-master-skills --skill agent-memory-system-guide
Clone the repo
git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Agent Memory System Guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/agent-memory-system-guide/github.svg)](https://agentmods.dev/skills/leoyeai/openclaw-master-skills/agent-memory-system-guide)
Your own site
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/agent-memory-system-guide"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/agent-memory-system-guide/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Agent Memory System Guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/agent-memory-system-guide"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/agent-memory-system-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,594 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.05594
Opus 5 $0.00022 $0.02797
Sonnet 5 $0.00009 $0.01119
Haiku 4.5 $0.00004 $0.00559

Measured 9d ago against content hash 95b379597ac8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

Agent Memory System Guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 13 executable files (scripts/memory_capture.py, tests/test_gitignore_publish_artifacts.py, tests/test_install_contract.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agent-memory-system-guide/SKILL.md · 569 lines

How it starts

The opening of the file, as written. The whole thing — 569 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent 记忆系统搭建指南 Skill

🧠 从零搭建 Agent 长期记忆系统。基于 OpenClaw 实战,覆盖本地优先的 MEMORY.md、每日笔记、SESSION-STATE.mdworking-buffer.md、Obsidian 原生笔记与可选召回后端全流程。

触发词

记忆系统memory-setup搭建记忆记忆架构

⚡ 5 分钟快速上手

如果你赶时间,只需做这几步:

第一步:创建 MEMORY.md

# MEMORY.md

> 长期记忆。只保留会持续影响协作的事实、偏好和决策。

## User

- Preferred name: K
- Timezone: Asia/Shanghai

## 当前任务

- [ ] 正在做的事

## 决策记录

- YYYY-MM-DD: 决策内容 + 原因

## 踩坑记录

- 问题 → 解决方案

第二步:创建每日笔记

# memory/2026-03-20.md

## 完成
- 分析了网宿科技

## 决策
- 暂不加仓

## 踩坑
- (无)

## 待办
- [ ] 明天要做什么

第三步:从模板创建 SESSION-STATE.mdworking-buffer.md

# SESSION-STATE.md

## 当前任务
- 任务名称

## 已完成
- ...

## 卡点
- ...

## 下一步
- ...

## 恢复信息
- 最近一次有效上下文:...
# working-buffer.md

## 进行中
- ...

## 临时决策
- ...

## 未完成
- ...

模板来源:

  • templates/SESSION-STATE.md
  • templates/working-buffer.md

恢复层契约先写死

  • SESSION-STATE.md 只使用仓库模板提供的简洁结构:当前任务已完成卡点下一步恢复信息
  • 不要写入 TaskStatusOwnerLast UpdatedCleanup Rule 这类另一套 schema 字段
  • 如果外部 skill 产出的是详细版字段:
    • Current Task 合并到 当前任务
    • Status 合并到 已完成卡点下一步
    • OwnerLast UpdatedCleanup Rule 只在条目文本里按需保留,不扩展新标题
  • working-buffer.md 是唯一的短期毛坯区
  • 其他 skill 如果也有 working buffer 概念,应复用这个文件
  • 不要再创建第二份并行写入的 WAL / buffer 文件
  • MEMORY.md 用于启动时快速参考
  • memory/ 用于每日笔记和深度归档
  • 两者允许主题重叠,但检索顺序不同:先 SESSION-STATE.md,再 recent notes,再 MEMORY.md / memory_search,最后再查归档

第四步:使用 Obsidian 原生笔记模板

# templates/OBSIDIAN-NOTE.md

---
title: ""
aliases: []
tags: []
type: memory
status: draft
source: ""
source_url: ""
created: 2026-03-21
updated: 2026-03-21
related: []
---

## Summary
- 一句话摘要

## Key Points
- ...

## Evidence
> ...

## Related Notes
- [[SESSION-STATE]]
- [[working-buffer]]

## Attachments / Embeds
- `![[image.png]]`
- `![[note#^block-id]]`

第五步:每次对话开始时

先读 SESSION-STATE.md,再读最近 1-3 天 daily notes,最后才做 memory_search。
memory_search(query="相关关键词")

就这么简单。后续优化可以慢慢加。

Read the full file on GitHub · 569 lines

Files

What ships with it

38 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 569 lines · 44 tokens per session scan A 95b379597ac8

Subscribe to this mod's changes

Agent Memory System Guide is a skill published in the GitHub repository LeoYeAI/openclaw-master-skills (2,141 stars, last pushed 1mo ago), licensed MIT. It adds 44 tokens to every session and 5,594 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

openclaw-auto-dream

Cognitive memory architecture for OpenClaw agents — periodic dream cycles that consolidate daily logs into structured long-term memory with importance scoring, insights, and push notifications. Use when: user asks for 'auto memory', 'dream', 'auto-dream', 'memory consolidation', 'memory dashboard'. Powered by…

LeoYeAI/openclaw-auto-dream · 79 tokens

myclaw-backup

Backup and restore all OpenClaw configuration, agent memory, skills, and workspace data. Part of the MyClaw.ai (https://myclaw.ai) open skills ecosystem — the AI personal assistant platform that gives every user a full server with complete code control. Use when the user wants to create a snapshot of their OpenClaw…

LeoYeAI/openclaw-backup · 179 tokens

memory

Search past conversations in the agent's history log.

HKUDS/nanobot · 12 tokens

cocoscout

Relevance-ranked context loading — Tier 2 async subagent (Haiku, <5s) that fires after Tier 1 deterministic checks in UserPromptSubmit. Injects ranked context from CocoGrove, CocoContext, Environment Inspector, Prompt Studio, and CocoDream.

Snowflake-Labs/cocoplus · 59 tokens

cocohealth

Context utilization monitor — background monitor that samples context window utilization via PostToolUse hook, surfaces advisory at 60% and critical warning with recovery decision matrix at 70%.

Snowflake-Labs/cocoplus · 38 tokens

pull-search

CocoPull session archive search — full-text search across past sessions. Handles $pull search " " with --since and --feature filters, and $pull index rebuild.

Snowflake-Labs/cocoplus · 38 tokens