Agent Memory Architecture

Agent Memory Architecture is a skill for Claude Code, Codex from LeoYeAI/openclaw-master-skills. It costs 52 tokens per session (4,413 once invoked), scanned A, original, MIT.

A file-based memory system for AI agents, with separate files for current work, long-term knowledge, daily notes, topics, and archived summaries.

In plain words
What is it for?
Use it to organize an agent’s working context, record daily events, curate lasting knowledge, track heartbeat state, and remove outdated or duplicated memories.
Why use it?
It gives an agent a consistent way to retain useful context between sessions without APIs, databases, or other external tools.

Skill for Claude CodeCodex

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

Good fit Use it to organize an agent’s working context, record daily events, curate lasting knowledge, track heartbeat state, and remove outdated or duplicated memories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leoyeai/openclaw-master-skills/afrexai-agent-memory
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 afrexai-agent-memory
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 Architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/afrexai-agent-memory/github.svg)](https://agentmods.dev/skills/leoyeai/openclaw-master-skills/afrexai-agent-memory)
Your own site
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/afrexai-agent-memory"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/afrexai-agent-memory/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 Architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/afrexai-agent-memory"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/afrexai-agent-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,413 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.00052 $0.04413
Opus 5 $0.00026 $0.02207
Sonnet 5 $0.00010 $0.00883
Haiku 4.5 $0.00005 $0.00441

Measured 9d ago against content hash a9f4b0a2ecba, 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 Architecture 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.

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/afrexai-agent-memory/SKILL.md · 581 lines

How it starts

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

Agent Memory Architecture

Complete memory system for AI agents using only files. No APIs. No databases. No external dependencies. Just smart file structures and disciplined practices that give your agent perfect recall.


1. Memory Architecture Overview

workspace/
├── MEMORY.md              ← Long-term curated memory (the brain)
├── ACTIVE-CONTEXT.md      ← Hot working memory (what matters NOW)
├── AGENTS.md              ← Operating manual (how you work)
├── memory/
│   ├── 2026-01-15.md      ← Daily notes (raw event log)
│   ├── 2026-01-16.md
│   ├── heartbeat-state.json  ← Heartbeat tracking state
│   ├── topics/
│   │   ├── project-alpha.md  ← Topic-specific deep context
│   │   ├── client-acme.md
│   │   └── tech-stack.md
│   └── archive/
│       ├── 2025-Q4.md       ← Quarterly archive summaries
│       └── 2025-Q3.md

The 5 Memory Layers

Layer File Purpose Read Frequency Write Frequency
1. Hot ACTIVE-CONTEXT.md Current priorities, blockers, in-flight work Every session Multiple times/day
2. Warm MEMORY.md Curated long-term knowledge, decisions, people Every main session Weekly curation
3. Daily memory/YYYY-MM-DD.md Raw event log, conversations, actions taken Today + yesterday Throughout the day
4. Topic memory/topics/*.md Deep context on specific subjects When topic comes up As knowledge grows
5. Cold memory/archive/*.md Historical summaries, rarely accessed On explicit search Quarterly rollup

Core Principle: Write It Down

Memory is limited. Files are permanent.

  • "Mental notes" don't survive session restarts. Files do.
  • If someone says "remember this" → write to a file
  • If you learn a lesson → update the relevant file
  • If you make a mistake → document it so future-you doesn't repeat it
  • Text > Brain 📝

2. Layer 1: Hot Memory (ACTIVE-CONTEXT.md)

Your working scratchpad. What's happening RIGHT NOW.

Read the full file on GitHub · 581 lines

Files

What ships with it

2 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 · 581 lines · 52 tokens per session scan A a9f4b0a2ecba

Subscribe to this mod's changes

Agent Memory Architecture is a skill published in the GitHub repository LeoYeAI/openclaw-master-skills (2,141 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 4,413 once invoked, about $0.0003 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