Skip to main content

Strata

PyPI Python versions License CI Pre-commit Docker Docs codecov OpenSSF Scorecard

Strata is a content-addressed computation graph with an interactive notebook UI.

Every cell output is a versioned artifact keyed by its provenance: source, inputs, and environment. Strata reads each cell's AST to build the dependency graph automatically, so re-running a notebook is mostly a series of cache hits. Touch one cell and the cascade re-executes only the cells that depend on it. Identical inputs produce the same artifact whether the second run comes a minute later or a year later, on the same machine or a different one.

Prompt cells make AI calls first-class DAG nodes, cached by template, inputs, and model config. # @worker gpu-fly dispatches a cell to a remote GPU. # @mount data s3://bucket/prefix ro makes an S3 prefix available as a local pathlib.Path inside the cell. The whole notebook is plain .py files plus a manifest, so commits are git-diffable and there are no JSON blobs or execution metadata bleeding into the history.

The Strata notebook UI: a Python cell with its source and an interactive table of results, sidebar panels for mounts, workers and environment, and a bottom drawer showing the cell DAG and per-cell timings.

Docs: bearing-research.github.io/strata

Give your coding agent a cached scratchpad

Coding agents explore by writing throwaway python -c and /tmp scripts: invisible, uncached, redone every session. Point one at Strata instead and it uses a persistent, cached notebook as its scratchpad: every snippet becomes a content-addressed cell, so the expensive step it ran ten turns ago is still a cache hit now, a human can watch it work live, and the work is a git-diffable directory instead of discarded scripts.

Install it as a one-command Claude Code plugin (needs the strata CLI on PATH; uv tool install strata-notebook):

/plugin marketplace add bearing-research/strata
/plugin install strata-scratchpad@strata

The terminal viewer over five moments: an empty notebook, a cell arriving, that cell finishing in 1.0s with its output, a second cell arriving that reads the first one's variable, and both cells green.

A coding agent drives the notebook in one terminal; strata-notebook-tui mirrors it live in another. Captured from a real run, not a mock-up.

Whether an agent reaches for it instead of a scratch script is measured rather than assumed. evals/agent_notebook/ drives the real on-ramp and grades the result: 9 transcript-backed tasks run in CI, and a scratchpad group probes whether an un-primed session uses the notebook at all. See Driving a notebook with a coding agent.

Highlights

The graph

  • content-addressed: every cell output is keyed by source + inputs + environment, so identical work hits the cache forever
  • reactive: edit a cell and the cascade re-runs only what depends on it
  • dag-from-ast: Strata reads each cell's AST to wire upstream and downstream, with no decorators and no manual edges
  • git-friendly: notebooks are plain .py files plus a TOML manifest, so diffs are readable
  • dag view: the dependency graph renders alongside the cells; double-click a node to jump to its source

Cell types

  • prompt cells: LLM calls as DAG nodes, {{ variable }} interpolation from upstream, cached by template + inputs + model config
  • SQL cells: named connections and bind-parameter templating, with drivers for DuckDB, SQLite, Postgres, Snowflake and BigQuery
  • R cells: Python and R share one DAG, exchanging Arrow, so a pandas.DataFrame is a data.frame for the next cell
  • loop cells: # @loop max_iter=N carry=state iterates with an explicit carry, each step its own artifact
  • variant sweeps: run every variant of a group and hand the downstream cell a {name: value} dict, or fan out with # @per_variant so adding a variant only runs the new one
  • widget cells: declarative controls that downstream cells consume as inputs; with Live on, dragging one recomputes what depends on it
  • cell unit tests: a Tests panel runs real pytest against a cell's defs and upstream inputs, doubling as a health badge

Coding agents

  • scratchpad plugin: a Claude Code plugin makes an agent use a cached notebook cell for throwaway Python instead of /tmp scripts
  • MCP server: expose a warm notebook session to any MCP client at /mcp, and watch it work in the browser or the terminal
  • agent CLI: strata inspects, runs and authors a notebook with --format json and stable exit codes, offline or against a live session
  • one-command on-ramp: strata agent ./nb stands up the server, session, config and viewer in one step

Compute and data

  • distributed: # @worker gpu-fly dispatches a cell to a remote box; bring your own compute
  • remote cells over SSH: hand an agent an SSH target and it provisions a worker there, tunnels to it, and routes heavy cells over, cached like everything else
  • mounts: # @mount data s3://bucket/prefix ro makes any S3, GCS or Azure prefix a local pathlib.Path
  • isolated envs: every notebook gets its own uv-managed .venv/, locked and reproducible
  • headless: strata run ./my-notebook for CI and scheduled execution, same DAG and same cache

Surfaces

  • terminal viewer: strata watch renders a running notebook live in the terminal, read-only, over SSH or beside your editor
  • app view: open a notebook as a read-only app, embed it as an <iframe>, or export a self-contained snapshot
  • data viewer: DataFrame outputs render in a grid you can page, sort, filter and search, backed by the full artifact rather than a preview
  • also a library: pip install strata-client talks to the store from any pipeline or service, with no server install
  • production: Iceberg-aware scans, trusted-proxy auth, multi-tenancy, and S3, GCS, Azure or local blob backends

Quick Start

Both paths below run in personal mode: single-user, writes enabled, no proxy auth. For multi-tenant or hosted deployments, see Deployment Modes.

# Docker. docker-compose.yml sets personal mode for you.
docker compose up -d --build
# Then open http://localhost:8765

# Or install via uv (recommended). Puts the CLI on PATH in a uv-managed
# tool env. `pip install` is not supported; see Requirements below.
uv tool install strata-notebook
strata-notebook
# Then open http://localhost:8765

For the full inventory of installed commands (strata-notebook, strata, strata-worker, python -m strata), see the Commands reference.

Source builds (git clone + uv sync) are documented in Installation.

Requirements

uv 0.8 or newer, and nothing else. uv fetches a matching Python for you.

Strata runs only inside a uv-managed environment. It checks for the uv = <version> marker uv writes to pyvenv.cfg, which uv tool install, uv add and uv run all produce and a hand-rolled python -m venv does not. The reason is that the notebook subsystem shells out to uv to manage per-notebook .venv/ directories; failing at startup with a clear message beats a confusing subprocess error later. Conda and pip-venv users install uv and relaunch from a uv-managed env, leaving existing data and environments untouched.

Windows: uv tool install strata-notebook works directly.

Building Strata itself from a git clone also needs a Rust toolchain for the native extension and Node 26+ for the frontend. PyPI wheels ship both prebuilt, so this applies only if you are modifying Strata. Source builds work on Windows via WSL2 or natively.

The Cache Advantage

Every notebook platform re-executes from scratch when you change one cell. Strata doesn't. The artifact store deduplicates by provenance hash. If the code and inputs haven't changed, the result is served instantly.

First run:     load data (10s) → clean (3s) → train (20s) → evaluate (1s)  = 34s
Change model:  load data (✓)   → clean (✓)  → train (20s) → evaluate (1s)  = 21s
Re-run:        load data (✓)   → clean (✓)  → train (✓)   → evaluate (✓)   = <1s

This is the architecture, not a layer on top of it. Every cell execution is a materialize(inputs, transform, environment) → artifact operation, and the cache is keyed on content rather than time, so it is correct by construction.

Even a leaf cell that only prints is cached: its console output is keyed by the same provenance hash, so an unchanged re-run replays the output instantly rather than executing again. That makes the notebook a good scratchpad - a coding agent's exploratory snippets stop recomputing. Cells that must always run (a side effect, a live API call, a fresh random draw) opt out with # @nocache.

Distributed Execution

Each cell can declare which worker it runs on via a single annotation:

# @worker my-gpu
embeddings = model.encode(abstracts, batch_size=256)

You define workers in notebook.toml. Each one points at an HTTP endpoint that implements the Strata executor protocol. A worker can be a GPU box on RunPod, a DataFusion cluster on Fly, a beefy EC2 instance, or anything else that speaks HTTP. The notebook routes the cell to the declared worker at execution time, and the UI shows a live "dispatching to my-gpu" badge while it runs.

No deployment code, no infrastructure glue. Bring your own compute, one annotation per cell.

Source Annotations

Every piece of per-cell metadata is a comment directive in the cell's source. The source is the single canonical place for cell config: annotations always win over any stored defaults.

# @name Extract embeddings
# @worker gpu-fly
# @timeout 600
# @env MODEL_PATH=/models/bge-large
# @mount dataset s3://corpus/2024-q4 ro
embeddings = model.encode(dataset / "abstracts.jsonl")

Diagnostics fire on open, reload, and after an edit settles: worker_unknown, mount_uri_unsupported, mount_shadows_notebook, timeout_not_numeric, env_malformed. They surface as a pill in the cell header and log structured warnings for headless runs.

Mounts

Mounts bind a remote URI to a local path inside the cell. Supported schemes: file://, s3://, gs://, az://. Credentials flow through fsspec options: set anon = true for public buckets, or drop it to use the standard credential chain.

[[mounts]]
name = "taxi_zones"
uri = "s3://nyc-tlc/misc"
mode = "ro"
options = { anon = true }

Inside the cell, taxi_zones is a pathlib.Path. Strata materializes it on first read and caches the bytes locally for the session.

Examples

Example What it shows
pandas_basics Linear DataFrame chain, caching, staleness propagation, per-cell unit tests
iris_classification End-to-end ML, DAG branching, mixed output types
titanic_ml Feature engineering + model comparison
s3_mount Reading a public S3 bucket via a mount
arxiv_classifier Distributed execution via @worker + Modal GPU + Fly cluster
markdown_showcase Markdown cells, dynamic Markdown(...) outputs, security cases
library_cells Cross-cell library code: pure module cells, mixed runtime+library cells, the limits
news_alpha_trader Multi-stage trading pipeline with prompt cells and structured LLM outputs
review_triage Prompt cell with # @output_schema - structured, schema-validated LLM output
r_mtcars_analysis Pure-R notebook - mtcars regression with inline ggplot2 / base-graphics plots
r_lm_vs_sklearn Cross-language R + Python - R lm() vs scikit-learn over shared Arrow data
sql_orders_report SQL cells over a local SQLite warehouse, mixing SQL / Python / markdown
widget_playground Widget cell (control panel) driving a downstream cell, with # @live reactivity
model_variants Variant groups - alternative training cells sharing one DAG slot (switch mode)
model_variants_sweep Variant sweep mode - run every variant and compare them in one downstream cell
loop_hill_climb # @loop / # @loop_until iteration with carry and per-iteration artifacts
data_viewer Interactive data viewer - page / sort / filter / search the full cached artifact
agent_demo A coding agent builds the notebook live; only the eval re-runs when the model caches

What is still moving

Materialization, the artifact store, the DAG, caching and headless run are settled and covered by tests. Three surfaces are not:

  • Prompt-cell API. Streaming, conversation memory and structured-output validation will change.
  • SQL cloud drivers. DuckDB, SQLite and PostgreSQL run in CI. BigQuery and Snowflake ship without integration coverage. MotherDuck and MySQL are not implemented.
  • On-disk formats. notebook.toml, .strata/runtime.json and the artifact cache layout may change between minor versions. Depend on the Python API, not the file shapes.

Library usage

Strata's HTTP API exposes the materialization layer directly, driveable from Python via StrataClient. Useful for direct table scans, custom transforms, and headless workflows; the notebook executor is a separate pipeline that writes to the same artifact store. The client talks to a running Strata server, so this workflow has two steps: start the server, then call it from your code.

# 1. Install + start the server (in a uv-managed env).
uv tool install strata-notebook
strata-notebook

# 2. In your own project, install the slim client - a separate package
#    (httpx + pyarrow only, no server deps, plain pip is fine) - and
#    point it at the running server:
pip install strata-client
from strata_client import StrataClient

client = StrataClient(base_url="http://localhost:8765")
artifact = client.materialize(
    inputs=["file:///warehouse#db.events"],
    transform={"executor": "scan@v1", "params": {"columns": ["id", "value"]}},
)
table = client.fetch(artifact.uri)  # Arrow table, cached by provenance

The server provides: provenance-based deduplication, immutable versioned artifacts, lineage tracking, Iceberg table scanning with row-group caching, pluggable blob storage (local/S3/GCS/Azure), multi-tenancy, trusted-proxy auth, and an executor protocol for external compute.

Library docs →


Architecture

┌─────────────────────────────────────────────┐
│ Notebook UI (Vue.js + WebSocket)            │
│ cells, DAG view, AI assistant, workers      │
└─────────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────────┐
│ Notebook Backend (FastAPI)                  │
│ session, cascade, executor, prompt cells    │
└─────────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────────┐
│ Strata Core                                 │
│ materialize, artifacts, lineage, dedupe     │
└─────────────────────────────────────────────┘

The notebook is an orchestration layer over Core. It decides what to run next (cascade planning, staleness tracking). The cell harness is an executor. Core decides whether results already exist and persists them.

Development

uv sync --all-extras                   # Install deps + build Rust extension (matches CI)
uv run pytest                          # Run all tests
uv run pre-commit run --all-files      # Lint + format
cd frontend && npm run dev             # Frontend dev server (hot reload)

License

Apache 2.0

Metadata

Release files for strata-notebook 0.7.0

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

Source distribution (sdist)

Source distribution for strata-notebook 0.7.0
File Size Uploaded
strata_notebook-0.7.0.tar.gz 1.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for strata-notebook 0.7.0
File
strata_notebook-0.7.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
strata_notebook-0.7.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
strata_notebook-0.7.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
strata_notebook-0.7.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
strata_notebook-0.7.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 13.7 MB

Release files / strata_notebook-0.7.0.tar.gz

Download URL strata_notebook-0.7.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
1b40f62764aff5a5364ea58189ea73c6a0370bf6b03bf18ab2dc4a35ce0a74b7
BLAKE2b-256 checksum
How to use checksums
ffe21fdce3de1c398f378338b7fc39eecb8eb109c0b69e9d41ce3aed088ff1a9
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 7, 2026.

Transparency log

Release files / strata_notebook-0.7.0-cp312-abi3-win_amd64.whl

Download URL strata_notebook-0.7.0-cp312-abi3-win_amd64.whl
Size 2.5 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b9e488a3f16066a1e5b53afa350885d6d8db9747ae70fc37fb2deb01312b5bb8
BLAKE2b-256 checksum
How to use checksums
4102d143c131b5b03e25c5008a1919fb07318d0d9dc2a2fd393a5b2e7d32eaab
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 7, 2026.

Transparency log

Release files / strata_notebook-0.7.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL strata_notebook-0.7.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
96098185a8f76f75a9a610566184ae40584e02baf9349400736bcca0dd734ac1
BLAKE2b-256 checksum
How to use checksums
28fa365ef25b2537744e8f176628bad3738df4ceee969a236308478f78cd8701
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 7, 2026.

Transparency log

Release files / strata_notebook-0.7.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL strata_notebook-0.7.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.5 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7068fd55f584bfba5caa6dba7593546d29993c61fb4be344cc4d04996fee0851
BLAKE2b-256 checksum
How to use checksums
8eedbe286fa39ed6348a53baf5984972db095c69b63270df8ae4635e9ac02ac7
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 7, 2026.

Transparency log

Release files / strata_notebook-0.7.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL strata_notebook-0.7.0-cp312-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
685aeb2ee6660cb26504a09f3e60ddb304fefb975d1f4ffdd1121232e941ca51
BLAKE2b-256 checksum
How to use checksums
8d4d5d966acd1048f8db7385481136e73ff3b5fe603533449b704d63d1258fc5
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 7, 2026.

Transparency log

Release files / strata_notebook-0.7.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL strata_notebook-0.7.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ac801aa14c7666f3743b9d715ac5d00662396fcd62304b53bdb1740bf58783e3
BLAKE2b-256 checksum
How to use checksums
0d0fab45ce6632b5fc655d1ee80efc79896dba4c3edb3f384b75776f4d346078
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 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

6 release files

0.9.0

6 release files

0.8.0

6 release files

This release

0.7.0 This release

6 release files

0.6.0

6 release files

0.5.0

6 release files

0.4.0

6 release files

0.3.0

6 release files

0.2.0

6 release files

0.1.0

6 release 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