The 6 layers
goal
goal
WHY this work exists. The target outcome. Persists across sessions so the agent doesn’t drift.
- Never auto-forgotten (risk = 0)
- Set at session start or when the user states a new objective
- Example: “Ship v1.0 by end of Q2 with cross-agent recall and token-saving”
context
context
WHY THIS, NOW. Situational timing, background info, reasons for current priorities.
- Normal decay rate
- Consolidated after going cold
- Example: “Vercel had a security incident in April — rotating all API keys across projects”
emotion
emotion
User tone and sentiment. Frustration, excitement, urgency expressed during work.
- Normal decay rate
- Helps agents calibrate tone in future sessions
- Example: “User frustrated with freee API pagination — 3 sessions debugging”
implementation
implementation
HOW it was done. What worked, what failed, technical details of execution.
- Normal decay rate
- Most common layer for day-to-day memories
- Example: “Switched from REST to GraphQL for freee sync — 3x faster batch queries”
caveat
caveat
PAIN lessons. “Never X when Y.” The protected pile of things you don’t want to relearn.
- Always protected — never auto-forgotten, never consolidated
- Start with a verb: “Never”, “Always”, “Watch out”
- Example: “Never use pgbouncer session mode with Supabase — prepared statement conflicts”
learning
learning
GROWTH. Decisions made, insights gained, patterns recognized.
- Normal decay rate but typically higher importance
- Target layer for consolidation output
- Example: “freee webhook reliability is ~95% — always implement polling fallback”
Layer aliases
You don’t need to remember exact layer names. Common aliases are automatically resolved:Retention behavior
Why layers matter
Without layers,recall("Supabase") returns a wall of undifferentiated text. With layers, the agent can:
- Start with
goalto understand direction - Check
caveatbefore making changes - Skim
implementationfor prior approaches - Use
learningfor distilled wisdom