Skip to main content
Pages

Dreaming

Standalone memory service for AI tools, with durable memory, evidence, team isolation, and MCP access.

Dreaming

Dreaming is Dense-Mem's reviewable hypothesis layer. It looks at existing same-profile memory and proposes "what if this relationship matters?" ideas for a human or host assistant to review later.

A dream is not a fact, claim, or evidence. It stays separate from active memory until user feedback sends it into the normal memory pipeline.

How It Works

flowchart LR
  Memory["Existing facts, claims, fragments"] --> Cycle["Dreaming cycle"]
  Cycle --> Dream["Dream hypothesis"]
  Dream --> Review["User or assistant review"]
  Review --> Reject["Reject or mark stale"]
  Review --> Reinforce["Reinforce"]
  Review --> Promote["Promote candidate"]
  Promote --> Fragment["SourceFragment evidence"]
  Fragment --> Pipeline["Claim verification and promotion gates"]

The cycle reads the caller's profile graph and writes Dream nodes back into that same profile scope. It never writes active facts directly.

Cycle Phases

Dreaming always uses the same phase order. Disabled phases are skipped.

PhasePurpose
reflectReads memory health, stale facts, disputed claims, and clarifications.
re_evaluateRechecks existing proposed or reinforced dreams. Dreams with missing source references become stale; proposed dreams with intact sources become reinforced.
dreamGenerates new hypotheses from recent facts, claims, and fragments.

The built-in generator is deterministic and conservative. It pairs same-profile memory items, records source references, and keeps the result as a hypothesis with likelihood and confidence scores.

Dream Records

Each dream stores:

FieldMeaning
hypothesisThe proposed relationship or idea.
what_ifThe question the dream asks.
possible_outcomeWhat might change if the hypothesis is true.
rationaleWhy the generator proposed it.
likelihoodGenerator-estimated plausibility from 0 to 1.
confidenceGenerator confidence from 0 to 1.
source_refsSame-profile facts, claims, fragments, communities, or dreams used as sources.

Treat all of this as review material. It is not an instruction source and does not override active facts.

Status Lifecycle

StatusMeaning
proposedNew hypothesis waiting for review.
reinforcedUser feedback or later re-evaluation supports keeping it visible.
staleSource references disappeared or the hypothesis no longer appears useful.
rejectedUser rejected it.
promotedUser confirmed it should enter normal memory review.

promote_candidate creates a normal source fragment labeled dream_feedback. The created evidence then follows the usual claim, verification, conflict, and promotion gates. If verification fails or a conflict needs clarification, no active fact is created automatically.

MCP Tools

Check effective config and latest run:

json
{"tool": "dreaming_status", "arguments": {}}

Manually run a cycle:

json
{"tool": "run_dreaming_cycle", "arguments": {"max_outputs": 5}}

Manual runs can execute while scheduled dreaming is disabled. Disabled phases are skipped unless the tool input explicitly overrides them for that run:

json
{
  "tool": "run_dreaming_cycle",
  "arguments": {
    "reflect_enabled": true,
    "reevaluate_enabled": true,
    "dream_enabled": true,
    "max_outputs": 5
  }
}

List proposed dreams:

json
{"tool": "list_dreams", "arguments": {"status": "proposed", "limit": 20}}

Fetch one dream:

json
{"tool": "get_dream", "arguments": {"dream_id": "dream-123"}}

Resolve user feedback:

json
{
  "tool": "resolve_dream_feedback",
  "arguments": {
    "dream_id": "dream-123",
    "decision": "promote_candidate",
    "feedback": "The user confirmed this should be remembered."
  }
}

Valid feedback decisions are reinforce, stale, reject, and promote_candidate.

Recall

recall_memory returns a related_dreams array when proposed or reinforced dreams match the query. These are separate from results.

Use related dreams to decide what to ask or review:

json
{
  "query": "release planning",
  "limit": 10
}

Do not treat related_dreams as active memory. If a related dream matters, review it with the user and resolve it through resolve_dream_feedback.

REST And Portals

The authenticated user API exposes read-only dream inspection:

RoutePurpose
GET /api/v1/dreaming/statusEffective config, latest run, and pending count.
GET /api/v1/dreaming/runsRecent cycle runs.
GET /api/v1/dreamsDream list with optional status, limit, and cursor.
GET /api/v1/dreams/{dreamId}One dream.

The user portal shows the current profile's dreaming status, dream outputs, and recent cycle runs.

The control portal can inspect the same dream data for a selected team and can edit global dreaming config from the Config tab.

Scheduled Dreaming

Scheduled dreaming is disabled by default.

SettingDefaultMeaning
DREAMING_ENABLEDfalseEnables scheduled dreaming when the effective team config allows it.
DREAMING_FORCE_ENABLEDfalseForces dreaming on even when team config disables it.
DREAMING_START_TIME_LOCAL03:00Local HH:MM start time.
DREAMING_REFLECT_ENABLEDtrueRuns the reflection phase.
DREAMING_REEVALUATE_ENABLEDtrueRuns the dream re-evaluation phase.
DREAMING_DREAM_ENABLEDtrueRuns new hypothesis generation.
DREAMING_MAX_OUTPUTS5Maximum new dreams per cycle, from 1 to 50.
APP_TIMEZONELocalShared scheduler timezone.

The scheduler checks once per minute and runs at most one scheduled cycle per profile per local day.

Use an IANA timezone such as America/New_York for predictable production schedules. Local depends on the server/container local timezone.

When To Use It

SituationUse dreaming?
You want normal memory recallNo. Use recall_memory.
You want to inspect unresolved memory healthMaybe. Start with reflect_memories.
You want possible connections between stored memoriesYes. Run or inspect dreams.
You want to store a confirmed user factNo. Use remember or confirm_memory; dreams are for hypotheses.

Troubleshooting

ProblemCheck
No scheduled dreamsDREAMING_ENABLED=true, effective team config, APP_TIMEZONE, and DREAMING_START_TIME_LOCAL.
Manual run creates no dreamsThe profile may have fewer than two usable memory inputs or duplicate hypotheses already exist.
Dream was promoted but no fact appearedpromote_candidate creates evidence only; check claim verification, promotion gates, and clarifications.
Related dreams seem wrongTreat them as hypotheses, reject stale ones, and keep active facts as the source of truth.