matter

Examples

Applied patterns for authoring .matr programs across domains. Each example demonstrates real constructs, governance annotations, and constraint patterns that map into Material Cloud execution profiles. These are not toy programs. They represent the kinds of Material Computing workloads the platform is designed to handle.

Enterprise AI: molecular screening agent

An AI agent generates candidate matter programs, submits them to the Material Twin, evaluates signals, and iterates. This pattern is common in drug discovery, materials optimization, and any domain where an agent explores a large parameter space under governance constraints.

agent-authored program

// screening-candidate-0147.matr
// Generated by: BERNIE screening agent v3.2
// Campaign: small-molecule-binders-2026Q1

import { TargetProtein } from "@org/targets/HER2-v4"
import { StandardAssay } from "@org/protocols/binding-assay"

material Candidate0147 {
  substrate: "synth-peptide-lib"
  sequence: "CYCRGDFC"
  molecular_weight: 912.04 Da
  purity_required: >= 0.90
}

protocol BindingScreen {
  step synthesize {
    input: Candidate0147
    method: "solid-phase"
    duration: 4 hr
    temperature: 25°C
  }

  step assay {
    input: step.synthesize.output
    target: TargetProtein
    protocol: StandardAssay
    concentration_range: [1 nM, 10 uM]
    replicates: 3
  }
}

constraints {
  binding_affinity <= 100 nM    // Kd threshold
  selectivity_ratio >= 10       // vs off-targets
  synthesis_yield >= 0.70
  assay_z_score >= 0.5
}

governance {
  tier: T1
  consequence: "physical-negligible"
  approvals: ["auto"]
  campaign: "small-molecule-binders-2026Q1"
  agent: "bernie-screening-v3.2"
}

simulation {
  runs: 500
  confidence: 0.90
  substrate_model: "synth-peptide-lib-v2"
  baseline: "campaign-best-so-far"
}

output {
  binding_affinity: Kd in nM
  selectivity_ratio: ratio
  synthesis_yield: fraction
  assay_z_score: score
}

pattern

Agent-generated programs with campaign-level governance. The agent iterates; the platform governs each iteration independently.

governance

T1 with auto-approval. Low consequence per run, but campaign-level audit trails link every candidate to the generating agent.

signal usage

The agent reads signals from each run to decide the next candidate. Baseline comparison tracks progress across the campaign.

Scale biology: parallel batch synthesis

A production workflow that synthesizes nanoparticle batches at scale. Multiple protocols compose into a pipeline, with constraints that tighten at each stage. This pattern is used when physical parallelism across substrate pools is required to meet throughput targets.

multi-stage production program

// nanoparticle-batch-production.matr

material GoldSeed {
  substrate: "colloidal-au-production"
  diameter: 5 nm ± 0.5 nm
  concentration: 2.0 mM
  lot: "AU-2026-0215"
}

material CitrateBuffer {
  substrate: "reagent-stock"
  compound: "trisodium-citrate"
  concentration: 34 mM
  volume: 500 mL
}

protocol GrowthPhase {
  step nucleation {
    input: [GoldSeed, CitrateBuffer]
    temperature: 100°C
    duration: 30 min
    stir_rate: 600 rpm
    atmosphere: "N2"
  }

  step growth {
    input: step.nucleation.output
    temperature: 100°C → 70°C ramp over 45 min
    duration: 2 hr
    stir_rate: 300 rpm
  }

  step quench {
    input: step.growth.output
    temperature: 4°C
    duration: 15 min
    method: "ice-bath"
  }
}

protocol Characterization {
  step dls {
    input: GrowthPhase.output
    method: "dynamic-light-scattering"
    replicates: 5
  }

  step tem {
    input: GrowthPhase.output
    method: "transmission-electron-microscopy"
    sample_count: 200
  }

  step zeta {
    input: GrowthPhase.output
    method: "zeta-potential"
    replicates: 3
  }
}

constraints {
  particle_diameter: 50 nm ± 5 nm
  polydispersity_index < 0.15
  zeta_potential: -40 mV ± 10 mV
  batch_yield >= 0.85
  endotoxin < 0.25 EU/mL
  batch_to_batch_cv < 0.08
}

governance {
  tier: T2
  consequence: "physical-reversible"
  approvals: ["production-lead", "qa-review"]
  escalation: "halt-and-notify"
  compliance: ["GMP", "ISO-13485"]
  lot_tracking: true
}

simulation {
  runs: 2000
  confidence: 0.95
  substrate_model: "colloidal-au-production-v5"
  baseline: "batch-AU-2026-0201"
  timeout: 600s
}

pattern

Multi-protocol composition with characterization as a separate stage. The platform schedules growth and characterization as linked runs.

governance

T2 with production and QA approval. GMP compliance and lot tracking are enforced at the language level.

scale model

Batch parallelism is handled by Material Cloud facility orchestration, not the program. The same Molebyte executes across available facility capacity.

Precision sensing: environmental biosensor

A high-precision program for fabricating and calibrating a biosensor array. Constraints are tight, governance is elevated, and simulation parameters require high confidence. This pattern applies to diagnostics, environmental monitoring, and any application where measurement accuracy is critical.

precision fabrication program

// biosensor-array-v2.matr

material AptamerProbe {
  substrate: "oligo-synth"
  sequence: "GGTTGGTGTGGTTGG"   // thrombin aptamer
  modification_5: "thiol-C6"
  modification_3: "FAM"
  purity_required: >= 0.98
}

material GoldElectrode {
  substrate: "electrode-fab"
  surface: "Au(111)"
  area: 0.196 cm²
  roughness_factor: 1.2 ± 0.1
}

protocol Fabrication {
  step clean {
    input: GoldElectrode
    method: "piranha-etch"
    duration: 5 min
    temperature: 25°C
    safety: "fumehood-required"
  }

  step immobilize {
    input: [step.clean.output, AptamerProbe]
    method: "self-assembled-monolayer"
    concentration: 1 uM
    incubation: 16 hr
    temperature: 4°C
    atmosphere: "N2"
  }

  step backfill {
    input: step.immobilize.output
    reagent: "mercaptohexanol"
    concentration: 1 mM
    duration: 1 hr
    temperature: 25°C
  }

  step calibrate {
    input: step.backfill.output
    analyte: "thrombin"
    concentration_series: [0.1 nM, 1 nM, 10 nM, 100 nM, 1 uM]
    method: "square-wave-voltammetry"
    replicates: 5
  }
}

constraints {
  probe_density: 4e12 molecules/cm² ± 1e12
  signal_to_noise >= 10
  limit_of_detection <= 0.5 nM
  linear_range: [1 nM, 100 nM]
  coefficient_of_variation < 0.05
  electrode_to_electrode_cv < 0.10
}

governance {
  tier: T3
  consequence: "physical-significant"
  approvals: ["sensor-lead", "metrology", "safety-review"]
  escalation: "halt-review-revalidate"
  compliance: ["ISO-15197", "IVD-directive"]
}

simulation {
  runs: 5000
  confidence: 0.99
  substrate_model: "electrode-fab-v4"
  baseline: "biosensor-array-v1-production"
  timeout: 900s
}

pattern

Precision fabrication with tight tolerances and multi-step surface chemistry. Each step builds on the previous, with no room for out-of-spec intermediates.

governance

T3 with three-person approval chain. IVD compliance labels are embedded in the artifact and enforced by Material Cloud policy.

simulation

5,000 simulation runs at 99% confidence. The high bar reflects the cost and irreversibility of electrode fabrication failures.

Hybrid AI: closed-loop optimization

A pattern where AI-generated matter programs and Material Cloud execution form a closed loop. The agent proposes formulations, Material Cloud executes them, signals feed back to the agent, and the agent generates improved programs. Governance escalates automatically as the agent approaches high-value parameter regions.

adaptive optimization loop

// polymer-optimization-iter-023.matr
// Generated by: BERNIE formulation agent v2.1
// Loop: closed-loop-polymer-opt-2026
// Iteration: 23 of max 100

import { BasePolymer } from "@org/materials/PLGA-5050"
import { Surfactant } from "@org/materials/PVA-31k"

material FormulationIter023 {
  substrate: "nanoparticle-encapsulation"
  polymer: BasePolymer
  surfactant: Surfactant
  // Agent-optimized parameters for this iteration
  polymer_concentration: 12.5 mg/mL    // was 10.0 in iter-022
  surfactant_concentration: 2.1% w/v   // was 2.5% in iter-022
  organic_phase: "acetone"
  aqueous_phase: "water"
  drug_loading_target: 8% w/w
}

protocol Nanoprecipitation {
  step prepare_organic {
    input: FormulationIter023
    method: "dissolve"
    solvent: "acetone"
    duration: 30 min
    temperature: 25°C
  }

  step precipitate {
    input: [step.prepare_organic.output, Surfactant]
    method: "dropwise-addition"
    flow_rate: 0.5 mL/min
    stir_rate: 800 rpm
    temperature: 25°C
  }

  step evaporate {
    input: step.precipitate.output
    method: "rotary-evaporation"
    temperature: 40°C
    pressure: 150 mbar
    duration: 45 min
  }

  step characterize {
    input: step.evaporate.output
    measurements: ["DLS", "zeta", "encapsulation-efficiency"]
    replicates: 3
  }
}

constraints {
  particle_size: 150 nm ± 30 nm
  polydispersity_index < 0.20
  encapsulation_efficiency >= 0.60
  drug_loading >= 0.06               // 6% w/w minimum
  zeta_potential < -20 mV
}

governance {
  tier: T1
  consequence: "physical-negligible"
  approvals: ["auto"]
  escalation: "notify-if-constraint-fail"
  loop: "closed-loop-polymer-opt-2026"
  iteration: 23
  agent: "bernie-formulation-v2.1"
  // Auto-escalates to T2 if agent approaches
  // high-value parameter region (defined in policy)
  auto_escalation: {
    condition: "encapsulation_efficiency >= 0.85"
    target_tier: T2
    reason: "approaching production-viable formulation"
  }
}

simulation {
  runs: 200
  confidence: 0.90
  substrate_model: "nanoparticle-encapsulation-v3"
  baseline: "iter-022-signals"
}

pattern

Closed-loop optimization where each iteration is a governed program. The agent controls parameters; the platform controls governance.

auto-escalation

Governance tier escalates automatically when the agent finds high-performing formulations. This prevents unsupervised crossing into production-viable territory.

provenance

Every iteration is linked: agent version, loop ID, iteration number, and baseline reference create a complete optimization history in Vault.

Pattern summary

Agent-generated screening

T0-T1

AI generates candidates, platform governs each independently. Campaign-level audit trails.

Multi-stage production

T2-T3

Composed protocols with tightening constraints at each stage. Facility-level parallelism.

Precision fabrication

T3-T4

Tight tolerances, elevated governance, high-confidence simulation. For diagnostics and metrology.

Closed-loop optimization

T1-T2 (auto)

Agent-driven iteration with auto-escalating governance as results improve.