Skip to content

Auto-Archive

toon-memory automatically archives entries older than 30 days or with expired TTL to keep your memory clean.

memory_archive()
// 📦 Archivadas 5 entradas antiguas
// 📋 Quedan 42 entradas activas
  1. Entries older than 30 days are moved to archive.toon
  2. Entries with expired TTL are also archived
  3. Active memory stays under 100 entries
  4. Archived entries are preserved for history
  5. Can be triggered manually or automatically

Entries with a ttl field are archived when the TTL expires, regardless of the 30-day rule:

entries[3|]{id|category|key|content|file|tags|date|ttl}:
a1b2c3d4|decision|permanent|This stays forever|file.ts||2026-07-10|
e5f6g7h8|knowledge|sprint-info|Sprint ends Friday|file.ts||2026-07-10|7d
i9j0k1l2|bug|temp-fix|Temporary workaround|file.ts||2026-07-10|2026-07-15

In this example:

  • permanent — no TTL, never expires by TTL
  • sprint-info — expires 7 days after creation
  • temp-fix — expires on a specific date
.toon-memory/memory/
├── data.toon # Active memory (< 30 days, no expired TTL)
└── archive.toon # Archived entries (> 30 days or expired TTL)
version: 1
archived[5|]{id|category|key|content|file|tags|date}:
a1b2c3d4|decision|old-decision|This was decided...|src/old.ts|decision|2026-06-01
e5f6g7h8|pattern|old-pattern|This pattern was used...|src/pattern.ts|pattern|2026-06-15
Setting Default Description
Max entries 100 Maximum active entries
Archive days 30 Days before archiving
Archive file archive.toon Where archived entries go
  • Keep memory clean — Prevent unlimited growth
  • Historical reference — Old decisions still accessible
  • Performance — Faster searches with fewer entries
  • Temporary context — TTL handles deadlines, sprints, time-sensitive notes