Skip to content

docs: Memory lifecycle best practices + migration guide + config reference #937

Closed

Description

@ajianaz

Overview

Dokumentasi lengkap untuk memory lifecycle system: state diagram, config reference, migration guide, dan best practices untuk user/developer.

Deliverables

1. Lifecycle State Diagram

Document 3-state lifecycle:

ACTIVE → DEPRECATED → PRUNED (hard delete)
  ↑          |
  └─promote──┘

Rules:

  • forget() = explicit hard-delete (only manual path)
  • prune() = hard-delete expired deprecated only
  • Everything else = soft-delete (deprecate)

2. Config Reference

Full [lifecycle] section documentation di VitePress docs:

Field Default Description
soft_delete_only true Prevent hard-delete except via forget/prune
auto_aging_enabled true Enable periodic soft-delete
auto_aging_interval_hours 168 Weekly cycle
min_age_days 90 Memories must be 90+ days old
max_access_count 3 Accessed fewer than N times
max_deprecate_percent 1.0 Max 1% per cycle
min_deprecate_per_cycle 1 Floor
max_deprecate_per_cycle 50 Ceiling
deprecated_ttl_days 30 Review window before prune
auto_prune_enabled true Auto-prune expired
dream_dedup_soft_delete true Dream dedup deprecates
dream_compact_soft_delete true Dream compact deprecates

3. Migration Guide

For existing users upgrading from v0.13 → v0.14:

  • Old [aging] and [maintenance] sections still parsed (backward compat)
  • New [lifecycle] section takes priority
  • Behavior change: aging now soft-deletes instead of hard-deletes
  • soft_delete_only=false to restore old behavior (not recommended)

4. Best Practices

For Users

  • Leave soft_delete_only=true (default) — safe
  • Set min_age_days higher (180) if you have important rarely-accessed data
  • Pin critical memories (uteke pin <id>) — pinned never touched
  • Review uteke lifecycle pending weekly for LLM/agent evaluation
  • Use --dry-run before changing config

For Developers

  • Never call store.delete() directly — use deprecate_with_reason() or forget()
  • Always log timeline events on state transitions
  • Test with soft_delete_only=true AND =false
  • New destructive operations MUST respect soft_delete_only

Files

Path Content
docs/guide/lifecycle.md Full lifecycle guide (state diagram, config, best practices)
docs/reference/config.md Update with [lifecycle] section
CHANGELOG.md Document breaking change (aging → soft-delete)

Acceptance Criteria

  • VitePress docs page for lifecycle exists
  • Config reference updated with all lifecycle fields
  • Migration guide covers v0.13 → v0.14 upgrade
  • State diagram clear and accurate
  • Best practices for users and developers
  • CHANGELOG entry documents behavior change

Dependencies

Activity

  1. added this to the milestone on Aug 8, 2026
  2. added
    documentation
    scope:docs
    epic:memory-lifecycle
    lifecycle
    on Aug 8, 2026
  3. modified the milestones: , v0.13.0 on Aug 8, 2026
  4. ajianaz commented on Aug 8, 2026

    @ajianaz
    CollaboratorAuthor

    Implemented in PR #938 (merged). Closing as completed.

  5. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationepic:memory-lifecyclelifecyclepriority:mediumscope:docs

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions