Auto Dream
auto_dream is ReMe's long-term memory distillation flow from daily to digest. By default it scans the target date and the previous day, processes only files changed since the previous dream, extracts a small set of high-value memory units across that window, and integrates them into digest/.
Its daily inputs usually come from Auto Memory and Auto Resource. For the file semantics of digest/, Sources sections, and wikilinks, see Memory as File. For the linking strategy used during Integrate, see Auto Link. Proactive discovery is a separate flow; see Proactive.
Three memory tasks in the Proactive configuration
reme start config=proactive runs three independent memory tasks: dream_personal maintains personal preferences and long-term requirements, dream_procedural maintains verified methods, and dream_wiki maintains knowledge and conclusions. Their directories are digest/personal/, digest/procedure/, and digest/wiki/, under the configured digest_dir.
Three collectors run 15 minutes apart in the application timezone. This follows the system timezone (including TZ), falls back to Asia/Shanghai when unavailable, and can be overridden with timezone=<IANA-name>:
| Collector | Time | Recipient |
|---|---|---|
| dream_personal_cron | 23:00 | dream_personal |
| dream_procedural_cron | 23:15 | dream_procedural |
| dream_wiki_cron | 23:30 | dream_wiki |
Each Step binds source_runtime: proactive_memory and uses that Runtime's record namespace: daily/YYYY-MM-DD/proactive_memory_HHMMSS.md, including numeric collision suffixes. Other tasks' notes and handwritten daily files are excluded. Each recipient keeps its own path/mtime checkpoint in {metadata_dir}/memory_dream/{runtime_name}.json, so one task cannot consume another task's scan progress. Scans wait for an active source round to finish, so a failed round's discarded draft is not admitted. When a collector has several recipients, a failed recipient does not prevent attempts to the others. Failures are reported together after all recipients are attempted, and successful checkpoints remain available for retries. The first scan admits existing records; later scans admit only added or modified versions. A recipient's checkpoint advances only after durable admission. Each file is one event. Each Agent round claims up to 30 events, combines the materials by topic and updates memory; remaining inputs continue in later rounds. Read files individually or in ranges; the Inbox's item and byte limits still apply. The collector or recipient retries failures. Scans use no file watcher or source copies. Staggered starts do not guarantee serial execution when a round or retry runs long.
Initial TASK.md text lives in proactive.yaml as initial_task; startup creates only missing task files. All three tasks share the memory-dream Skill and use Codex / Claude Code Harness file tools. list_digest_memory reads the complete bound category, while search_workspace enables expand_links by default and restricts both search hits and expanded neighbors to the injected digest scope. Agents update existing subjects first, resolve conflicts by the original information's time, and use ordinary relative Markdown links for evidence and meaningful relationships. For new files, use lowercase English words joined with underscores to name one stable topic, such as communication_preferences.md; name matches the filename without .md. Use one concise, plain-language sentence for description, and structure the Markdown body around the valid information, conditions and evidence. Quote frontmatter strings and reread them with a YAML parser. Update existing topics in place and repair references when a rename is necessary. Keep paths and process details in the final reply; reminders only state the most useful change. The shared execution prompt supplies the actual workspace. File paths in events and tool results are workspace-relative; convert them to paths relative to the current file's directory when writing Markdown links. For example, link from digest/personal/preferences.md to digest/wiki/writing.md as [writing methods](../wiki/writing.md).
After edits and verification, call submit_summary(content=...) once when a change is worth sharing. The tool writes the message directly to the task's outbox with system-assigned P2 priority. No call or empty content adds no reminder; repeating the same submission within a round is idempotent. Summaries create no Markdown files or new daily inputs. Queued reminders survive later model failures and are retried after delivery failures or restarts. Submission does not mean the user has seen the reminder. These three tasks use memory-dream; other tasks retain proactive-record. The scanner does not rewrite source notes, existing digest files, or Remy/MEMORY.md.
proactive_memory first records explicit user requirements, project progress, methods and verification results, knowledge conclusions and source links. The dream tasks then organize long-term memory. Updated default TASK text applies to new workspaces; existing TASK.md remains user-controlled.
For an existing workspace, preview the migration from the repository root:
python -m scripts.migrate_memory_dream .remeStop the old ReMe service, run python -m scripts.migrate_memory_dream .reme --apply, then start reme start config=proactive or config=proactive_cc. The tool backs up original state, preserves eligible admission progress, marks only out-of-scope pending inputs from the old collector as skipped, and sets the three batch sizes to 30. It updates the old default proactive_memory/TASK.md, preserves custom task text and reports when it needs merging. Daily, digest and the legacy snapshot are retained. Applying refuses active Inbox owners; reruns preserve new checkpoints.
The sections below describe the retained auto_dream / dream_cron workflow in the default configuration. Select the appropriate configuration and avoid running both writers over the same memory simultaneously.
Configuration
The default configuration is in reme/config/default.yaml:
auto_dream:
backend: base
parameters:
date:
type: string
default: ""
hint:
type: string
default: ""
scan_days:
type: integer
default: 2
max_units:
type: integer
default: 5
steps:
- backend: dream_extract_step
file_catalog: dream
scan_days: 2
max_units: 5
- backend: dream_integrate_step
- backend: dream_finish_step
file_catalog: dream
- backend: auto_tag_stepParameters:
| Parameter | Purpose |
|---|---|
date | Date to process in YYYY-MM-DD format. When empty, use today in the application's timezone. |
hint | Additional guidance from the caller for the Extract and Integrate stages. |
scan_days | Recent-date window ending at date; defaults to 2 and has a minimum of 1. |
max_units | Maximum reusable units extracted in one run; defaults to 5. |
Inputs and Outputs
Inputs are daily Markdown files from the most recent scan_days ending at the specified date. For example, date=2026-06-20 with scan_days=2 scans:
daily/2026-06-19.md
daily/2026-06-19/**/*.md
daily/2026-06-20.md
daily/2026-06-20/**/*.mdOnly Markdown day indexes and notes are scanned. Proactive state and interests.yaml are not Auto Dream inputs.
The main outputs are:
| Output | Description |
|---|---|
digest/procedure/*.md | Methods, workflows, runbooks, and executable experience. |
digest/personal/*.md | User-, team-, and project-related preferences, facts, and long-term context. |
digest/wiki/*.md | General knowledge, concepts, observations, and decision precedents. |
metadata/file_catalog/dream* | Dream-specific catalog used to detect changes in daily inputs. |
Four Stages
1. Extract
dream_extract_step performs three tasks:
- Refresh each
daily/<date>.mdin the scan window. - Scan those day indexes and
daily/<date>/**/*.md, comparing mtimes withfile_catalog: dream. - Send all changed files together to the LLM and globally extract structured memory
units.
units are long-term memory units ready to be distilled into digest. Each has name, bucket, summary, and paths. A run returns at most max_units; extraction merges cross-file evidence for the same abstraction and drops passing mentions, per-file summaries, and weak candidates without reusable value. bucket may only be procedure, personal, or wiki; unknown values are routed to wiki.
If there are no changed files, Extract succeeds with no units; Integrate then has no unit work, and Finish still performs its normal catalog summary. If files changed but no LLM is configured, Extract fails because extraction requires an LLM.
2. Integrate
dream_integrate_step invokes an agent independently for each unit and integrates that unit into one digest node. It exposes these tools to the agent:
node_search, read, frontmatter_read, write, edit, frontmatter_updateThis stage carries the core responsibility of auto_link. It first uses node_search to recall similar or related nodes at digest-node granularity, decides whether to create or update a node, and finally writes sources and related digest nodes as wikilinks. See Auto Link for the recall, deduplication, and edge-writing rules.
Extract is the gate for deciding whether material is worth remembering, so Integrate has no SKIP action: each admitted unit must land in exactly one digest node. Creates and updates must retain provenance and weave related digest links into contextual sentences; bare wikilinks and standalone relationship fields are not valid output.
There are four integration actions:
| Action | Meaning |
|---|---|
CREATE | No equivalent abstraction exists; create a new digest node. |
CORROBORATE | The same memory appeared again; append a source or strengthen the description. |
REFINE | New material adds boundaries, steps, prerequisites, applicability, or detail. |
CORRECT | New material corrects errors, omissions, or conflicts in the existing node. |
Successfully integrated units are recorded in integrate_results. Failed units enter failed_units, and their source paths enter failed_paths. The Finish stage does not checkpoint failed paths, ensuring that they can be retried later.
3. Finish
dream_finish_step completes the run:
- Write successfully processed changed paths to
file_catalog: dream. - Also write refreshed day-index pages observed by Extract in the scan window to the catalog.
- Persist the dream catalog if there were upserts or deletions.
- Return a summary containing counts for scanned, changed, integrated, checkpoints, and related values.
Auto Dream neither reads nor writes proactive state or interests.yaml. Those files are owned by the proactive refresh pipeline; see Proactive.
Failed paths are not checkpointed. The next auto_dream run therefore continues to treat them as changed inputs until integration succeeds.
Checkpoints retain the input mtimes observed by Extract, including scanned day-index pages. If a source is edited while model work runs, its newer version remains changed for a later run, even after restart. The later run must include the source date in its scan window. Finish does not checkpoint files absent from that scan.
4. Auto Tag
After Finish, both auto_dream and dream_cron run auto_tag_step on Markdown digest files actually created or modified during integration, including writes recovered after agent errors. Repeated writes to one file are tagged once. The Step uses the same request-scoped changes contract as Auto Memory and writes entity tags to the configured frontmatter key, memory_tags by default. Unchanged files and daily source notes are not tagged by Dream.
Tagging diagnostics appear in metadata.auto_tag. Per-file tagging failures preserve the dream answer, success status, and checkpoint decisions. A later run without file changes does not automatically retry failed tagging. Tag-index updates follow the existing asynchronous file watcher.
Running Auto Dream
Start the service in one terminal and leave it running:
reme start config=defaultFrom another terminal, call the running service:
reme auto_dream date=2026-06-20With caller guidance:
reme auto_dream date=2026-06-20 hint="Prioritize engineering decisions and long-term preferences"Override the default scan window and unit cap:
reme auto_dream date=2026-06-20 scan_days=3 max_units=8The same set of steps can also be placed in a cron Job, for example to run every morning:
jobs:
daily_auto_dream:
backend: cron
cron: "30 3 * * *"
steps:
- backend: dream_extract_step
file_catalog: dream
- backend: dream_integrate_step
- backend: dream_finish_step
file_catalog: dream
- backend: auto_tag_stepImportant Boundaries
auto_dream consumes only daily inputs and does not rewrite daily bodies. Daily preserves facts and the original situation; digest is the abstracted long-term memory layer.
digest is not a copy of the source text. Its body should preserve reusable abstractions, while a Sources section points back with contextual sentences such as The decision was recorded in [[daily/<date>/decision.md]]. Links follow the workspace-relative wikilink semantics described in Memory as File.
auto_dream does not invent an overview from nothing. Only content that actually appears in daily input and is extracted as a memory unit can enter digest.
The complete flow depends on an LLM for Extract, Integrate, and Auto Tag.