Docs

The Brain · 03.09

Shared Intelligence

The cross-scope brain graph that unifies chat-as-dispatch with the rest of workspace memory.

Shared intelligence

The one service most of the Brain is built on

SharedIntelligenceService is the layer that actually implements retrieval (hybrid search, MMR diversification, optional reranking — see Recall & Grounded Answers) and formation (promote(), the entry point the formation pipeline runs through). Skills, personal notes, and Brain-ask all sit on top of it rather than reimplementing retrieval or formation themselves.

A graph, not just a flat list

Memory atoms aren't just individually retrievable — they're linked into a BrainGraph of nodes and typed relations, scoped by BrainScopeKind. That graph structure is what lets a chat turn's memory-formation event and a workflow run's promoted lesson end up in the same connected knowledge fabric instead of two disconnected silos that both happen to be called "memory."

One gate, not three

The Brain has three write surfaces that read like separate products — an agent's own memory_append tool, an App's learned outcomes, and the memory mined from ordinary chat — but they're the same table underneath, and now they share the same floor. Chat-mined memory has always run through a deterministic gate before anything reaches the Formation Judge (see the formation pipeline): structural garbage — bare URLs, table rows, first-person process narration — never becomes a candidate. An agent's explicit "remember this" and an App's own recorded lessons used to skip that gate entirely; a raw tool call or a malformed lesson template could land in memory unfiltered. Both paths now run the same rejection check before anything is written, and an agent's explicit memory additionally dedupes against that agent's own recent notes — the same discipline "which surface wrote this" used to determine.

The Formation Judge's own ADD decision gets a second, deterministic backstop for the same reason. The judge decides ADD by comparing a new fact against a freshly semantic-searched set of neighbors — a real judgment call, not a guarantee. If it's wrong twice in a row about the same fact (the failure mode that let one hallucinated preference compound into hundreds of duplicate entries in a well-known competitor's production incident), a hard cosine/lexical duplicate check catches it and reinforces the existing atom instead of writing a second copy — the same backstop every other write path in the Brain already had.

Closing the loop: recall that's graded by outcome

Retrieval and formation aren't the whole story — applyEvaluatorVerdict is what keeps the Brain from treating every memory as equally trustworthy forever. When a workflow node or a converge loop settles with a pass or fail verdict, every atom that was injected into that run's context gets its confidence nudged: a pass raises it, a fail lowers it, and an atom that drops far enough gets archived. This is the gradient that makes the Brain self-regulating instead of write-only — a rule that keeps steering runs toward failure loses standing over time, without anyone having to manually prune it.

That adjustment used to be uniform: every atom present in the run's context moved by the same amount, whether the agent's answer actually relied on it or was just handed it as ignored context. It's now usage-weighted — the response is scanned for the [mem:id] citation tags every injected atom carries (see Recall & Grounded Answers), and an atom the response actually cited gets the full delta, while one that was merely present earns only partial credit. Being handed to an agent and being relied on are different things, and the confidence signal now reflects that difference instead of rewarding (or blaming) memories for simply showing up.

Continue