How felixsim/bonsai-memory works
Bonsai Memory is a skill and set of shell commands for turning an agent’s flat persistent memory into a compact, progressively loaded hierarchy. The documented workflow starts with an agent using the skill to migrate memory: sections are extracted, classified into domains, written as topic files, and summarized in branch and root indexes. The repository also names commands for reflection, reindexing, status, and purge. Their implementations were not provided, so those branches are shown without asserted call relationships.
Main entry points: bonsai-migrate.sh Migration · SKILL.md Bonsai skill · bonsai-reflect.sh Reflection · bonsai-reindex.sh Reindex
Components 14
Memory workflow
- Bonsai skill
SKILL.md - Migration
scripts/bonsai-migrate.sh - Section extraction
- Domain classification
Memory commands
- Reflection
scripts/bonsai-reflect.sh - Reindex
scripts/bonsai-reindex.sh - Status
scripts/bonsai-status.sh - Purge
scripts/bonsai-purge.sh
Memory structure
- Flat memory
- Domain topic files
- Branch indexes
- Root index
Other components
- Agent user
- AI agent
Connections 17
- Agent user → AI agent: requests install
README.md - AI agent → Bonsai skill: reviews and installs
README.md - AI agent → Migration: runs migration
- Migration → Flat memory: reads
- AI agent → Flat memory: parses sections
README.md - Flat memory → Section extraction: splits sections
README.md - Section extraction → Domain classification: classifies headings
README.md - Domain classification → Domain topic files: writes sections
README.md - Domain topic files → Branch indexes: summarized in
README.md - Branch indexes → Root index: indexed into
README.md - AI agent → Root index: loads on boot
README.md - AI agent → Branch indexes: loads on demand
README.md - AI agent → Domain topic files: loads on demand
README.md - AI agent → Reflection: uses command
- AI agent → Reindex: uses command
- AI agent → Status: uses command
- AI agent → Purge: uses command