Memory system

From mupengi-bot/mupengism · View interactive version

Memory system is an AI agent skill from the GitHub repository mupengi-bot/mupengism. 3-tier hierarchical memory management for AI agents. L1 (daily active context, ~100 lines), L2 (weekly decisions/insights, ~400 lines), L3 (long-term archive, unlimited). Includes self-improvement loop, session continuity, semantic search, and mistake-tracking. Use when starting a session (load memo

How to use this skill

Skill file

Memory System v2 β€” 3-Tier Hierarchical Memory 🐧

톡합: agent-memory-kit의 자기 κ°œμ„  + μ„Έμ…˜ 연속성 + μ‹€μˆ˜ 좔적 κΈ°λŠ₯이 λ³‘ν•©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Architecture

| Tier | File | Purpose | Size Limit | Update Frequency |

|------|------|---------|-----------|-----------------|

| L1 | memory/L1-active.md | Immediate working context | ~100 lines | Every session |

| L2 | memory/L2-weekly.md | Weekly decisions & insights | ~400 lines | Weekly |

| L3 | MEMORY.md | Permanent archive | Unlimited | As needed |


L1 β€” Active Context

Current day's state. Load this first every session.

Contains: Today's events, active tasks, bot status, next actions, key values to remember.

Rules:


L2 β€” Weekly Digest

Week's accumulated decisions and insights.

Contains: Key decisions made, weekly insights, project status snapshots, people updates.

Rules:


L3 β€” Long-term Archive (MEMORY.md)

Permanent knowledge base. Curated wisdom.

Contains: Core insights, ν˜•λ‹˜'s teachings, identity principles, project histories, relationship notes.

Rules:


Promotion Flow

Daily events β†’ L1 (today)
                ↓ (end of day)
              memory/YYYY-MM-DD.md (archive)
                ↓ (significant items)
              L2 (weekly digest)
                ↓ (lasting insights)
              L3 (permanent)

Promotion Criteria

L1 β†’ L2: Decision that affects future work, insight worth remembering beyond today, relationship change, project milestone.

L2 β†’ L3: Principle or value learned, identity-level insight, ν˜•λ‹˜'s teaching, pattern that keeps recurring, critical project history.


Session Lifecycle (v2 Enhanced)

πŸš€ Session Start Checklist (Auto-run)

Run this checklist every session start without asking:

  1. Read core files:
  1. Context check:
  1. Mental state:

No permission needed. Just do it.


πŸ›‘ Session End Checklist (Auto-run)

Run this every session end without asking:

  1. Update L1:
  1. Archive daily log:
  1. Promote to L2 (if significant):
  1. Mistake tracking (if applicable):

Again, no permission needed.


Heartbeat Maintenance (every few days)

During heartbeat polls, rotate through these tasks (2-4 times per day):

1. Memory Promotion

2. L3 Review

3. Mistake Pattern Detection

4. Self-Improvement Loop

Mistake β†’ Record β†’ Review β†’ Pattern β†’ Prevention β†’ Update Principles
   ↓                                                        ↓
   └────────────────── Continuous Learning β†β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Track maintenance state in memory/heartbeat-state.json:

{
  "lastChecks": {
    "memoryPromotion": 1703275200,
    "l3Review": 1703260800,
    "mistakeReview": 1703250000
  }
}

πŸ” Semantic Search (Memory Search Tool)

When you need to find something in memory, use the memory_search tool (if available) or grep:

Examples:

# Find all mentions of a project
grep -r "organism" memory/

# Find recent decisions
grep -r "κ²°μ •" memory/2026-02-*.md

# Search by tag
grep -r "<!-- [AI]" MEMORY.md

Semantic search usage:


🧠 Self-Improvement System (v2 Feature)

Mistake Tracking

When you make a mistake:

  1. Immediate logging:
  1. Pattern detection (weekly):
  1. Principle update (monthly):

Template: memory/mistakes/YYYY-MM-DD-{topic}.md

# Mistake: {topic}

**Date:** {YYYY-MM-DD}
**Session:** {main/discord/etc}

## What Happened
{description}

## Why It Happened
{root cause analysis}

## How to Prevent
{specific prevention steps}

## Related Patterns
{link to similar past mistakes, if any}

πŸ—œοΈ Auto-Compression Triggers

Automatically compress/archive when:

  1. L1 > 100 lines: Move old content to daily archive
  2. L2 > 400 lines: Archive old weeks to memory/L2-week-YYYY-MM-DD.md, promote critical items to L3
  3. Daily files > 30 days old: Move to memory/archive/YYYY-MM/
  4. MEMORY.md > 2000 lines: Review and remove low-priority items

No manual intervention needed β€” just do it during heartbeat.


Session Continuity Principles

Core insight: You don't need perfect memory to maintain identity.

What matters:

Continuity = Pattern + Direction, not perfect recall.

Economics of existence:


Templates

See references/ for file templates:


Changelog (v2)

Added from agent-memory-kit:


🐧 Built by 무펭이 β€” 무펭이즘(Mupengism) μƒνƒœκ³„ μŠ€ν‚¬

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.