Skip to content

Gaussia / Boltzmann Brains

Boltzmann brains are an optional, experimental knowledge-source feature built on the Gaussia community’s pyboltzmann library. They store memory as immutable, content-addressed OCI artifacts with a Merkle provenance ledger and fine-grained, per-module authorization.

  • Immutable, content-addressed memory with provenance.
  • Ingestion gating and per-module access policy (semantic, procedural, canonical, and so on).
  • Retirement operations: drop, supersede, redact.
  • SSH-signed history, trust roots, and branch/reconciliation workflows.

Agents access a Boltzmann brain through the brain search mode in an agent spec.

Terminal window
pip install "alquimia-core[boltzmann]"

Governed history also needs:

Terminal window
pip install "pyboltzmann[authenticity]==0.10.1"

Use search_mode: "brain" to query a registered Boltzmann brain.

{
"search_mode": "brain",
"brain_ref": "fourier-signals",
"modules": ["semantic", "procedural"]
}
FieldTypeDescription
brain_refstringbrain_id of a registered Boltzmann brain
modulesstring[]Memory modules to query

Boltzmann brains are managed with the alquimia registry brains commands. They are referenced as brain in agent specs and the runtime API.

CommandDescription
alquimia registry brains add <brain_id>Register a brain
alquimia registry brains init <brain_id>Create a governed genesis for a brain with no history
alquimia registry brains migrate <brain_id> --to <target_id>Replay an ungoverned brain into a new governed brain
alquimia registry brains listList brains
alquimia registry brains inspect <brain_id>Show brain registration and authenticity summary
alquimia registry brains install <brain_id>Pull a brain’s modules into the local store
alquimia registry brains ingest <brain_id> <source>Register a source and derive blocks
alquimia registry brains publish <brain_id>Pack and push the brain to its OCI reference
alquimia registry brains fetch <brain_id>Retrieve another history, reconciling cleanly if configured
alquimia registry brains set-policy <brain_id> <memory_type>Grant or replace module access
alquimia registry brains set-identity <brain_id>Declare this brain’s actor and assisting parties
alquimia registry brains identity <brain_id>Show who a write would be attributed to
alquimia registry brains set-reconcile-strategy <brain_id> <strategy>Declare the lineage a clean fetch records
alquimia registry brains set-authenticity <brain_id>Declare what this brain accepts as authored
alquimia registry brains reconcile <brain_id>Combine with another history
alquimia registry brains reconcile-status <brain_id>Show an unresolved reconciliation
alquimia registry brains reconcile-resolve <brain_id> <block_id>Answer one open reconciliation question
alquimia registry brains reconcile-accept-removals <brain_id>Accept that blocks removed on the other side leave too
alquimia registry brains reconcile-continue <brain_id>Conclude a reconciliation once questions are answered
alquimia registry brains reconcile-abort <brain_id>Abandon an in-progress reconciliation
alquimia registry brains drop <brain_id> <block_id> <memory_type>Exclude a block from the composition
alquimia registry brains supersede <brain_id> <block_id> <memory_type>Record that a block takes precedence over another
alquimia registry brains demote <brain_id> <block_id> <memory_type>Lower a block’s retrieval priority
alquimia registry brains redact <brain_id> <block_id> <memory_type>Destroy a block’s bytes while retaining its identity
alquimia registry brains delete <brain_id>Deregister a brain
alquimia registry brains branch list <brain_id>List local branches
alquimia registry brains branch current <brain_id>Print the current branch
alquimia registry brains branch create <brain_id> <name>Start a new branch
alquimia registry brains branch switch <brain_id> <name>Check out a branch, creating or tracking it
alquimia registry brains branch delete <brain_id> <name>Delete a local branch
alquimia registry brains branch merge <brain_id> <name>Bring a branch into the current branch
alquimia registry brains tags <brain_id>List published tags for this brain

Add a brain without governance:

Terminal window
alquimia registry brains add fourier-signals \
--oci-reference ghcr.io/acme/brains/fourier-signals \
--modules semantic,procedural

Add a governed brain, creating its genesis now:

Terminal window
alquimia registry brains add fourier-signals \
--oci-reference ghcr.io/acme/brains/fourier-signals \
--modules semantic,procedural \
--governed \
--sign-with SHA256:xxx \
--govern-quorum 1

Governance is chosen at creation and cannot be added or removed later. To make an existing ungoverned brain governed, migrate it:

Terminal window
alquimia registry brains migrate fourier-signals --to fourier-signals-v2 \
--sign-with SHA256:xxx --govern-quorum 2

Use --trust-root <file> to provide a trust-root JSON/TOML file instead of synthesizing one. Use --sign-with to name one or more ssh-agent-held Ed25519 keys (SHA256 fingerprints) that sign the genesis.

Each line of work in a brain can have its own tag. main publishes to the brain’s registration tag; every other branch publishes to br.<name>, with / rewritten as . (so ana/fix becomes br.ana.fix). publish, install and fetch default to the current branch’s tag, so collaborators on different branches do not refuse one another’s pushes.

Terminal window
# List branches; add --remote to see what the registry publishes
alquimia registry brains branch list fourier-signals --remote
# Start a branch from the current head, or from a branch/snapshot
alquimia registry brains branch create fourier-signals ana/fix
alquimia registry brains branch create fourier-signals hotfix \
--from sha256:abc123 --switch
# Switch to an existing branch, or track a published one
alquimia registry brains branch switch fourier-signals ana/fix
alquimia registry brains branch switch fourier-signals ana/fix --create
# Merge a branch into the current one
alquimia registry brains branch merge fourier-signals ana/fix
alquimia registry brains branch merge fourier-signals ana/fix --ff-only
# Delete a local branch (the registry keeps its manifest)
alquimia registry brains branch delete fourier-signals ana/fix
# See every tag the brain is published under
alquimia registry brains tags fourier-signals

A merge first checks containment, then tries a fast-forward that writes nothing and needs no actor. Only when the branches have diverged does it require a strategy and an attributed actor, leaving the same open reconciliation state as alquimia registry brains reconcile. A head is judged before it is served past an open reconciliation.

Declare the actor and assisting parties for a brain:

Terminal window
alquimia registry brains set-identity fourier-signals \
--actor "alice@example.org" \
--actor-kind human \
--assisted-by '{"id":"alquimia/codex","kind":"agent","model":"codex"}'

Show who a write would be attributed to:

Terminal window
alquimia registry brains identity fourier-signals

ingest requires a declared actor and records the proposing model as an assisting party. Passing --actor-kind without --actor is rejected.

A reader declares what it accepts as authored. The policy is inherited from the agentspace unless a brain declares its own. The inherited and default policy is unsigned=refuse.

Terminal window
alquimia registry brains set-authenticity fourier-signals \
--unsigned warn \
--required-signatures 1 \
--allow-propose-head
FlagDescription
--unsignedAn unsigned head: warn, refuse, or permit (default refuse)
--required-signaturesDistinct keys a head must be signed by
--allow-propose-headAccept a head vouched for only by a propose-scoped key
--clearRemove this declaration and inherit again

inspect shows the current pull policy and local authenticity summary.

Detached SSH signatures are stored beside snapshots and do not change the snapshot digest. Only Ed25519 keys from ssh-agent can sign.

CommandDescription
alquimia registry brains auth keysList Ed25519 keys ssh-agent offers
alquimia registry brains auth status <brain_id>Show integrity and authenticity status
alquimia registry brains auth trust-root <brain_id>Show the trust root in force
alquimia registry brains auth sign <brain_id> --sign-with SHA256:xxxSign the head or a snapshot
alquimia registry brains auth pin <brain_id>Anchor this machine to the current trust root
alquimia registry brains auth attribution <brain_id>Show whether actors are vouched for
alquimia registry brains auth plan-rotate <brain_id> <trust_root>Build a trust-root revision for countersigning
alquimia registry brains auth countersign <brain_id> --sign-with SHA256:xxxSign a planned revision
alquimia registry brains auth rotate <brain_id> --plan <plan>Put a new trust root in force
alquimia registry brains auth revoke <brain_id> --sign-with SHA256:xxxRetire or compromise a key

Rotate a trust root with a quorum:

Terminal window
alquimia registry brains auth plan-rotate fourier-signals new-root.json \
--sign-with SHA256:aaa
# send the plan to other key holders
alquimia registry brains auth countersign fourier-signals --sign-with SHA256:bbb
alquimia registry brains auth rotate fourier-signals --plan plan.json

Fetch another history and reconcile automatically when the brain declares a strategy and the plan is clean:

Terminal window
alquimia registry brains set-reconcile-strategy fourier-signals merge
alquimia registry brains fetch fourier-signals \
--reference ghcr.io/acme/brains/fourier-signals \
--tag proposal-7

Use --no-reconcile to fetch only, or --reason to record why a clean reconciliation landed.

Manually reconcile when deciding is required:

Terminal window
alquimia registry brains reconcile fourier-signals \
--theirs <snapshot-digest> \
--strategy merge \
--reason "accepted quarterly review"

Then resolve open questions:

Terminal window
alquimia registry brains reconcile-status fourier-signals
alquimia registry brains reconcile-resolve fourier-signals <block_id> --kind admit
alquimia registry brains reconcile-accept-removals fourier-signals
alquimia registry brains reconcile-continue fourier-signals

Abort if needed:

Terminal window
alquimia registry brains reconcile-abort fourier-signals
Terminal window
alquimia registry brains ingest fourier-signals release-notes.pdf \
--media-type text/plain \
--allowed semantic,procedural \
--model-ref gpt-4o-mini

Ingest requires a declared actor; it records the proposing model as alquimia/leviathan assisting the declared actor.

Terminal window
alquimia registry brains set-policy fourier-signals semantic \
--severity read-only --tier-grants reader,editor,operator

Brain commands return stable exit codes so automation can react without parsing messages. The codes are append-only.

Exit codeNameMeaning
0OKSuccess.
1INTERNALAnything not covered below.
2USAGEWrong invocation: bad name, refused branch operation, missing strategy or actor.
4NOT_FOUNDThe branch or reference named does not exist.
8DIVERGEDThe remote moved: the push was refused before writing, or another publish replaced yours right after it landed. Fetch, reconcile, and publish again, or move the work to its own branch with alquimia registry brains branch switch <brain_id> NAME --create.
12RECONCILEA reconciliation is open, or a merge/reconcile stopped to ask questions. Finish it with reconcile-resolve / reconcile-continue, or abort with reconcile-abort.

8 means start a reconciliation (or branch the work); 12 means finish one.

An agentspace can declare default actor and authenticity policy for every brain it contains. A brain’s own declaration overrides the agentspace default.

Declare the default actor and assisting parties for every brain in the agentspace. A brain can override this with brains set-identity.

Terminal window
alquimia registry set-identity --namespace production \
--actor "alice@example.org" \
--assisted-by '{"id":"alquimia/codex","kind":"agent","model":"codex"}'
FlagDescription
--actorActor to attribute writes to this agentspace’s brains to
--actor-kindKind of the declared actor (default human)
--assisted-byAssisting party; repeatable
--clear-actorRemove the agentspace actor
--clear-assisted-byRemove the agentspace assisting parties

Declare what a pull of this agentspace’s brains accepts as authored. Every brain inherits this policy unless it declares its own with brains set-authenticity. The default unsigned policy is refuse.

Terminal window
alquimia registry set-authenticity --namespace production \
--unsigned warn \
--required-signatures 1
FlagDescription
--unsignedwarn, refuse, or permit (default refuse)
--required-signaturesDistinct keys a head must be signed by
--allow-propose-headAccept a head vouched for only by a propose-scoped key
--clearRemove this declaration and inherit again
MethodPathAuthPurpose
POST/registry/brainYesRegister a Boltzmann brain
PUT/registry/brain/{brain_id}YesUpdate a brain registration
GET/registry/brainYesList registered brains
GET/registry/brain/{brain_id}YesGet one brain registration
POST/registry/brain/queryYesQuery brains by filter
DELETE/registry/brainYesDeregister brains by filter

These variables configure the runtime’s handling of Boltzmann brains.

VariableRequiredDefaultDescription
ALQUIMIA_OCI_NAMESPACE_BRAINSNobrainsDeployment namespace for Boltzmann brain artifacts and their index anchor
BRAIN_STORENomemoryWhere served brains live: memory, or layout:<root>
BRAIN_CACHE_TTLNo300Seconds before a cached brain is revalidated
BRAIN_CACHE_MAX_BRAINSNo4LRU cache size limit
BRAIN_WARMUP_ENABLEDNotrueOpen registered brains at worker startup
BRAIN_VERIFICATION_UNSIGNEDNorefuseDefault brain authenticity policy for unsigned heads: refuse, warn, or permit. Since 0.6.0 the default is refuse, so pulls of unsigned brains fail closed unless explicitly relaxed
ALQUIMIA_OCI_SIGNATURE_POLICYNorequiredOCI signature verification policy for pulled artifacts, including Boltzmann brains: required, warn, or off
ALQUIMIA_OCI_COSIGN_PUBKEYNo—Cosign public key used to verify signatures on pull

Operations that write to a governed brain must attribute the write to an actor. Environment variables set a process-wide default; a brain’s declared identity overrides them.

VariableRequiredDefaultDescription
ALQUIMIA_ACTOR_IDNo—Actor identifier for the operation
ALQUIMIA_ACTOR_KINDNo—human, agent, service, or pipeline. Only valid when ALQUIMIA_ACTOR_ID is set
ALQUIMIA_ASSISTED_BYNo—JSON string describing assisting parties for the operation

These variables are read by CLI commands such as alquimia registry brains publish, reconcile, and ingest. The ingest command still requires a brain-declared actor and records the proposing model as alquimia/leviathan assisting that actor.

Governed brains add provenance and authenticity controls on top of OCI distribution.

A brain is either governed at creation or never. Its genesis names a trust root: a set of Ed25519 public keys, scopes, and a govern quorum. The trust root binds every key to the actor who created the genesis, so later signatures can be attributed to a known party.

  • alquimia registry brains add --governed creates the genesis immediately.
  • alquimia registry brains init creates the genesis for a brain that was registered without governance but has no history yet.
  • alquimia registry brains migrate --to <new_brain> replays an ungoverned brain into a new governed brain. The original brain is untouched.

Governed brains are signed with keys held in the local ssh-agent. Only Ed25519 keys can sign. The key is identified by its SHA256 fingerprint, as shown by alquimia registry brains auth keys.

Signatures are detached: they live beside the snapshot and do not change its digest. A head can be signed by multiple keys; alquimia registry brains auth sign --sign-with SHA256:xxx appends a signature, and writing commands such as reconcile-continue accept --sign-with to sign the head they leave.

Every reader declares what it accepts as authored. The policy is local: it never travels with the brain. An agentspace declares a default with alquimia registry set-authenticity; a brain can override it with alquimia registry brains set-authenticity.

Policy flagMeaning
unsignedwarn and install, refuse, or permit silently (default refuse)
required-signaturesDistinct keys a head must be signed by
allow-propose-headAccept a head vouched for only by a propose-scoped key

warn still installs an unsigned head; refuse rejects it. The default policy is refuse, so a brain pull fails closed when no valid signature is present. A remote that was once seen signed is refused unsigned unless permit is set.

alquimia registry brains auth pin anchors a brain to the current trust root on this machine. Later pulls must descend from it. The pin is local and never travels with the brain, so publishing cannot make a reader trust a replacement root.

Every write to a governed brain is attributed to an actor. The actor can be declared on the agentspace or on the brain itself; a brain declaration is authoritative and cannot be overridden by a flag or environment variable. Assisting parties can also be declared and selected per write.

SourceVariables / flags
Brain declarationbrains set-identity
Agentspace defaultregistry set-identity
Invocation--actor, --actor-kind, --assisted-by, --empty-assisted-by
EnvironmentALQUIMIA_ACTOR_ID, ALQUIMIA_ACTOR_KIND, ALQUIMIA_ASSISTED_BY

ingest requires a declared actor. It does not use --actor or the environment; instead it records the proposing model as the agent alquimia/leviathan assisting the declared actor.

Governed brains share history through OCI. alquimia registry brains fetch can automatically reconcile a fetched history when the brain has declared a strategy and the plan is clean. If the other history requires decisions, the fetch reports what stopped it and leaves the current head untouched.

Manual reconciliation uses alquimia registry brains reconcile and the reconcile-status, reconcile-resolve, reconcile-accept-removals, reconcile-continue, and reconcile-abort commands. An unresolved reconciliation refuses every write to the brain until it is resolved.

Brains support branches so that different lines of work can publish independently. main publishes to the brain’s registration tag; any other branch publishes to br.<name>, with / rewritten as . (for example, ana/fix publishes as br.ana.fix). publish, install, and fetch default to the current branch’s tag, so collaborators on separate branches do not refuse one another’s pushes.

  • alquimia registry brains branch list shows local branches and, with --remote, the branches published in the registry.
  • alquimia registry brains branch create starts a new branch from the current head, a named branch, or a sha256: snapshot.
  • alquimia registry brains branch switch checks out a branch, optionally creating it or tracking a published branch from its tag.
  • alquimia registry brains branch merge brings another branch into the current one. It checks containment first, then tries a fast-forward that writes nothing, and only if the histories diverged does it perform a reconciliation that stops to ask questions.
  • alquimia registry brains branch delete removes the local branch ref; the registry manifest remains because OCI registries delete manifests, not tags.
  • alquimia registry brains tags lists every tag the brain is published under, including main, branch tags, and any release tag set with brains publish --tag.

A held head is judged before it is served past an open reconciliation, so switching to a branch cannot silently bypass an unfinished reconcile.

For high-stakes knowledge that must be provable and versioned, a Boltzmann brain stores content as an immutable, content-addressed OCI artifact with a Merkle provenance ledger.

Terminal window
# Register the brain
alquimia registry brains add fourier-signals \
--oci-reference ghcr.io/acme/brains/fourier-signals \
--tag v1
# Grant access per memory module
alquimia registry brains set-policy fourier-signals semantic \
--severity read-only --tier-grants reader,editor,operator
alquimia registry brains set-policy fourier-signals canonical \
--severity destructive --tier-grants operator
# Ingest new evidence through the CLI gate (not by agents)
alquimia registry brains ingest fourier-signals ./evidence/lecture07.txt
# Publish a new version
alquimia registry brains publish fourier-signals --tag v2

Retirement operations include:

  • drop — remove a block and rebuild the composition over the survivors. Dropping canonical evidence cascades to everything derived from it.
  • supersede — mark a block as replaced by a newer block (append-only, suitable for episodic memory).
  • redact — destroy bytes for legal or safety reasons while keeping the provenance ledger intact.