Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyboltzmann

An SDK for the Boltzmann Protocol: portable, verifiable, model-agnostic knowledge.

The brain conserves, validates, and retrieves knowledge. An external LLM processes, contextualizes, and uses it.

Reference: Boltzmann Brain: A Versioned, Distributable, and Model-Agnostic Knowledge Architecture (Gaussia, 2026).

What this is

A client for a Boltzmann brain. You open a directory, call methods, and they work against an OCI artifact. Brain implements the whole protocol — 23 of 23 operations across the four contracts.

brain = Brain.open("./my-brain", actor=curator)
brain.ingest(pdf, request, my_llm)          # register → delegate → validate → commit
brain.search(Query(text="Fourier"))         # filter, resolve, verify
brain.drop(DropRequest(...))                # rebuild the Merkle DAG, cascade, record
await brain.push(client, "ghcr.io/org/brain", "v1")

The line it draws: the SDK does whatever the protocol defines mechanically; the implementer supplies whatever the paper assigns elsewhere. So identity, the wire formats, the four operation paths and a conformance suite are here; the model, the ranking, the index engines and any CLI or MCP server are yours.

It embeds no language model. Interpretation enters through CandidateProposer and nowhere else.

There are no NotImplementedError stubs, and a test enforces it. An unimplemented function is worse than an interface: it looks callable and is not. Nothing is declared and unreachable either — every type, enum member and constant is produced by something, and a test enforces that too.

Installation

pip install pyboltzmann          # the distribution
pip install 'pyboltzmann[oci]'   # plus the network registry transport
import boltzmann                 # the import package

The two names differ because boltzmann on PyPI belongs to an unrelated package. It is the same split as pygaussia providing gaussia.

The core needs pydantic and rfc8785. Everything else is optional: [oci] adds a network registry transport, and moving a brain between OCI layouts on disk needs nothing at all.

Python >= 3.11.

Usage

The whole lifecycle of Section 11, against a real OCI layout:

from boltzmann import Actor, Brain, MemoryType, Producer, Query
from boltzmann.blocks import ActorKind, ProducerKind
from boltzmann.ingest import Candidate, CandidateSet, RegistrationRequest

curator = Actor(id="curator", kind=ActorKind.HUMAN)
brain = Brain.open("./my-brain", actor=curator)

# You supply the model. The SDK embeds none: what knowledge a source yields is its
# judgment, and what gets stored is the protocol's.
def my_llm(task, source):
    # task.output_schema names the schema; brain.candidates_schema(task) *is* it, with the
    # payload resolved per memory type. Hand it to the model as structured output.
    return CandidateSet(
        producer=Producer(kind=ProducerKind.MODEL, id="claude-opus-5", version="2026-07"),
        candidates=[
            Candidate(
                memory_type=MemoryType.SEMANTIC,
                evidence=[task.source],
                locator="p.147",
                payload={
                    "kind": "formula",
                    "label": "Fourier series",
                    "statement": "decomposes a periodic function into sines",
                    "subject": "signals",
                },
            )
        ],
    )

request = RegistrationRequest(media_type="application/pdf", actor=curator, license="CC-BY-4.0")
pdf = b"%PDF-1.7 lecture 07: Fourier analysis"

# Register, delegate, validate, commit. Registering the same source twice is a no-op.
commit = brain.ingest(pdf, request, my_llm)

# Data with its provenance, never prose, every match verified against the snapshot.
bundle = brain.search(Query(text="periodic function"))
assert bundle.all_verified
assert bundle.matches[0].sources[0].locator == "p.147"

# Membership is provable in O(log n), without holding the rest of the module.
block_id = commit.committed[0]
assert brain.prove(block_id, MemoryType.SEMANTIC).verify(brain.root_of(MemoryType.SEMANTIC))
assert brain.verify()

Removing knowledge cascades through provenance, publishing is a copy rather than a conversion, and an implementation in any language can prove it conforms against the golden vectors that ship in the wheel. Each of those has a guide.

Documentation

The docs/ directory is the source of truth, and it is published as the Boltzmann SDK section of the Gaussia docs.

Quickstart Ingest, query, prove, publish, remove — in one file
Architecture Blocks, compositions, modules, snapshots
Memory types The five typed blocks and the rules each obeys
Identity JCS, the three levels of hashes, the values a payload refuses
Merkle DAGs RFC 6962 over sorted leaves, and inclusion proofs
Interfaces The protocol surface, and the four things you plug in
Ingestion Preserve the source, delegate the interpretation, validate
Query Evidence Bundles, filters, and supplying a planner
Retention Drop, supersede, demote, prune, redact
Distribution Pack, push, pull, and selective installs
Conformance Golden vectors, and the suites you inherit

Development

uv sync
uv run pre-commit install && uv run pre-commit install --hook-type commit-msg

uv run ruff check . && uv run ruff format .
uv run mypy src
uv run pytest

Commits follow Conventional Commits — use uv run cz commit for the interactive prompt. Releases are cut by python-semantic-release from the commit history.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyboltzmann-0.2.0b1.tar.gz (126.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyboltzmann-0.2.0b1-py3-none-any.whl (166.2 kB view details)

Uploaded Python 3

File details

Details for the file pyboltzmann-0.2.0b1.tar.gz.

File metadata

  • Download URL: pyboltzmann-0.2.0b1.tar.gz
  • Upload date:
  • Size: 126.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyboltzmann-0.2.0b1.tar.gz
Algorithm Hash digest
SHA256 6c0eff040e0fe8266984f1aeeda77c7adb2d26ce0a58924e0bce636174799c5d
MD5 73cc2ec99d9b0ef3e6c6e3acb5d2fb75
BLAKE2b-256 a8c7e7d285bd913489bce05a4ff8c01d1fbbe25107e12ddd5d9c1120ccfa6d9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyboltzmann-0.2.0b1.tar.gz:

Publisher: release.yml on gaussia-labs/pyboltzmann

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyboltzmann-0.2.0b1-py3-none-any.whl.

File metadata

  • Download URL: pyboltzmann-0.2.0b1-py3-none-any.whl
  • Upload date:
  • Size: 166.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyboltzmann-0.2.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1236e657bee1ec86638b0e297d1da7365a0b64d1b662ea7fd3e5016ebe37aa
MD5 3b1b89c655450a316a7fb73f91fe3c11
BLAKE2b-256 541e82cca99c9e69de660a59a8aa68c84be3a25a0768c3dce1058a94b7b2114a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyboltzmann-0.2.0b1-py3-none-any.whl:

Publisher: release.yml on gaussia-labs/pyboltzmann

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.3.0b1

2 files

0.2.0

2 files

This release

0.2.0b1 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page