Skip to main content

Overview

AIOX agents maintain persistent memory across sessions through dedicated MEMORY.md files and state management systems. This enables agents to learn, adapt, and maintain context between interactions.
string
.aiox-core/development/agents/{agent-id}/MEMORY.md
string
Editable - MEMORY.md files are in the L3 (exceptions) layer
string
Committed - Team-shared learnings are version controlled

Memory File Structure

Each agent has a dedicated MEMORY.md file:

Memory Categories

Recent Context

object
Active session state
array
Chronological log of completed workEach entry includes:
  • Timestamp
  • Task/action completed
  • Associated story
  • Key files modified

Learned Patterns

array
Reusable code patterns discovered during work
array
Code anti-patterns to avoidEach entry documents:
  • Anti-pattern name
  • Problem caused
  • Recommended solution
  • Where encountered

Gotchas

array
Build-related problems and solutions
array
Integration and dependency issuesDocuments:
  • External API issues
  • Library incompatibilities
  • Environment-specific problems
  • Configuration gotchas

Decision Log

array
Informal architecture decisions (not full ADRs)
array
Technology and library selectionsDocuments:
  • Why technology was chosen
  • Alternatives evaluated
  • Trade-offs accepted
  • Integration considerations

Gotchas Memory System

The Gotchas Memory System is an enhanced memory subsystem for capturing and retrieving project-specific issues:

Gotcha Structure

Gotcha Commands

command
Manually add a gotcha
command
Search and list gotchas
command
Get relevant gotchas for current contextAutomatically suggests relevant gotchas based on:
  • Current file/directory
  • Active story
  • Recent error messages

Auto-Capture

Gotchas are automatically captured when:
  1. Build fails multiple times (≥2 failures)
  2. Tests fail with same error pattern
  3. Agent encounters same issue multiple times
  4. Error patterns match known signatures

State Persistence

Session State

string
.aiox/session-{timestamp}.yamlContains:
  • Active agent
  • Current story
  • Command history
  • Permission mode
  • Context snapshots

Build State

string
.aiox/build-state/{story-id}.jsonTracks:
  • Implementation plan
  • Completed subtasks
  • Current checkpoint
  • Attempt history
  • Test results

Recovery State

string
.aiox/recovery/{story-id}/Contains:
  • attempts.json - Implementation attempt history
  • approach.md - Current approach documentation
  • checkpoints/ - Git checkpoints for rollback

Memory Operations

Reading Memory

Agents automatically load MEMORY.md on activation:

Writing Memory

Memory is updated:
  1. After command completion - Update Recent Work
  2. On pattern discovery - Add to Learned Patterns
  3. On issue resolution - Add to Gotchas
  4. On decision made - Add to Decision Log

Memory Cleanup

string
Old entries are archived after:
  • Recent Work: 30 days
  • Session State: 7 days (stale TTL)
  • Build State: After merge

Memory Sharing

Team Memory

string
MEMORY.md files are committed to repositoryShared across team:
  • Learned patterns
  • Gotchas
  • Decision log
  • Best practices

Personal Memory

string
Session-specific state in .aiox/ (gitignored)Personal only:
  • Session history
  • Command history
  • Personal preferences

Memory Intelligence Features

Pattern Learning

feature
Agent analyzes code changes to identify reusable patternsTriggers:
  • Similar code written 3+ times
  • Successful problem resolution
  • Team member code review feedback

Context Awareness

feature
Agent loads relevant memory based on:
  • Current story
  • Current file/directory
  • Command being executed
  • Recent failures

Memory Validation

checklist
Location: .aiox-core/development/checklists/memory-audit-checklist.mdValidates:
  • Memory file structure
  • Entry completeness
  • Pattern validity
  • Gotcha accuracy

Best Practices

  • Update MEMORY.md after significant learnings
  • Review and clean up old entries monthly
  • Ensure gotchas include clear solutions
  • Document why decisions were made, not just what
  • Use consistent terminology and categories
  • Capture gotchas immediately when discovered
  • Include reproduction steps
  • Document root cause, not just symptoms
  • Update frequency counter when recurring
  • Link to related stories/PRs
  • Include complete, runnable examples
  • Explain when to use vs. when not to use
  • Reference source story or documentation
  • Update patterns as conventions evolve
  • Remove deprecated patterns

Reference: .aiox-core/development/agents/*/MEMORY.md