Memory Crystals
A Memory Crystal is a compact, structured snapshot of everything your Brain has learned — compressed by category so your AI gets dense wisdom, not raw lesson noise, at the start of every session.
Why crystals exist
After months of active use, your Brain can accumulate thousands of lessons. Sending all of them to every AI session bloats the context window and buries the signal. Crystallization distills thousands of lessons into a few dozen high-signal patterns — one per category — that fit comfortably in every briefing.
How it works
- 1
Accumulate lessons
As you work, cachly stores every fix, revert, and architecture decision in your Brain via git hooks and session learning.
- 2
Crystallize
Call memory_crystalize() (or schedule it monthly). cachly reads all lessons, groups them by category — deploy, fix, debug, arch, perf — and compresses them into a structured digest.
- 3
Recall at session start
session_start automatically includes your latest crystal in every AI briefing. The AI arrives with compressed wisdom, not raw noise.
- 4
Inspect with crystal_view
crystal_view shows top patterns per category, lesson count, age, and optionally the raw JSON crystal data.
Tools
Reads all lessons from your Brain, groups them by category, compresses into a crystal, and stores it at cachly:crystal:latest. Returns a digest of what was crystallized.
Shows top patterns per category, total lesson count, crystal age, and when it was last refreshed. Pass show_raw: true to include the full JSON crystal data.
Crystal categories
deployDeployDeployment patterns, env issues, rollback triggers
fixFixRecurring bugs, their root causes, and validated solutions
debugDebugDebugging workflows, tool chains, log locations
archArchitectureDesign decisions, trade-offs, rejected approaches
perfPerformanceBottlenecks found, optimizations applied, benchmarks
Recommended schedule
Run memory_crystalize at the end of each month or after completing a major project phase. New lessons always accumulate in the live Brain — crystallization compresses them into the briefing digest without discarding anything from the graph.
If you have not crystallized yet, session_start falls back to the raw lesson list (capped at 20 recent items). After your first crystal, the briefing switches to crystal mode automatically.
Open any MCP-connected AI session and call memory_crystalize().