DuoDuo docs

Install, use, and operate DuoDuo.

These docs cover durable files, event ordering, sessions, the scheduled subconscious, the intuition layer, and host operations.

Check health, logs, channels, and memory.

Operate

Memory & Compaction

Keep useful context without letting old conversations grow forever.

A transcript, the active model context, and long-term instinct are three different things with three different lifecycles. Treating them as one thing is why most chat products either forget everything or drown in their own history. DuoDuo keeps them apart on purpose.

The filesystem is the durable body
Durable runtime state
runtime_dir/var/
events/Spine WAL · source of truth
sessions/conversation state
jobs/scheduled work
outbox/channel egress queue
usage/measured activity
Kernel · a Git repo
kernel_dir/
config/channel defaults
memory/intuition layer + dossiers
subconscious/partitions + playlist
Workspace
/your/project/

The project files the agent is reading and changing. The session stays attached to this workspace.

The filesystem is the database. The Spine WAL is the record of everything that crossed the machine's boundary—what audit, duoduo spine, and the subconscious read, and what the daemon rebuilds its routing from after a restart. Each runtime keeps the conversation it resumes in its own session files beside it. The kernel's Git history records every change to memory and configuration. Locks, PIDs, and heartbeat bookkeeping live separately as ephemeral files—safe to clear, never needed to recover. Run duoduo daemon config to see the paths used on this machine.

Three kinds of continuity#

LayerPurposeWhat survives
Session historyContinue one conversation with its workspace and model historyThe original transcript and session state remain on disk
Active contextGive the current model enough recent history to actIt can be compacted when it becomes expensive
Intuition & dossiersCarry distilled instincts and knowledge across sessionsDossiers, lessons, grooves, and the compact intuition layer live in the kernel

Compaction manages active context. The subconscious tends the intuition layer and its dossiers. Neither ever needs to delete the original event history.

From event evidence to intuition#

The pipeline is evidence-driven, and it is split in two so that reading experience and rewriting instinct never compete for the same wake:

  1. External interactions and tasks enter the append-only event history—every channel and every runtime share this one timeline.
  2. Distil. One partition reads a bounded stretch of that history and writes fragments. Each fragment names the line of the intuition layer it tested and says whether that line helped, should have fired and did not, or had nothing to act on.
  3. Fold. Another partition—the only writer of the intuition layer—reads the accumulated fragments and moves the layer: add a line, rewrite one, reorder, retire, or re-point it at something reachable.
  4. Alongside them, entity dossiers are kept current, and a verified correction arc becomes a lesson while a procedure that converged through repeated use becomes a groove.
  5. The committer stages the kernel working tree and lands one commit, so every step above has a diff and a revert.

The compact intuition layer is loaded into future foreground sessions. Deeper dossiers stay linked on disk and are opened when a task needs them. A later session starts with the instincts, not the archive.

Not every pass adds something. Greetings, receipts, transient task detail, and evidence that repeats what is already known produce no fragment, and a fold that finds nothing worth changing leaves the layer alone. The record is preserved either way; the layer only moves when something held up.

It is told what it is not using#

Writing memory is the easy half. The hard half is knowing which lines are dead weight, because a line nobody reads still costs a slot in every prompt.

So the fold side gets a second input: an activation report counting how often each line is actually read during real work. A line that never fires arrives as evidence to rewrite, re-point, or retire it. The count is kept in days when someone actually worked with DuoDuo rather than calendar days, so a quiet week does not age out a line that was earning its place.

It is a layer above your harness's memory, not a replacement#

Claude Code reads its CLAUDE.md; Codex and Pi read AGENTS.md. Those files are yours—instructions you wrote, scoped to one harness and one project, read by that harness for itself. DuoDuo leaves them alone and they keep working.

The intuition layer sits above that and answers a different question.

Harness memoryIntuition layer
Who writes itYouThe subconscious, from event evidence
ScopeOne harness, one projectEvery harness on the host
Says whatHow this project wants to be worked onWhat has actually held up while working on it
When it changesWhen you edit itOn a cadence, with a Git commit

They stack rather than compete: your instructions still apply, and the intuition layer adds what nobody sat down to write.

It reaches every runtime because of what it is made of. A lesson fine-tuned into weights belongs to one model; a lesson written into a harness's config belongs to one harness. Written as text, it is bound to neither—so a correction earned in a Claude session is already in the Codex job that runs tonight, and in the Grok partition that wakes tomorrow. Prose is the only representation that crosses all four, which is why the pipeline distills into it rather than into anything more structured.

Manual compaction#

Use /compact in the current conversation or queue it from the host:

duoduo session compact <session-or-alias>

Compaction summarizes older active context to make room. It does not delete the original transcript.

DuoDuo tightens a teal band around the end of a long, connected accordion transcript.

Idle auto-compaction#

Idle auto-compaction is available for channel sessions and is off by default. When enabled, it can prepare a large conversation during a quiet period instead of making the next reply reopen the entire cold context.

Configure it per conversation unless the user explicitly wants a kind-wide policy:

duoduo session config <session-or-alias> get
duoduo session config <session-or-alias> set \
  auto_compact_idle_minutes=<chosen-idle-window> \
  auto_compact_min_context_tokens=<chosen-context-floor>

Choose these values from the backend's cache behavior, the measured post-compact floor, and how often the user returns after a long gap. The published smart-compaction skill reads the daemon's measurements and applies the break-even rules.

Inspect the memory graph#

duoduo memory check --dry-run
duoduo memory board-lint
duoduo memory entity-lint
duoduo memory node-lint

These commands are the mechanical, no-model half of memory maintenance. They measure gaps and broken references and can route repair signals to compatible subconscious partitions. The normal checks do not delete memory data. Reclaiming data is a separate explicit operation and should begin with a dry run.

Prompt and memory history#

The kernel is initialized as a Git repository, so every change to memory, subconscious prompts, the playlist, and channel descriptors is a reviewable commit.

Package upgrades preserve existing subconscious prompts because they may have changed on this host. When a release ships revised defaults, compare the published partition tree with your kernel, preserve user-authored partitions, and create a rollback point before refreshing anything.