Skip to main content

noodlelab

Try the live demo Open in GitHub Codespaces

Verifiable science for AI agents, and for the people who check their work.

AI agents write scientific and engineering code quickly, but nothing makes them show their work. A number comes back without a unit, a measured input without an uncertainty, a design "works" without saying by how much, and nobody can say later what was run. noodlelab gives every calculation:

  • units on every number;
  • uncertainty on every measured input;
  • requirements that are checked, with margins;
  • a provenance record of every run.

Then it audits the calculation, so an agent can prove its work and you can check it.

A cantilever bracket in the editor: material trade, beam and stress nodes with plots on them, and the Requirements tab listing three requirements passed with their margins Example 24: sizing a cantilever bracket. Each requirement shows its margin and the run that verified it.

Designed for AI agents

noodlelab is built around the loop a coding agent works in: write, run, check, fix. Each part of it is machine-readable, and the agent can't skip a step without it showing.

An agent needs to… noodlelab gives it
know it is done noodlelab verify exits with 0 only when every check passed and every requirement was verified. --json gives the verdict as data.
be told what it skipped the audit (NL001–NL010) flags unverified requirements, results without units or uncertainty, inputs without a source, and uncommitted code
prove what it ran a provenance.json for every run: inputs, results, checks, the code's hash and git commit, file SHA-256s, the environment
build things people can review graphs in plain JSON (with a schema) that open as nodes in the editor and render PDF reports
find and learn the package llms.txt, AGENTS.md, a Claude skill, an MCP server with a guide tool, docstrings written to be read
fit into your project noodlelab init-agent sets it all up in one command

This is what an agent sees when it cuts corners:

$ noodlelab verify sloppy.py
✗ sloppy.py
  ✗ beam sizing: incomplete
    ✓ STR-001: 180 MPa meets ≤ 250 MPa (margin +70 MPa, +28.0 %)
    ! NL002 DEF-001 was never verified
    ! NL004 result 'stress' has no unit (say unit='1' if it is dimensionless)
    ! NL005 result 'stress' has no uncertainty (give its inputs one, or exact=True)
    · NL006 input 'load' has no source
    record: runs/20260926-100232-beam-sizing-4eece145/provenance.json
0 of 1 passed

The exit code is 1, so the agent doesn't report "done" until it has fixed these.

Three ways in

1. The Agent panel in the editor. Press Agent to open Claude Code or Codex CLI in a terminal under the canvas, sign in as it asks, and describe the analysis. It builds the graph, the requirements and the report through noodlelab's tools, and every graph it saves appears on your canvas.

The Agent panel: a terminal under the canvas where the agent called guide, list_nodes, save_graph, run_graph and verify; the drop-test graph it built is on the canvas and the Requirements tab shows both requirements passed A drop test built by an agent: fall time and impact speed from √(2h/g) and √(2gh) with propagated uncertainty, two requirements verified, a PDF report. Here a scripted agent calls the same MCP tools Claude Code would.

2. Your own agent, in your own project.

uv add noodlelab && noodlelab init-agent   # AGENTS.md, CLAUDE.md, skill, .mcp.json
codex mcp add noodlelab -- noodlelab mcp   # Codex CLI (Claude Code reads .mcp.json)

The MCP server has tools for:

  • finding nodes and examples;
  • saving and editing graphs;
  • checking and running them;
  • reading requirement verdicts;
  • verifying scripts and graphs.

docs/agents/adopt-in-existing-project.md is the step-by-step for "make my project verifiable".

3. Plain Python, for scripts, notebooks and tests (pip install noodlelab):

import noodlelab.verify as nv

with nv.record("drop test") as rec:  # writes runs/<...>/provenance.json
    h = rec.input("h", "2.00 ± 0.01 m", source="tape measure, lab book p. 4")
    g = rec.input("g", "9.81 ± 0.02 m/s^2", source="local gravity survey")
    t = rec.result("fall time", (2 * h / g) ** 0.5)  # (0.6386 ± 0.0017) s
    v = rec.result("impact speed", (2 * g * h) ** 0.5)  # (6.264 ± 0.017) m/s
    rec.require("""
        DRP-001 fall_time <= 1 s [Analysis]      # The drop shall take at most 1 s
        DRP-002 impact_speed <= 7 m/s [Analysis] # The part shall land below 7 m/s
    """)
    rec.verify("DRP-001", t)
    rec.verify("DRP-002", v)
$ noodlelab verify drop.py
✓ drop.py
  ✓ drop test: passed
    ✓ DRP-001: 0.6386 s meets ≤ 1 s (margin +0.3614 s, +36.1 %)
    ✓ DRP-002: 6.264 m/s meets ≤ 7 m/s (margin +0.7358 m/s, +10.5 %)
1 of 1 passed

What each piece does:

  • Units: Pint quantities, so adding metres to seconds raises an error.
  • Uncertainty: propagated as the GUM describes, with correlations kept. nv.budget() shows which input dominates, and nv.monte_carlo() checks whether the linear result holds.
  • Requirements: written as text a person can read, and verified with margins.
  • Checking a result: rec.expect() tests any condition, rec.close_to() compares with a reference value, and @nv.traced records a function's calls.

See the quickstart.

The editor

Every node is a type-hinted Python function. You wire them up in the browser, see previews on the nodes while you edit, and write the results up as a PDF.

Example 23, a satellite downlink link budget, with five requirements passed in the Requirements tab
A link budget (example 23): symbolic equations with units, five requirements, a trade over candidate radios.
Example 20, groundwater nitrate: wells reprojected, joined with districts and interpolated, with map previews on the nodes
A geospatial study (example 20): well data joined with districts, interpolated and summarised, with a map preview on every node.

The Reporting canvas builds the report from what Processing computed. The Outputs list has every figure, table and number, ready to drag in (⧉ shows Processing and Reporting side by side):

The Reporting canvas of example 23: report nodes for the title, equations, text, values and the requirements, with the Outputs list of figures and tables

Rendering the report gives the equations, figures, compliance matrix and a reproducibility appendix (run, software versions, input checksums, every step):

Four pages of the satellite link report: the requirements and link budget equations, the bit error rate, the margin plots and compliance matrix, and the reproducibility appendix

Also in the editor:

  • Requirements and Tracked tabs, which follow verdicts and values from run to run, with where each came from.
  • Checkpoints, so runs resume where they left off.
  • Sweep, optimize and repeat zones.
  • Uncertainty budgets and Monte Carlo.
  • Export to plain Python.
  • Shared servers with roles, and Slurm clusters.

docs/editor.md has the details, and the Help tab has 24 examples to open and run.

Install

pip install noodlelab           # the library: noodlelab.verify, verify/run/test/mcp on the command line
uvx "noodlelab[full]" .         # the editor with every node pack, on this folder
Tier Adds
noodlelab The library: units, uncertainty, requirements, checks, provenance, audit, the MCP server, headless runs.
noodlelab[app] The editor and PDF reports.
[maths] · [science] · [engineering] · [geo] · [full] Node packs: arrays and fitting, tables, statistics and signals, structures and heat, maps and rasters, everything.

docs/installation.md lists every node by tier, and explains adding packs and remote storage.

Command line

noodlelab verify model.py analysis.graph.json --json  # run and audit: exit 1 if anything fails
noodlelab mcp                                         # the MCP server for agents (stdio)
noodlelab init-agent                                  # set up a project for agents
noodlelab run analysis.graph.json -v                  # run a graph headless
noodlelab test *.graph.json --baseline final          # checks and regression against a final run
noodlelab export analysis.graph.json -o analysis.py   # a graph as a plain Python script
noodlelab serve .                                     # the editor

Writing a node

from noodlelab import Quantity, node


@node(category="Engineering/Structures")
def bending_stress(moment: Quantity["N*m"], section_modulus: Quantity["mm^3"]) -> Quantity["MPa"]:
    """Bending stress at the outer fibre: M / Z."""
    return (moment / section_modulus).to("MPa")

The type hints decide the sockets, units and widgets. Links convert units on the way in, and the editor refuses to link incompatible dimensions. The docstring is the help text that people and agents read. Uncertainty propagates through the node without any code in it: give it 1200 ± 30 N·m and it returns (150.0 ± 3.7) MPa. Ship nodes as a pack with a noodlelab.nodes entry point: see examples/noodlelab-example-pack, or run noodlelab new-pack.

More

License

See LICENSE.

Release files for noodlelab 0.1.1

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

Source distribution (sdist)

Source distribution for noodlelab 0.1.1
File Size Uploaded
noodlelab-0.1.1.tar.gz 3.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for noodlelab 0.1.1
File Interpreter ABI Platform
noodlelab-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 MB

Release files / noodlelab-0.1.1.tar.gz

Download URL noodlelab-0.1.1.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
6664d0636575bc8dfe06a5af4ee77086c2b1fab9bc65c1511dc6a2680f357c4f
BLAKE2b-256 checksum
How to use checksums
2f11b056ad459034b824bb083e61876d005a8f3cee1c7744de2f142fb010a8a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / noodlelab-0.1.1-py3-none-any.whl

Download URL noodlelab-0.1.1-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f7ce953654f0dff25b66dfdebcd5271c6cd4cae85a2be207a602ad9d0bf3ada9
BLAKE2b-256 checksum
How to use checksums
01bad7594307ea1fc7193f857fb4a1d465a954b7d0c5de379dab591fe249fc08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 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