Event Types
Memory events capture significant moments in your AI interactions. Each type serves a specific purpose and helps the AI provide better context in future sessions.
Quick Reference
All event types use the session(action="capture", ...) action (lessons have a dedicated action: session(action="capture_lesson", ...)).
{
"action": "capture",
"event_type": "decision", // See types below
"title": "Brief summary",
"content": "Detailed explanation...",
"importance": "medium" // low, medium, high
}All Event Types
decisionArchitectural or design decisions with rationale
preferenceUser preferences, coding style, and workflow habits
insightDiscoveries, learnings, and observations about the codebase
noteGeneral notes, runbooks, and operational context
implementationImplementation details, checklists, and technical how-tos
taskCompleted work, implementations, and action items
conversationMeeting notes, discussions, and general context
bugBug reports and issues found
featureFeature requests and implementations
correctionWhen you're corrected on something
warningImportant warnings to remember
frustrationUser frustration points to avoid
lessonLessons learned from mistakes or corrections
Lessons Learned
Lessons are a special event type with additional structured fields. They capture mistakes, corrections, and preventions that are automatically surfaced in future sessions to prevent repeating errors.
When to Capture Lessons
- • User expresses frustration (caps, "COME ON", repeated corrections)
- • User corrects the AI ("No, you should...", "That's wrong")
- • Code breaks due to a preventable mistake
- • Production issues caused by AI-generated code
- • A command/tool fails and you learn the correct fix
Capturing Lessons
Use the dedicated session(action="capture_lesson", ...) action:
{
"action": "capture_lesson",
"title": "Always verify assets in git before pushing",
"severity": "critical", // low, medium, high, critical
"category": "workflow", // workflow, code_quality, verification, communication, project_specific
"trigger": "Pushed code referencing images without committing them",
"impact": "Production 404 errors - broken landing page",
"prevention": "Run 'git status' to check untracked files before pushing",
"keywords": ["git", "images", "assets", "push", "404"]
}Lesson Fields
| Field | Description |
|---|---|
title | What to remember - concise summary |
severity | critical (production), high (breaking), medium (workflow), low (minor) |
category | workflow, code_quality, verification, communication, project_specific |
trigger | What action caused the problem |
impact | What went wrong as a result |
prevention | How to prevent this in the future |
keywords | Keywords for semantic matching in future contexts |
Severity Guide
Automatic Surfacing
Events are automatically included in session_init and context_smart responses based on semantic relevance. High and critical severity lessons appear as warnings before risky operations.
Example Warning
When about to push code that references assets:
L:⚠️ Verify assets in git before pushing: Run git status to check untracked filesRetrieving Events
Use session(action="recall", ...) to find past events:
{
"action": "recall",
"query": "What did we decide about authentication?"
}For lessons specifically:
{
"action": "get_lessons",
"query": "git push", // Optional: semantic search
"category": "workflow", // Optional: filter by category
"severity": "high", // Optional: minimum severity
"limit": 10
}Best Practices
Capture immediately
Save events as soon as they happen, while context is fresh
Be specific
Include exact details, commands, or steps that matter
Choose the right type
Use the most specific event type - decisions vs preferences vs insights
Use lessons for corrections
Always use session(action="capture_lesson", ...) for mistakes - they get special treatment