Learning HubACFS Academy
Progress
0%
0 of 2020 remaining
  • 1
    Welcome & Overview5 min
  • 2
    Linux Navigation8 min
  • 3
    SSH & Persistence6 min
  • 4
    tmux Basics7 min
  • 5
    Git Essentials10 min
  • 6
    GitHub CLI8 min
  • 7
    Agent Commands10 min
  • 8
    NTM Command Center8 min
  • 9
    NTM Prompt Palette6 min
  • 10
    The Flywheel Loop10 min
  • 11
    Keeping Updated4 min
  • 12
    UBS: Code Quality Guardrails8 min
  • 13
    Agent Mail Coordination10 min
  • 14
    CASS: Learning from History8 min
  • 15
    The Memory System8 min
    NOW
  • 16
    Beads: Issue Tracking8 min
  • 17
    Safety Tools: SLB & CAAM6 min
  • 18
    The Art of Agent Direction12 min
  • 19
    Case Study: cass-memory15 min
  • 20
    Case Study: SLB12 min
Back to Home
Back
15/20
Lesson 15
8 min

The Memory System

Build procedural memory for agents

New to ACFS?

Complete the setup wizard first to get the most from these lessons.

Go to Choose Your OS
Goal

Build procedural memory for agents that improves over time.

What Is CM?

CM (CASS Memory System) gives AI agents effective memory by extracting lessons from past sessions and making them retrievable for future work.

Think of it like how humans learn: you encounter a problem, solve it, and remember the solution. CM does this for your agents automatically.

Lesson Extraction

Automatically extract rules from past sessions

Context Retrieval

Get relevant rules before starting tasks

Anti-Patterns

Learn what NOT to do from past mistakes

Continuous Learning

Memory improves with every session

How It Works

Past SessionsRaw conversations
→
→
CM AnalysisExtract lessons
→
→
PlaybookActionable rules
Note
CM builds a "playbook" of rules over time. The more sessions you analyze, the smarter your agents become!

Onboarding: Building Your Playbook

The cm onboard command guides you through analyzing past sessions and extracting valuable rules:

1
cm onboard status

Check status and see recommendations

2
cm onboard sample --fill-gaps

Get sessions filtered by playbook gaps

3
cm onboard read /path/session.jsonl --template

Read session with rich context

4
cm playbook add "rule" --category "category"

Add extracted rules

5
cm onboard mark-done /path/session.jsonl

Mark session as processed

Essential Commands

Check playbook status and recommendations
Get sessions to analyze (filtered by gaps)
Read a session with rich context
Add an extracted rule
Mark session as processed
Get relevant context for a task

Using Context Before Tasks

Before starting complex tasks, retrieve relevant context from your playbook:

json
$ cm context "implement user authentication" --json
{
"relevantBullets": [
{
"id": "b-8f3a2c",
"rule": "Always use bcrypt with cost factor ≥12 for password hashing",
"category": "security"
},
{
"id": "b-2d4e1f",
"rule": "Store JWT secrets in environment variables, never in code",
"category": "security"
}
],
"antiPatterns": [
{
"id": "ap-9c7b3d",
"pattern": "Using MD5 for password storage",
"consequence": "Trivially reversible, security vulnerability"
}
],
"historySnippets": [
{
"session": "2025-01-10.jsonl",
"summary": "Implemented OAuth2 flow with refresh tokens"
}
],
"suggestedCassQueries": [
"authentication error handling",
"JWT refresh token"
]
}
Pro Tip
Reference rule IDs in your work. For example: "Following b-8f3a2c, using bcrypt with cost 12..."

The Memory Protocol

1

START

Run cm context "<task>" --json before non-trivial work

2

WORK

Reference rule IDs when following them (e.g., "Following b-8f3a2c...")

3

FEEDBACK

Leave inline comments when rules help or hurt

4

END

Just finish your work. Learning happens automatically.

typescript
// Feedback format in code:
// [cass: helpful b-8f3a2c] - bcrypt recommendation prevented weak hashing
// [cass: harmful b-xyz123] - this rule didn't apply to async context

Rule Categories

debugging

Problem-solving techniques

security

Security best practices

performance

Optimization patterns

architecture

Design decisions

testing

Test strategies

tooling

Tool-specific knowledge

Best Practices

Run cm context before complex tasks

Don't reinvent the wheel—check what you've learned

Extract specific, actionable rules

'Use bcrypt cost ≥12' is better than 'be secure'

Include anti-patterns

What NOT to do is as valuable as what to do

Categorize rules properly

Makes retrieval more accurate

Provide feedback on rules

Helps the system learn which rules are actually useful

Try It Now

bash
1# Check your playbook status
2$ cm onboard status
3
4# Get context for your current task
5$ cm context "refactor database queries" --json
6
7# See what sessions need analysis
8$ cm onboard sample --fill-gaps

Ready to level up?

Mark complete to track your learning progress.

Previous
CASS: Learning from History
Next
Beads: Issue Tracking