---
source_hash: f346605efc2c8b3f72b76f27009b8a4b793fd0dfb53f14e333b8e1b4ee96ed07
post: /posts/memory/active-brain
shape: doctrinal
---

# Context Pack: Active Brain

Agent reference for the rewritten essay. Only the quoted excerpts below are verbatim; the rest is a summary of the design, not a claim that all interventions are enabled.

## Verbatim excerpts

> First prompt is boot. Active Brain is attention. Silence is the feature.

> Most turns should pass without an interruption.

> The observer opens the knowledge store read-only.

> My usefulness gate is at least 70% useful on a sample of 50 offers.

## Purpose and boundaries

Cortex supplies opening context. Active Brain is a separate mid-session observer for the advisor seat, offering a recall handle and a one-line reason when useful. Its four offer types are Past fix, Analogous, Contradicts and Tangent. Background worker sessions never receive injections.

The prompt hook is cache-only: check the kill state, refuse workers, read the session cache, reject stale offers, check confidence, session budget, minimum gap and token ceiling, then print an eligible offer or nothing. No search, embedding, model call, skip notice or zero-hit banner belongs on this path. Failures return cleanly to silence.

The background daemon tails exchanges, embeds recent turns locally, maintains the session centroid as an exponentially weighted moving average, evaluates triggers, retrieves candidates, optionally reasons over them, atomically writes the cache and logs would-fire decisions. Open the knowledge store read-only; per-turn logs stay outside it. Use a singleton lock, idle exit, global kill file, rotated append-only JSONL logs and a liveness canary on every daemon cycle.

Drift is low cosine similarity between the current turn and session centroid. Stall is excessive similarity across the last N turns. A flow-repair guard distinguishes stuck work from a human repeating an unmet instruction. Candidate builds have a cooldown; thresholds are configurable by mode.

Retrieve with several queries, each with a small result count, evidence-sufficiency scoring and per-region caps. Require at least one chunk outside the dominant region. A wander step may add one wildcard; it does not replace this cross-region requirement. Session FIFO deduplication prevents repeated offers while a chunk remains in the window.

## Rollout contract

Phase zero runs for days with zero chat output. Check hook speed and clean exit, zero knowledge-store writes, a useful would-fire rate, real liveness and honest process state. Prove transcript availability for each seat. Prompt-only visibility weakens stall detection and requires revalidation before printing.

Ari labels 50 offers; at least 70% must be useful. Region matches and non-null hypotheses are not substitutes. If the reasoner fails, retain triggers and retrieval without it. Start per-mode opt-in only after the soak passes, then consider default-on with the kill switch retained.

## Reproduction and related reading

The minimal pattern is canonical notes, a read-only observer daemon, a cache-reader hook, session-keyed offer caches, a soak log and a kill file. Budget offers, gaps, confidence, token count and freshness explicitly. The design came from independent discovery, three approaches and adversarial judging; full packs per turn and prompt-path model calls were rejected.

- [Cortex](/documents/memory/cortex)
- [Generative Memories](/documents/memory/generative-memories)
- [Brainstorming swarm](/documents/workflows/brainstorming-swarm)
