Dreaming and semantic writes
Overview
Section titled “Overview”Signet separates source evidence from the knowledge derived from it. A memory, transcript, document, or other source artifact is stored as agent-scoped episodic evidence first. That evidence stays available for recall, provenance, repair, and later processing.
Dreaming is the semantic processing path. It selects evidence from the agent-scoped episodic surface, reasons over it with bounded daemon capabilities, and submits audited ontology operations. It can derive entities, aspects, claims, and links. It does not rewrite the evidence it used.
The architectural boundary:
- Episodic evidence records what was received.
- Dreaming derives semantic state from selected evidence.
- The daemon owns validation, scope, mutation, and audit.
- No LLM call runs inside a write-locked transaction.
For the storage lifecycle and search path, see Memory and recall. For worker startup, see Workers and maintenance.
What remember writes
Section titled “What remember writes”POST /api/memory/remember saves episodic evidence: normally one new row, several rows when it splits oversized content into chunks, or none when the content duplicates an existing memory. It does not create an extraction job, link entities, or change the graph.
- The row commits before the handler attempts an embedding, so keyword search can find it right away. The handler waits for that embedding attempt before it responds. An embedding failure does not roll back the saved memory.
- A
structuredpayload keeps its entity and aspect suggestions as evidence metadata on the row for Dreaming to read later. Its hints of 5 to 300 characters are written as retrieval hints on a best-effort basis; a failed hint write does not fail the remember. The suggestions are not applied to the graph, and the response reportsstructured_applied: falseandentities_linked: 0. - A remember that deduplicates to an existing memory returns that row with
deduped: true. It stores neither the newstructuredpayload nor its hints, and the response omitsstructured_appliedandentities_linked. - Mechanical mention-linking still exists, but only on explicit repair paths. Semantic graph changes go through the ontology operation path.
See the write API for the request and response contract.
The old extraction and decision worker is retired
Section titled “The old extraction and decision worker is retired”The former Pipeline V2 design ran a background extraction worker for each raw memory. That worker produced fact and relationship candidates, retrieved similar memories, asked an LLM to choose ADD, UPDATE, DELETE, or NONE, and applied the result through a controlled-write path.
That runtime no longer exists. The daemon does not create or lease new extract jobs. When the pipeline starts unpaused, it marks unfinished historical extraction jobs dead and their memories’ extraction_status as retired, keeping their provenance. The per-fact decision loop, runShadowDecisions, and applyPhaseCWrites are not current runtime surfaces.
The memory_extraction name may still appear in inference-router status. It is the workload binding Dreaming uses for inference; it does not mean the retired extraction worker is enabled.
The structural classification, structural dependency, and cross-entity dependency-synthesis workers are also retired.
Dreaming passes
Section titled “Dreaming passes”A Dreaming pass operates over one or more agent scopes. An undirected pass skips inference when there is no pending attention or episodic backlog; a directed pass (one with a user request) runs against already-recorded evidence anyway. When there is work, it follows this sequence.
1. Select evidence
Section titled “1. Select evidence”Dreaming searches the agent-scoped episodic surface: explicit memories, source artifacts, and completed transcripts. The search keeps source references and returns bounded excerpts, not an unbounded database view. Historical summary rows can be read with an explicit kind=summary request but are not part of the default delivery queue.
A completed transcript and its lineage are one source of evidence, not several independent facts. When a captured session has both a transcript artifact and a transcript record, the record is the Dreaming input; the artifact is offered only when no record exists. Credentials in delivered evidence are redacted on the way to Dreaming; the source row is not rewritten.
2. Reason with bounded capabilities
Section titled “2. Reason with bounded capabilities”Dreaming is an agentic pass, not a fixed per-fact classifier. Its capability registry defines what the agent can do:
search_evidencereads immutable episodic memories, artifacts, and transcripts. Without a query it pages through the delivery queue and reportshasMoreuntil the queue is empty. The queue is ordered by when Signet received each source revision, not by the source’s own date, so a newly connected vault of old notes counts as new. Every fourth slot, starting with the first, goes to the longest-waiting source that has not stalled, so a stream of new evidence cannot starve older sources. A page holds one excerpt per source, and a partly reviewed source continues on a later page by itself. Within a pass a source resumes where the pass last read it. A source reviewed partway in an earlier pass resumes 200 characters before its reviewed end, snapped back to a sentence or paragraph start, and the excerpt’sreviewedCharscounts the characters already reviewed. The runbook tells the agent to file and acknowledge each page before asking for the next, which limits repeated work when a pass runs out of time; the queue does not enforce that order. Once a pass has used half its timeout, the queue stops handing out new sources (deliveryClosed) so the pass can file what it read; the rest goes to the next pass. With a query it searches full history. The query is split on whitespace into words that match independently (ASCII case-insensitive), fuller matches rank first, and unspaced text such as CJK matches as one phrase.review_evidenceacknowledges the excerpts a pass has reviewed. The agent copiessourceRefandcontentOffsetfrom an excerpt delivered in the same pass and scope, and acknowledges the whole excerpt or names an exactthroughquote where its review stopped. The daemon converts that to a character offset. It rejects the whole call with a specific code when the excerpt was not delivered in this pass, belongs to another scope, does not contain the quote, or has changed since delivery.search_entitiesandget_entityread the scoped graph.list_aspect_claimslists claims with their evidence, and optionally the aspect’s contradictions.attention_listlists queued review and maintenance attention beyond what the pass prompt includes.validate_proposalruns deterministic checks.runbook_writewrites Dreaming’s per-pass operational note, andzoom_historyopens a line of pass history back into the passes and records it came from.apply_ontology_opsapplies daemon-owned semantic mutations.
The same scope-bound registry serves the in-process agent and the MCP, HTTP, and CLI surfaces. Capability input is validated before execution, and graph reads and writes stay bound to the requested agent scope.
A source’s evidence cursor advances only by text acknowledged with review_evidence or cited by a successful apply_ontology_ops operation, extended contiguously from the stored cursor when the pass finalizes. If only whitespace remains after that point, the source counts as fully reviewed unless the pass deferred it. Delivered text that is never acknowledged stays queued.
A source revision delivered in three successful passes without progress gets a visible evidence_requeue attention record and leaves the continuation queue, so fresh sources are served first. Passes that defer the source, or withhold its progress after a failed write, do not count toward those three. The record does not schedule a pass by itself. It resolves when the source makes progress or is excluded as reviewed. Cursors written before this rule have cursor_basis = 'delivery'; new writes use 'review'.
runbook_write accepts reviewedExcludedEvidence for source revisions the pass read completely and found to contain no durable fact. Each entry names the owning agentId and sourceRef, so a multi-scope pass cannot attribute a source to the wrong scope. The exclusion applies to that revision only: a newer revision becomes eligible again. A temporary blocker belongs in deferredEvidence instead.
3. Model instructions
Section titled “3. Model instructions”Dreaming’s pass instructions tell the model what to file. Among other things, they tell it to:
- file only settled facts such as outcomes, decisions, shipped changes, and stable behavior, not suggestions, hypotheses, or open questions;
- treat a concrete deliverable produced for the user’s own project, such as a budget or schedule, as durable, worded as proposed rather than confirmed;
- file what users disclose about themselves when asking for advice, but not the advice itself;
- put the user’s claims on a person entity named after the user when the source gives a name, otherwise on one entity named
User, and put each named speaker’s statements on that speaker’s own entity; - file one fact per claim and keep the dates, amounts, counts, and names the source gives;
- create a missing entity or aspect in the same pass, and defer a source only while its transcript is mid-stream or a tool error persists after the call is corrected.
These are model behavior policies, not guarantees. Deterministic validation separately enforces scope, citations, and operation constraints. The memory_head_read and memory_head_commit tools are offered only to content passes, which are the only passes that can publish the head.
4. Validate and apply ontology operations
Section titled “4. Validate and apply ontology operations”Dreaming expresses semantic changes as structured ontology operations, not direct SQL or memory-row edits. apply_ontology_ops is the only semantic-mutating capability; runbook_write updates operational notes and does not author graph state.
The daemon validates every operation, citation, and target before writing. Checks include entity-label quality, duplicate entities, contradictions with active aspect values, and graph write caps. The model is not trusted to stay within bounds.
Writes are bounded and ordered, not globally atomic:
- One request carries at most 100 operations.
- The daemon applies them in writer transactions of at most 10 operations or about 50 ms each, so a large request does not hold the SQLite write lock for long.
- Each operation runs inside its own savepoint. A failed operation rolls back alone and does not stop later operations.
- If a writer transaction fails after earlier transactions committed, the result has
retryable: trueandretryFrom, the index of the first uncommitted operation. Retry only that suffix.
See POST /api/dream/operations for the request contract.
Applied operations record their effects and failures and keep evidence and version history. Claims and links keep their provenance so later review can tell source truth from the current semantic view. Inference and embedding run before the short database write phase, so a slow provider call never holds a write lock.
5. Record pass state
Section titled “5. Record pass state”Dreaming records pass status, tool calls, applied, skipped, and failed mutation counts, evidence progress, and a summary. The evidence watermark advances only when the pass consumes the relevant backlog.
Failed writes withhold progress narrowly:
- A failed operation withholds progress only for the sources it cites, unless a successful write in the same pass cited the same source with the same quote.
- A failure that cites no source, including operations that could not be parsed, withholds progress for the sources in its agent scope that no successful write cited. Filed sources and other scopes still record what was read.
- Hygiene operations (flags, declines, and the archives and merges that cite attention records) carry no evidence, so their failures withhold nothing.
- A failed write whose trace cannot be read withholds every scope in the pass.
An incremental-content pass must stage exactly one memory_head_commit and fails if the agent ends without one. A commit over the 1000-token head budget is rejected when staged and does not count, so the agent can shorten it and commit again. A pass with nothing to publish resubmits the current entries, or an empty entry set while the head is still empty. The database owner applies the staged head in the same transaction as pass completion and watermark updates. If validation or any finalization write fails, the head, pass completion, and watermark roll back together. MEMORY.md is a projection: a publication failure leaves a durable pending publication for a later read to recover and does not fail the committed pass. A hygiene-only pass must not hide unprocessed content from a later content pass.
The retained synthesis worker does not author or publish MEMORY.md; Dreaming’s content pass does.
Dreaming has four pass modes: incremental, compact, incremental-content, and incremental-hygiene. These are pass modes, not the retired per-fact ADD/UPDATE/DELETE decision modes.
When Dreaming runs
Section titled “When Dreaming runs”Scheduled Dreaming passes run only while Dreaming and Pipeline V2 are enabled, the pipeline is not paused, and mutationsFrozen is off. A manual trigger does not need dreaming.enabled, but it still needs the pipeline running, mutations unfrozen, and inference available. The daemon checks this live before each pass. mutationsFrozen also keeps the prospective-hint worker from starting. It does not stop the other pipeline workers or every evidence, index, or retention write.
Fresh installs enable Dreaming by default. If no inference provider is connected, the scheduler reports blocked with reason: "inference_unavailable", runs no passes, rechecks every 30 seconds, and resumes once the Dreaming route resolves. signet setup --enable-dreaming turns Dreaming on for an existing workspace.
Retired extraction, write-gate, and legacy provider-routing keys are rejected when the config loads. See Pipeline configuration for supported controls and Inference and routing for model selection.
Explicit ontology extraction
Section titled “Explicit ontology extraction”POST /api/ontology/extract is an explicit operator path, separate from scheduled Dreaming. It reads selected episodic material and can use an inference provider to propose ontology candidates: entities, claim values, links, actions and policies, assertions, and questions.
It is a dry run by default. write_proposals and write_assertions opt into persisting results. The provider is instructed not to write memory or invent unsupported facts. This path produces proposals and assertions; it is not the retired per-memory fact extractor. See POST /api/ontology/extract.
Content normalization and deduplication
Section titled “Content normalization and deduplication”The remember path, document ingest, and other ingestion paths run content through normalizeAndHashContent before storage or hashing. It produces:
storageContent: line endings normalized to\nand outer whitespace trimmed. Internal whitespace, newlines, and casing are preserved. This is the stored content.normalizedContent:storageContentlowercased, whitespace collapsed to single spaces, trailing[.,!?;:]+removed, and trimmed. Used for matching and hashing when non-empty.contentHash: the SHA-256 hex digest ofnormalizedContent, or of lowercasedstorageContentwhen the normalized value is empty. Used for exact-content deduplication and embedding lookup.
Source truth and semantic truth
Section titled “Source truth and semantic truth”The source record and the semantic graph serve different purposes:
- Source evidence is kept for provenance and recovery.
- Semantic claims and links are the current view derived from that evidence.
- Dreaming may revise semantic state as new evidence arrives.
- A semantic revision does not rewrite the evidence behind an earlier state.
- Dreaming’s evidence reads and ontology writes stay inside the agent scopes of the pass.
This separation makes the graph repairable. When a source is removed or new evidence contradicts a claim, Signet can review derived state without pretending the original source never existed.
For the graph model, see Knowledge architecture and Knowledge graph persistence. For recall’s authorization boundary, see Memory and recall.
Retired concepts
Section titled “Retired concepts”These names may still appear in historical migrations, logs, tests, or old configuration examples. They do not describe the current semantic write path:
- per-memory
extractjobs - the extraction fact/entity JSON contract
runShadowDecisionsADD,UPDATE,DELETE, andNONEfact decisionsapplyPhaseCWrites- the old
memory_historydecision record for every extracted fact - background structural classification and dependency writers
- inline entity linking on remember
memory.pipelineV2.writeGateand legacy extraction provider routing
When diagnosing current behavior, start with the Dreaming pass, its scoped capabilities, the ontology operation contract, and the daemon’s audit records.

