A reference architecture for falsifiable, budget-controlled, multi-fidelity agentic discovery loops.
falsifyis not a photonic CAD tool. It is an architecture for autonomous research loops that produce typed, falsifiable hypotheses with content-hashed evidence and refuse to declare success without independent verification. Photonics is the worked example.
A small Python framework (≈ 1.5k LOC) that wires together six things most agentic-discovery systems leave implicit:
- Typed
Hypothesisrecords with apredict()method, automatically paired with a null hypothesis. Tolerance is set by the goal, not by the agent. - Immutable, content-addressed evidence (Designs, Simulations, AnalysisReports, FOMs, ConvergenceReports) in a NetworkX-backed knowledge graph with 8 node and 8 edge types.
- Intent stamps on every producer edge.
explain_provenance(node_id)returns the causal chain back to the originating goal, with the hypothesis being tested at each step. - Three-condition stop gates: DRC ∧ high-fidelity-converged ∧
cross-fidelity agreement. The Coordinator refuses
target_reachedotherwise. - Budget controls: max iterations, simulations, wall time, and
high-fidelity runs, each with a typed
stop_reason. - Domain plugins under
falsify.domains.*. v0.1 shipsphotonic(MZI worked example) andsynthetic(benchmark problems with ground truth).
- A replacement for gdsfactory, Lumerical, Tidy3d, Synopsys OptoCompiler, or Cadence Virtuoso Photonic. The shipped SAX engine is uncalibrated; do not trust its FOMs as device-quality predictions.
- An LLM-driven agent. The v0.1 hypothesis layer is rule-based pattern detection. An LLM-backed pattern is on the roadmap (v0.6).
- A finished scientific-discovery system. See LIMITATIONS.md.
git clone https://github.com/mutib202-ux/falsify
cd falsify
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest # ~10–20 s
python examples/quickstart.pyfrom falsify.contracts import Budget, Goal
from falsify.domains.photonic.loop import build_default_loop
loop = build_default_loop(
goal=Goal(component_family="mzi", target_metric="FSR_nm",
target_value=0.4007, target_tolerance=0.05), # ≈ 50 GHz
budget=Budget(max_iterations=8, max_simulations=30,
max_wall_time_s=60.0, max_fdtd_runs=4),
)
report = loop.run()
print(report.to_markdown())The headline run converges in 2 iterations, 7 simulations, and 1 FDTD verification (the default verifier is a deterministic mock — see docs/ for plugging in real Meep).
CoordinatorAgent.run()
│
seed → ingest → hypothesize → review → check_stop
↓ ↓
STOP CONTINUE
↓ ↓
report plan → dispatch → ingest …
┌───────────────┐
│ KnowledgeGraph │ nx.MultiDiGraph
│ 8 node types │ immutable evidence
│ 8 edge types │ intent_id on every
└───────────────┘ producer edge
⇈
AnalysisAgent ← SimulationEngine ← DesignFactory
⇈
HypothesisAgent (pattern detectors + null pairing)
⇈
MeepVerifier (FDTD gate before target_reached)
| Layer | Status |
|---|---|
| KG + intent provenance | ✅ stable, tested |
| Hypothesis + null pairing + extrapolation guard | ✅ stable, tested |
| Coordinator + three-condition gates | ✅ stable, tested |
| Photonic SAX engine | 🟡 toy, qualitatively realistic, not calibrated |
| Photonic Meep verifier | 🟡 deterministic mock by default; real Meep is a swap-in |
| LLM-backed hypothesis patterns | 🔴 v0.6 |
| Foundry PDK integration | 🔴 v1.0 |
| Multi-objective / Pareto | 🔴 v0.8 |
See ROADMAP.md for the timing.
The provenance graph, the falsifiable-hypothesis ledger, and the three-condition gates are the framework's actual contribution. The photonics layer demonstrates them on a problem with a closed-form answer (FSR = λ²/(n_g · ΔL)); the loop converges fast because the relation is algebraic.
If you want to use this as a scientific discovery system, you need to plug in an experimental oracle (a real measurement, a real independent solver, a real foundry run). The architecture is ready for that; v0.1 doesn't ship it.
If you use falsify in research:
@software{falsify_2026,
author = {falsify contributors},
title = {falsify: a reference architecture for falsifiable agentic
discovery loops},
year = 2026,
url = {https://github.com/mutib202-ux/falsify},
}Apache License 2.0. The patent grant matters in photonic CAD; permissiveness matters for research adoption. Optional GPL-licensed dependencies (KLayout, pymeep) are documented in NOTICE.