Module · ReactionIQBayesian · Multi-objective · Closed-loop

The next experiment, chosen by the surrogate — not by intuition.

ReactionIQ runs the closed-loop optimisation engine inside MolTrace. Bayesian acquisition over a live Gaussian-process surrogate proposes the conditions most worth trying next — under hard constraints from your spectroscopy evidence and regulatory framework.

Why this exists

Trial-and-error is expensive — and silent about what it missed.

A typical process-chemistry campaign runs 40–80 reactions to find a robust optimum. Most of those reactions are wasted — they sample regions the team already knew were bad, or repeat conditions a previous campaign explored two years ago and forgot.

At the same time, regulatory burden is climbing. Every condition tried is a potential data point that needs to be traceable. Every impurity that crosses an ICH limit is a campaign-restart event. Spreadsheet-tracked reaction histories can't withstand inspection — and don't survive the analyst who wrote them.

ReactionIQ runs the acquisition function in your stead. It remembers every prior campaign, respects every active regulatory constraint, and proposes the experiment most likely to advance the Pareto frontier — with an auditable trail of why.

The optimisation loop

Seven stages, looping until the surrogate converges.

Each round emits a typed Pydantic record. The surrogate state, the acquisition proposal, the measured outcome, and the human decision are all recipe-hash-linked so any prior campaign replays bit-identically.

  1. 01

    Define

    Set the design space: input variables (solvent, temperature, equivalents, time, catalyst loading), discrete or continuous bounds, encoded categoricals. The same Pydantic model the backend's ConditionDomain consumes.

    Emits

    design_space · variable_bounds · categoricals

  2. 02

    Constrain

    Hard limits from Regulatory Hub auto-load: ICH Q3C residual-solvent ceilings, Q3D PDE limits, M7 nitrosamine alerts. Plus safety + cost guardrails from your operational profile.

    Emits

    objective_profile · cost · safety · regulatory_priors

  3. 03

    Propose

    Bayesian acquisition over a Gaussian-process surrogate. Expected Improvement (single objective), q-Noisy Expected Hypervolume Improvement (multi-objective batch), upper confidence bound for exploration. Reproducible — same seed, same batch.

    Emits

    recommendation_batch · acquisition_score · expected_improvement

  4. 04

    Run

    Execute the proposed batch in the lab (manual) or on an autonomous platform (closed-loop). Recipe + parameters pinned by recipe-hash; cross-modal evidence pulled in automatically when the batch finishes.

    Emits

    run_id · recipe_hash · operator · timestamp

  5. 05

    Measure

    Spectroscopy evidence lands automatically. Yield, purity, selectivity, impurity profile, residual solvent — all per-condition, all hyperlinked to source spectra.

    Emits

    yield · purity · impurity_set · ee · spectra_uris

  6. 06

    Update

    Surrogate refit with the new observation. Posterior mean + variance over the design space recompute. Constraint-aware: violated points get masked out before the next proposal.

    Emits

    posterior · constraint_mask · pareto_set

  7. 07

    Decide

    Continue, stop, or pivot. Stopping rules built in: hypervolume convergence, budget exhaustion, hyper-parameter saturation. Human reviewer signs every campaign decision into the audit ledger.

    Emits

    decision · rationale · reviewer · audit_event

At a glance

     ┌─►  Define design space  ──►  Constrain (regulatory + safety + cost)
     │                                            │
     │                                            ▼
  Decide (stop / pivot / continue)         Propose (acquisition over GP surrogate)
     ▲                                            │
     │                                            ▼
  Update surrogate posterior  ◄──  Measure  ◄──  Run (manual or closed-loop)
        with constraint mask          (spectroscopy auto-attaches)

Methods we ship

Four optimisation regimes. One typed API.

Switch regimes by argument — the design-space + objective + constraint contract stays identical across all four. The backend uses run_bayesian_optimization() with the same acquisition_score + expected_improvement fields.

BO

Bayesian Optimization

Single-objective · model-based

  • Gaussian-process surrogate with Matern / RBF kernels
  • Expected Improvement (EI) + UCB acquisition
  • Categorical encoding for solvents, catalysts, additives
  • Reproducible by seed — same campaign re-runs bit-identically
  • Backend: run_bayesian_optimization() · acquisition_score
MOBO

Multi-Objective Bayesian Optimization

Pareto-frontier · batch-aware

  • Yield × purity × cost × impurity-load trade-off
  • q-Noisy Expected Hypervolume Improvement (qNEHVI)
  • Batch recommendations — propose N reactions at once
  • Pareto-set visualisation with non-dominated frontier
  • Diversity penalty against redundant proposals
AL

Active Learning

Uncertainty-driven · explore + exploit

  • Variance-weighted sampling for under-explored regions
  • Curiosity-driven probes inside safety guardrails
  • Useful for discovery campaigns, not optimisation
  • Integrates with literature priors + predicted-shift models
  • Stops automatically when surrogate variance plateaus
CL

Closed-Loop Autonomous

Robot-driven · continuous campaign

  • Direct integration with autonomous synthesis platforms
  • Spectroscopy auto-acquired between rounds
  • Hands-off campaigns running 24/7 with audit attribution
  • Safety abort triggers wired to live sensor streams
  • Reviewer signs off pivots, not individual rounds

Use cases shipped

Six campaign templates, with inputs and outputs.

Each is a typed pipeline you parameterise — not a bespoke build. The same acquisition engine drives every template; the differences are in design-space encoding and objective weighting.

Reaction screening

Hit-finding across solvent / base / catalyst combinatorial space. Discrete-categorical Bayesian search with diversity-aware proposals.

Inputs

Categorical design space · screening budget

Outputs

Top-N hits · uncertainty bounds · suggested follow-up

Yield + selectivity optimisation

Continuous-variable optimisation over temperature, equivalents, residence time. Multi-objective when selectivity matters as much as yield.

Inputs

Continuous bounds · objective weights

Outputs

Pareto frontier · best-by-objective conditions

Impurity suppression

Regulatory-Hub impurity limits become hard constraints. Optimiser proposes only conditions predicted to clear ICH Q3A/Q3B thresholds.

Inputs

Impurity limits from regulatory · prior runs

Outputs

Compliant conditions · constraint-aware ranking

Cost-aware development

Cost surrogate co-trained alongside yield. Proposes the cheapest condition that still hits the objective — useful for late-stage process work.

Inputs

Reagent unit costs · time budget · operator load

Outputs

Cost-Pareto frontier · sensitivity report

Conditions for scale-up

Optimises for robustness at scale: temperature insensitivity, mixing-time tolerance, work-up reproducibility. Variance-weighted objective.

Inputs

Lab-scale data · scale-up risk profile

Outputs

Robust conditions · sensitivity heatmap

Method-development DOE

HPLC method dev, work-up optimisation, crystallisation polymorph search. Same engine, different objectives — purity + recovery + crystal habit.

Inputs

Design variables · purity targets

Outputs

Validated method · Q2(R2)-ready parameters

Anatomy of a campaign

Five rounds. One Pareto frontier. One audit ledger.

The campaign below is the worked example threading through every module page — acetic-acid impurity suppression. Round 4 violates the Q3C constraint mid-flight; Round 5's acquisition mask routes around it.

bayesian_optimization_run · run_4f7a · 5 rounds · convergence reached

RoundAcquisitionProposedMeasuredStatus
R01Latin Hypercube · seedT 25 °C · 1.2 eq · DCM · 4 hyield 41% · imp 3.2% · cost lowExplore
R02EI · α 0.84T 50 °C · 1.5 eq · DCM · 6 hyield 67% · imp 1.8% · cost lowExploit
R03qNEHVI batch · k=3T 65 °C · 1.5 eq · MeCN · 8 hyield 74% · imp 1.1% · cost midExploit
R04UCB · β 1.6T 80 °C · 2.0 eq · MeCN · 4 hABORT · imp 5.8% > Q3C capConstraint
R05EI · constrainedT 60 °C · 1.8 eq · MeCN · 6 hyield 81% · imp 0.7% · cost midBest so far

Yield trajectory · convergence after constraint mask

  R01  ████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  41 %   explore
  R02  █████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░  67 %   exploit
  R03  ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░  74 %   exploit
  R04  ██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  ABORT  Q3C limit exceeded
  R05  ████████████████░░░░░░░░░░░░░░░░░░░░░░░░  81 %   best · constraint-aware

  Pareto best   81 % yield  ·  0.7 % impurity (Q3C compliant)  ·  mid cost
  Stop reason   hypervolume Δ < 0.01 over last 2 rounds

The honest comparison

What changes when the surrogate picks the next experiment.

Trial-and-error campaigns aren't bad — they're under-instrumented. ReactionIQ keeps the chemist as the decision-maker but moves the experiment-selection step from gut to acquisition function.

DimensionTrial-and-errorReactionIQ
Experiment selectiontoday

Intuition + last-week's lab meeting + grad-school heuristics

with ReactionIQ

Acquisition-function-driven · Expected Improvement over the live surrogate

Constraint handlingtoday

Hope the operator remembers the impurity limit · catch in QC later

with ReactionIQ

Hard constraint at proposal time · violated points masked before the optimiser ever sees them

Batch parallelismtoday

One reaction at a time · serialised round-trip on the bench

with ReactionIQ

qNEHVI batch proposes N diverse runs · plate-aware suggestions

Replay 6 months latertoday

Lab notebook + memory · 'we tried that, didn't work, can't remember why'

with ReactionIQ

Recipe-hash replay · same surrogate, same posterior, same proposal — forever

Stopping decisiontoday

Run until budget runs out · or until someone gets frustrated

with ReactionIQ

Hypervolume convergence · explicit stopping criteria · auditable decision

Cross-module evidencetoday

Yield in a spreadsheet · impurity in a PDF · cost in an email

with ReactionIQ

One typed record per round · spectra hyperlinked · cost + impurity + audit entry together

Three pillars, one loop

The whole platform, on one acetic-acid impurity.

Picking up the cross-module worked example from Spectroscopy + Regulatory Hub — here's the role ReactionIQ plays when the impurity threshold is crossed mid-campaign.

  1. Spectroscopy says

    Round 4 shows acetic acid impurity at 2.10 ppm climbed to 5.8% — over the ICH Q3C Class 3 informational threshold for this drug substance.

  2. Regulatory Hub routes

    Constraint flips from 'informational' to 'hard limit' for subsequent rounds. ReactionIQ receives the new constraint vector via the typed cross-module API.

  3. ReactionIQ reacts

    Surrogate masks the violating region. Round 5 acquisition function only proposes conditions predicted to keep acetic acid below 2%. Result: 81% yield, 0.7% impurity.

  4. Audit ledger records

    Cross-module handoff captured as a single audit_event with full provenance. Inspector can replay every decision from FID hash to recipe update.

Trust & reproducibility

Bayesian, yes. Black-box, no.

Every campaign is replayable from any prior date. Every proposal is acquisition-attributed. Every pivot is signed. The surrogate is a tool — the chemist is the decision-maker.

  • Seed-reproducible campaigns

    Same design space + same seed + same observations = same proposals. Forever. Recipe-hash-linked surrogate state pinned per round.

  • Constraint-aware by design

    Regulatory limits, safety thresholds, and cost ceilings enter the optimiser as hard constraints — not soft hints. No proposal ever violates a known limit.

  • Human signoff per pivot

    AI proposes batches. Humans approve campaigns. Every pivot (stop, continue, escalate) is signed and recorded with reviewer + role + rationale.

  • Safety abort wired live

    Closed-loop campaigns include live sensor streams. Out-of-bounds temperature / pressure / off-gas triggers immediate abort + ledger entry.

  • Spectra linked per round

    Every measured outcome carries the SpectraCheck SHA-256 of the source spectrum + the regulatory verdict + the cost line — one row, full provenance.

  • Campaign replay forever

    Re-derive any historic Pareto front, any historic proposal, any historic decision from any prior date. Bit-identical, recipe-hash-pinned.

Bring us a stalled campaign.

Pick a reaction where you've already run 30+ conditions and can't tell what to try next. We'll show you the Pareto frontier ReactionIQ would propose — with your regulatory constraints already enforced.