--- name: memory-and-profile description: How to use the user profile system, session memory, and pattern tracking for persistent context tags: [memory, profile, session, persistence] category: system --- ## Steps 1. **User Profile (persists across sessions):** - user_get(key) — read any profile field (e.g. "preferredModel", "fontSize") - user_set(key, value) — write to profile, auto-persists to localStorage - user_list — show all stored profile keys - user_forget(key) — delete a profile key - Dot notation supported: user_set knownFacts.name "Alex" 2. **Session Memory (VFS-based daily logs):** - session_save(summary) — save a summary of what was accomplished - session_load(date) — read a specific day's log (format: YYYY-MM-DD) - session_recent(count) — show last N session summaries - session_stats — aggregate totals across all sessions - Recent sessions auto-load into context on first message - systemd-style journal: use logs and logrotate commands for persistent logging 3. **Conversation Patterns:** - Pattern tracking runs automatically — frequent topics surface as hints - my-set, my-get, my-list store additional personal data - AI conversation context persists within a session (use ai-clear to reset) - debug command toggles real-time debug panel with Copy/Export/VFS buttons 4. **Checkpoints (VFS snapshots):** - checkpoint [name] — snapshot current VFS state - checkpoint-list — list all checkpoints - rollback — restore from checkpoint - checkpoint-del — delete a checkpoint 5. **When to use:** - At start: call session_recent(3) to see what was worked on before - After identifying user preferences: call user_set to store them - After complex tasks: call session_save with a brief summary - Before risky edits: call checkpoint to create a restore point