Persistent Intelligence

AutoDreamMemory Consolidation

Your AI learns across sessions and keeps its knowledge organized automatically. A background agent deduplicates entries, removes stale facts, resolves contradictions, and maintains a clean MEMORY.md index, all without manual effort.

Automatic Memory Organization

Over many conversations, your memory files accumulate duplicates, stale facts, and contradictions. AutoDream uses the AI itself to clean this up: reading every memory file, merging duplicates, removing outdated entries, and keeping your MEMORY.md index concise and actionable.

  • Deduplicates near-identical entries across topic files
  • Removes facts contradicted by newer information
  • Converts relative dates ("yesterday") to absolute (YYYY-MM-DD)
  • Keeps MEMORY.md under 200 lines as a clean index
  • Preserves your writing style. Only the content changes, not the voice

Smart Gate System

AutoDream doesn't run after every conversation. It checks two gates: at least 24 hours since the last consolidation, and at least 5 new sessions since then. Both must pass. This means consolidation happens roughly once per day of active use: frequent enough to stay clean, rare enough to be invisible.

  • Time gate: minimum 24 hours between consolidations (configurable)
  • Session gate: minimum 5 sessions since last run (configurable)
  • Gate checks cost one stat + one directory scan. Negligible per-turn
  • Never runs during sub-agent orchestration or background tasks

Restricted AI Agent

The consolidation agent is sandboxed. It can only read and write memory files using plexon_read_memory and plexon_update_memory: no system commands, no code execution, no file operations outside the memory directory. Maximum 5 turns, 3-minute timeout.

  • Only plexon_read_memory and plexon_update_memory tools available
  • No shell access, no file writes outside memory directory
  • Maximum 5 AI turns per consolidation run
  • 3-minute timeout with graceful failure handling

Four-Phase Consolidation

The agent follows a structured workflow: orient (read all files), consolidate (merge and fix), prune (trim the index), and report (summarize changes). Each phase builds on the previous, ensuring nothing is missed and no information is accidentally lost.

  • Phase 1: Orient: list and read all memory files
  • Phase 2: Consolidate: merge duplicates, fix contradictions, update dates
  • Phase 3: Prune: trim MEMORY.md, remove stale pointers, shorten verbose entries
  • Phase 4: Report: brief summary of all changes made

Safe by Design

A PID-based lock file prevents multiple instances from consolidating simultaneously. If consolidation fails mid-run, the lock file mtime is rolled back so the gates retry sooner instead of waiting another 24 hours. The agent prefers editing over deleting. Information loss is treated as worse than verbosity.

  • PID-based lock with 60-minute staleness timeout
  • Mtime rollback on failure. No lost consolidation windows
  • Prefers editing over deleting. Errs on keeping information
  • Same provider/model as your main AI for prompt cache efficiency

Manual Trigger & Settings

Don't want to wait for the gates? Trigger consolidation manually from the behavior settings menu. Toggle the feature on or off, or adjust the minimum hours and session count thresholds to match your workflow.

  • One-click "Consolidate Memory Now" in behavior settings
  • Toggle on/off with immediate effect (no restart needed)
  • Configurable minimum hours and session count thresholds
  • Snackbar notification on completion: "Memory consolidated: N file(s) updated"

Under the Hood

Time + Session Gates

Checks two gates per turn (24h + 5 sessions). Both must pass. Cost: one os.Stat + one directory scan, negligible overhead.

PID-Based Lock

Prevents concurrent consolidation across multiple Plexon instances. 60-minute staleness timeout reclaims locks from crashed processes.

Cache-Optimized

Uses the same provider and model as your execution provider. Cached input tokens are ~90% cheaper, keeping consolidation cost under $0.05/day.

Fully Configurable

Adjust minimum hours, session count, or disable entirely. Manual trigger available for on-demand consolidation. Settings persist per-profile.