How the Dreaming Service Consolidates Past Transcripts into Memory Stores

The Dreaming Service is a batch-job feature that reads existing memory stores and raw session transcripts, processes them through a Claude model with optional steering instructions, and writes a new, distilled memory store that agents can reference in future sessions.

The Dreaming Service in the anthropics/cwc-workshops repository provides a mechanism to consolidate past transcripts into memory stores for Claude Managed Agents. This capability bridges live session interactions with batch distillation, transforming noisy conversation logs into structured, searchable knowledge that persists across agent sessions.

Understanding the Input Architecture

The Dreaming Service requires specific data sources to perform consolidation. According to agents-that-remember/README.md, the service reads from designated inputs that combine historical context with recent activity.

The Memory Store Input

Dreaming accepts an existing memory store as its foundational input. This store contains the agent's current knowledge base and serves as the baseline for consolidation. When creating a dream, you specify this via the input type memory_store with the corresponding ID.

The Session Transcript Input

Beyond the existing store, Dreaming ingests one or more session transcripts that represent historical or recent conversations. These transcripts provide the raw interaction data that the model distills into structured memories. The README explains that inputs are "what the dream reads from — here, the existing memory store plus the historical and recent sessions" (lines 30-36).

The Distillation Pipeline

Once inputs are configured, the Dreaming Service processes the data through a structured transformation pipeline that extracts salient information and organizes it into a new memory structure.

Model Configuration and Steering Prompts

Dreaming launches a Claude model—such as claude-opus-4-7—to perform the consolidation. You can optionally provide steering instructions via the --instructions parameter to guide how the model interprets and organizes the transcript data. This allows you to customize the distillation focus, such as emphasizing specific topics or formatting preferences.

Memory Extraction and Structuring

The model iterates over the provided transcripts, extracts relevant facts, and organizes them into a curated format. Rather than appending to the existing store, the service "runs a model over them, and writes distilled memories into a new memory store" (lines 32-36). This approach ensures the output is a clean synthesis rather than an incremental addition.

Output Handling and Store Replacement

The Dreaming Service produces a tangible output—a new memory store ID—that must be integrated into your agent workflow through specific session management practices.

Retrieving the New Memory Store ID

Upon completion, the dream's outputs array contains the identifier for the newly generated memory store. This store now holds consolidated memories that summarize the entire conversation history, enabling the agent to recall information from sessions it never directly participated in (lines 82-85).

Session Creation with Consolidated Memories

Memory stores attach to agent sessions at creation time and cannot be replaced in-place. To utilize the consolidated knowledge, you must create a new session pointing to the output memory store ID (referenced as $MEM_OUT in CLI workflows). As documented in agents-that-remember/README.md, "memory stores attach at session-create time — there's no in-place swap" (lines 11-13).

Command-Line Implementation Example

The following workflow demonstrates how to create a dream, retrieve the consolidated memory store, and initiate a new session using the distilled knowledge. These commands align with the implementation details found in agents-that-remember/README.md (lines 46-56 and lines 88-90):


# Create a dream that reads the current memory store and selected sessions

DREAM=$(ant beta:dreams create \
  --model claude-opus-4-7 \
  --input "{\"type\":\"memory_store\",\"memory_store_id\":\"$MEM\"}" \
  --input "{\"type\":\"sessions\",\"session_ids\":[\"$HIST1\",\"$HIST2\",\"$HIST3\",\"$SES_C\",\"$SES_D\"]}" \
  --instructions "I am attending CwC, and I want to remember what I've learned." \
  --format json | jq -r .id)

# Retrieve the new memory-store ID produced by the dream

MEM_OUT=$(ant beta:dreams retrieve --dream-id "$DREAM" --format json \
  | jq -r '.outputs[] | select(.type=="memory_store") | .memory_store_id')

# Run a new session that uses the consolidated store

SES_E=$(ant beta:sessions create \
  --agent "$AGENT" --environment-id "$ENV" \
  --title "Post-dreaming recall" \
  --resource "{\"type\":\"memory_store\",\"memory_store_id\":\"$MEM_OUT\"}" \
  --format json | jq -r .id)

# Query the agent using the consolidated memories

ant beta:sessions:events send --session-id "$SES_E" \
  --event '{"type":"user.message","content":[{"type":"text","text":"Give me a recap: which sessions have I attended, what resources do I have links for, and what follow-ups did I flag?"}]}'

The agents-that-remember/scripts/bootstrap.sh file in the repository provides additional context for setting up the initial agent, environment, and seeded historical sessions that serve as inputs for the Dreaming process.

Summary

  • The Dreaming Service ingests an existing memory store and one or more session transcripts to create consolidated knowledge.
  • It utilizes Claude models (e.g., claude-opus-4-7) with optional steering prompts to distill raw transcripts into structured memories.
  • The service outputs a new memory store ID rather than modifying existing stores in-place.
  • Memory stores bind to sessions at creation time, requiring new session creation to utilize updated consolidated memories.
  • This batch-processing approach enables agents to retain and recall information from conversations beyond their immediate session history.

Frequently Asked Questions

What data sources does the Dreaming Service require to create consolidated memory stores?

The Dreaming Service requires two primary inputs: an existing memory store containing the agent's current knowledge base, and one or more session transcripts representing historical or recent agent interactions. These are specified via the --input flag when creating the dream, using types memory_store and sessions respectively, as documented in agents-that-remember/README.md.

Why must I create a new session to use a consolidated memory store?

Memory stores attach to agent sessions at creation time and cannot be swapped in-place during an active session. Because the Dreaming Service generates a new memory store ID rather than updating the existing one, you must create a new session referencing the output store ID to access the consolidated knowledge.

Which Claude models are compatible with the Dreaming Service?

The Dreaming Service supports models such as claude-opus-4-7, specified via the --model parameter during dream creation. The chosen model processes the provided transcripts and optional steering instructions to extract and organize salient facts into the new memory structure.

How does the Dreaming Service transform raw transcripts into structured memories?

The service launches the specified Claude model with optional steering prompts, which iterates over the input transcripts to identify, extract, and organize salient facts. It then writes these processed memories into a new memory store, creating a distilled, curated representation of the conversation history that replaces the previous knowledge baseline.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →