Skip to main content

Bolero

The governed autonomous-research platform — from empirical evidence to human-owned, peer-reviewable scientific claims.

PyPI version PyPI downloads Python 3.11 Linux License: MIT

PyPI · Quickstart · Operator guide · Agent runtime · Model serving

Bolero runs complete research campaigns: autonomous agents propose research questions, execute governed analyses against a real dataset and literature corpus, integrate what they learn into an explicit knowledge graph, and write the result up as a manuscript that stands to independent review. Every scientific action happens inside a sealed container under typed contracts, so the evidence trail behind every claim is inspectable end to end. This repository contains the whole platform: the research harness, the Bolero Code agent runtime, the World viewer, and the environment kits used by sealed scientific runs.

Highlights

  • Sealed execution — every agent call runs in a container with exactly one writable workspace; the dataset, the literature corpus, and the knowledge store are read-only mounts, and the model is reached through a harness-provided socket, not the open network.
  • Typed contracts, not vibes — every artifact an agent leaves behind is validated against pydantic contracts by in-container stop gates and again by the host before it can advance the campaign.
  • An explicit World — what the campaign knows lives in an epistemic graph of Atoms (evidence-backed claims with typed, weighted bonds) and Molecules (publication storylines over them), browsable live in the bundled viewer.
  • All-or-nothing knowledge integration — each research loop commits its findings to the World as one validated transaction; a failed wave leaves the canonical store untouched.
  • Human-owned publication — sending a storyline to the publication lane is the operator's readiness decision; an independent in-lane review gates the manuscript, and a request for new evidence hands control back to the operator instead of papering over it.
  • Reproducible by construction — frozen campaign configuration, a Git history inside every session, and (under Singularity or Apptainer) a runtime image resolved once at campaign birth to its content digest and never changed mid-run; Docker resolves references at each call, so pin a dated tag or digest there yourself.

How it works

flowchart LR
    subgraph s1["Research lane, one loop per pass"]
        A["allocation"] --> P["proposals"] --> T["tournament"]
        T --> L["plan → execute → review<br/>(parallel lanes)"]
        L --> W["world integration"]
    end
    W -->|one transaction per loop| WORLD[("the World<br/>Atoms + Molecules")]
    WORLD --> A
    WORLD --> B
    subgraph s2["Publication lane, operator-triggered"]
        B["blueprint"] --> V["visualization"] --> D["draft"] --> R["independent review"]
    end
    R --> M["manuscript"]
    WORLD --> X["desensitizer (one stage)"]
    M --> X
    X --> E["reviewed export candidates<br/>human checking still required"]

Research lane. Each loop allocates frontier regions to parallel proposers, holds a tournament over their candidate research questions, and runs one plan → execute → review lane per accepted proposal against the governed dataset. Accepted results are minted into Atoms, and one world-integration wave restructures the Molecule layer over them — applied to the World as a single all-or-nothing transaction before the next loop begins.

Publication lane. For one operator-selected Molecule, the lane turns the storyline into a blueprint, renders the figures that blueprint plans from the already-reviewed evidence, writes the manuscript around them, and submits the package to an independent review stage that either accepts, directs bounded in-place repairs, or ends the run asking the operator for new evidence.

For configuration-driven lanes and the one-stage disclosure workflow, see Research, publication and desensitization.

Quickstart

Prerequisites

  • Linux on x86_64 with Conda and Git ≥ 2.28 (a campaign session records its history in its own Git repository, created with git init -b)
  • Node.js 22.x for host-side interactive use of Bolero Code (the shipped router addon is built for that line; sealed calls use the image's own Node)
  • Singularity, Apptainer, Docker, or enroot
  • CPUs for the configured parallelism: the packaged default (campaign.max_parallelism=8, two governed threads per call) requires 16 available logical CPUs at launch; on a smaller machine lower campaign.max_parallelism on the launch command
  • an already-deployed OpenAI-compatible model endpoint serving the model the harness is configured for — the packaged default is qwen3.8-flash-next at http://127.0.0.1:30000 (bolero-harness/bolero/conf/llm/default.yaml). This README assumes that deployment (SGLang in production) is already up; the serving recipes live in envs/llm/. If the endpoint runs on another machine, expose it to this one through an SSH tunnel.

Install

Bolero is one Python distribution, bolero-ai, carrying three import packages — the research harness (bolero), the Bolero Code SDK (bolero_code_sdk), and the World viewer (bolero_world) — plus one non-Python runtime bundle that the harness provisions itself. The wheel always ships all of the code; the extras are dependency groups: [harness] the Stage-1 driver's stack, [code] the SDK's, [world] nothing (the viewer is standard library only), [offline] the runtime bundle as a PyPI distribution, [all] the union of the three functional groups, [test] the host test suite's own tools on top of [all]. Python 3.11 or newer on Linux is required (requires-python = ">=3.11"; the suite is proven on 3.11 and 3.13, and every compiled dependency — kuzu, networkit, numpy, scipy — ships wheels for both). Create an environment carrying such an interpreter plus the host-side gate binaries the publication drivers shell out to (pdftotext, pandoc; tectonic rides along for parity with the baked runtime), and install from PyPI:

conda create -n bolero -c conda-forge python=3.11 pip poppler poppler-data pandoc tectonic
conda activate bolero
pip install "bolero-ai[all]==0.2.4"

(From a checkout, conda env create -f environment.yml builds the same environment, and pip install -e '.[harness]' installs the tree editably.)

(Production installs use [all]; a bare pip install bolero-ai ships all of the code but none of the third-party stacks, so pick at least the groups you will run.)

Provision the Bolero Code runtime — the compiled CLI, its pinned claude-code-router, the launcher and the container wrappers — into ~/.local/share/bolero-code, then run the prerequisite diagnostic — interpreter, packages, bolero-code, container engine, image reference, endpoint reachability:

bolero-harness setup
export PATH="$HOME/.local/bin:$PATH"   # where setup links bolero-code
bolero-harness doctor

For a new real study, install the project control profile and ask Bolero Code to carry the human materials through the complete research lifecycle:

bolero init <project>
cd <project>
bolero
# Then invoke /prepare-full-pipeline with the objective and material paths.

The Skill writes an amendable run plan, prepares an exploration, preregistration, or replication campaign, keeps the session under operational and scientific audit, and publishes a defensible Molecule to a verified PDF.

Hosts that reach PyPI and not GitHub

setup downloads the runtime bundle from the matching GitHub Release. A host without GitHub takes the same bundle through PyPI instead, and gets the repository itself the same way:

pip install "bolero-ai[all,offline]==0.2.4"
bolero-harness setup      # reads the bundle from the installed distribution
bolero-harness download   # writes the repository into the current directory

download unpacks the source tree the release wheel carries — the same tree a clone would give, minus its Git history — and works on a bare pip install bolero-ai. The Danish register corpus travels the same road as its own distribution: bolero-harness denmark [dir] fetches the newest bolero-denmark release from PyPI and unpacks it, falling back to an installed copy only when PyPI cannot be fetched or serves no usable release. What pip cannot carry is the runtime container image: it is ~13 GB, lives at ghcr.io, and must reach such a host by other means, addressed with runtime_images.<engine>=/absolute/path.sif.

The runtime container image is not installed. Under Singularity or Apptainer, at every campaign's birth the driver pulls oras://ghcr.io/northwestern-cssi/bolero-runtime:sif-latest once into ~/.cache/bolero/images/ under its SHA-256 and freezes that file for the session, so the newest published image starts each new campaign and no running campaign ever changes image; a local SIF path is frozen as the real file behind its symlinks. Docker references are resolved by the engine at each call — pin one yourself by naming a dated tag or digest (runtime_images.docker=ghcr.io/northwestern-cssi/bolero-runtime:<date>).

Run the Palmer Penguins demo

Install the Bolero Code project profile, scaffold the complete demo, and let the bolero-demo Skill check, run, monitor, and audit it:

bolero demo penguins

The generated Harness launcher can also be run directly:

cd penguins
bash run-research.sh

The script checks the Bolero Code runtime, detects the available container engine, and launches the campaign. First use pulls the runtime image from ghcr.io. On a terminal it opens the live TUI. Ctrl-C closes only the TUI; the campaign continues in its detached driver. Reattach from the demo directory, and serve the session's current World from another terminal, with:

bolero-harness status
conda activate bolero && bolero-harness world   # http://127.0.0.1:3000/

Publication lane — is a separate, operator-triggered lane, and sending a Molecule to it is the readiness decision: the driver stamps it draft: true and runs the in-place blueprint → visualization → manuscript → independent-review lane on the World in hand — it never re-enters exploration. It also takes the session's exclusive driver lock, so it runs after exploration ends: wait for the stop target, or stop the driver from the TUI (the space gesture, behind a confirm). When exploration has built a storyline worth writing, pick its id in the World viewer and run from the penguins/ directory:

bolero-harness publish \
  --session outputs/<YYYY-MM-DD>/penguins-demo \
  --molecule molecule-NNNNNN \
  [--template <template.yaml>]

The lane takes three inputs: the session, the Molecule, and — optionally — the publication template declaring the report's section tree, which is installed into the session and reused by later invocations. Without one the report takes the packaged Nature Human Behaviour shape. --mode defaults to the session's frozen mode, bolero-harness status attaches to it like the exploration run, and a reviewer request for new evidence ends the run with exit code 2 for the operator to act on.

The CLI at a glance

Bolero Code is the project-level entrypoint; the Harness CLI remains the exact runtime and pipeline surface:

Command Does
bolero init [dir] install the project-local Skills and Subagents under .bolero/
bolero demo [dir] prepare and run the Palmer Penguins demonstration through Bolero Code
bolero doctor [dir] run the parallel project, runtime, and service audit
bolero-harness init [dir] scaffold resources, configuration, and one init-world with atoms, molecules and docs
bolero-harness demo [dir] scaffold the ready-to-run Palmer Penguins demo
bolero-harness research … launch a new research campaign
bolero-harness research -r <session> resume a session from its last accepted commit
bolero-harness publish --session <session> --molecule <id> run the publication lane for one Molecule
bolero-harness status [session] attach the campaign TUI (plain text off a TTY)
bolero-harness world [session] serve the World viewer web page
bolero-harness setup provision the Bolero Code runtime bundle
bolero-harness doctor prerequisite and configuration diagnostic

bolero-explore and bolero-publish remain direct entry points for the two stage drivers, and every campaign tunable is a Hydra override on the launch command. Every sealed stage call also records a resumable agent session inside its campaign directory: from that directory, bolero -r lists and continues those sessions in their original container environment, and bolero -r <stage-label> -p "question" asks a one-shot follow-up (see bolero-code/README.md, "Resuming agent sessions").

Repository layout

Path Purpose
bolero-harness/ research driver, typed stage contracts, TUI, and demo
bolero-code/ agent CLI, router, SDK, and sealed-container launcher
bolero-world/ local World graph viewer
envs/ scientific runtime-image and model-serving environment kits

Documentation

Publication fonts

The experimental wheel and Docker transport include four Helvetica Neue runtime TTF faces and their operator-supplied OTF originals. Pip installs these resources; publication projects them into the session and registers them by file path. No administrator privileges, system-font copy or font-cache rebuild is needed. Check an installation with python -m bolero.core.publication.fonts.

These third-party fonts are not covered by Bolero's MIT license. Their provenance and licensing notice records the source and unresolved redistribution-license status.

License

MIT © Northwestern-CSSI

Metadata

Release files for bolero-ai 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bolero-ai 0.2.6
File Size Uploaded
bolero_ai-0.2.6.tar.gz 21.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for bolero-ai 0.2.6
File Interpreter ABI Platform
bolero_ai-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 44.1 MB

Release files / bolero_ai-0.2.6.tar.gz

Download URL bolero_ai-0.2.6.tar.gz
Size 21.9 MB
Tags Source
SHA-256 checksum
How to use checksums
241f3c86d4b4aa2d59e7c350bc6d4e5ef35b8638441540b35801c311a57c4bd2
BLAKE2b-256 checksum
How to use checksums
6223f08e63ae6c6b3b294b70b249c52b9c855b9ec7460ee4736f9296b1db340e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / bolero_ai-0.2.6-py3-none-any.whl

Download URL bolero_ai-0.2.6-py3-none-any.whl
Size 22.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bee77ce6dd9c6ea257aa44ea98364ffb450218c011916ffeb4f46568c9d3f965
BLAKE2b-256 checksum
How to use checksums
2afa0fb96c9cbdfd32c80dc7dd6e927ab2c6b0c9a9a36c8deca07d892d36cea2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log
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