Functorial pattern spaces and verifiable interfaces for reliable AI agent systems
From cellular metaphor sprawl toward typed interfaces, cognitive light cones, and verifiable structural guarantees.
Most agent systems fail structurally, not locally: correlated hallucinations slip past same-model reviewers, sequential chains accumulate handoff loss, fragmented toolsets incur
Rather than mirroring every organelle of a eukaryotic cell into software boilerplate, Operon follows the structural core of Michael Levin's Ingressing Minds (Philosophies 2026, 11(5):161)—and supplies the Applied Category Theory it lacks:
-
Pattern Space as Typed Wiring + Replayable Invariants (
PatternSpec): Control patterns live in an abstract operad of typed wiring diagrams paired with mechanically replayableCertificateobligations. -
Embodiments as Pointer Functors (
Realization): Natural, synthetic, and hybrid runtimes realize patterns via strict or lax monoidal functors. Strict realization transfers structural guarantees for free (Levin's "free lunches"); lax realization quantifies degradation explicitly (correlation$\rho$ in conjunctive verification, Data Processing Inequality handoff loss$\Delta I$ , or embedding fidelity). -
Bi-Temporal Cognitive Light Cones (
CognitiveLightCone+BiTemporalMemory): Combines optic-filtered wiring observations (obs_i) with valid-time and record-time horizons(t_v, t_r)to analyze multi-agent scaling and reconstruct exact past belief states. -
Polycomputing Fibers (
PolycomputingFiber): Multiple pattern realizations sharing one physical/computational substrate through commuting read/write lenses.
(Scope note: Operon adopts methodological structuralism—formalizing pattern spaces, interfaces, and light cones mathematically while staying agnostic on phenomenal consciousness; full engagement with Levin's non-physicalist consciousness claims is reserved for future work.)
Operon's canonical API is streamlined to ~65 focused exports across five layers:
| Layer | Module | Responsibility |
|---|---|---|
| 1. Core | operon_ai.core |
WiringDiagram, Optic, BarrierFilter, Coalgebra, PatternSpec, Realization, LaxityReport, PolycomputingFiber, Certificate, CognitiveLightCone, epistemic_analyze |
| 2. Memory | operon_ai.memory |
BiTemporalMemory, BiTemporalFact, BiTemporalQuery (canonical append-only dual-axis store) |
| 3. Motifs | operon_ai.motifs |
Proven control motifs only: ReviewerGate (CFFL), QuorumSensingBio (decay), Chaperone / ChaperoneLoop, ATP_Store / MTORScaler / DNARepair / Genome, ImmuneSystem / StagnationMonitor, DiffusionField, Tissue / TissueBoundary, PlasmidRegistry |
| 4. Runtime | operon_ai.runtime |
Single composable runtime (SkillOrganism, SkillStage, SpecialistSwarm, WatcherComponent, VerifierComponent, CertificateGateComponent, advise_topology, Nucleus, providers) |
| 5. Adapters | operon_ai.adapters |
ExternalTopology IR, CompilerFunctor, LangGraph & A2A/GasCity/AgentFlow/DSPy certificate contracts (operon_ai.adapters.contrib holds exploratory framework wrappers) |
Backward Compatibility: Deprecated cellular-roleplay wrappers (
Ribosome,Lysosome,Telomere,IntegratedCell,HistoneStore) and renamed protocols (DenatureFilter→BarrierFilter,EpiplexityMonitor→StagnationMonitor) remain available via PEP 562 lazy shims onoperon_ai(withDeprecationWarning) and underoperon_ai.legacy.
pip install operon-aifrom datetime import datetime, timezone
from operon_ai import (
ATP_Store, BiTemporalMemory, CognitiveLightCone,
DataType, IntegrityLabel, ModuleSpec, PatternSpec,
PortType, Realization, WiringDiagram,
)
diagram = WiringDiagram()
diagram.add_module(ModuleSpec("generator", outputs={"draft": PortType(DataType.TEXT)}))
diagram.add_module(ModuleSpec("reviewer", inputs={"draft": PortType(DataType.TEXT)}))
diagram.connect("generator", "draft", "reviewer", "draft")
pattern = PatternSpec(
name="conjunctive_review_gate",
diagram=diagram,
obligations=("priority_gating",),
axioms=("independent_verifier",),
)
budget = ATP_Store(budget=100, silent=True)
realization = Realization(
pattern=pattern,
substrate_kind="hybrid",
bindings={"generator": "llm:fast", "reviewer": "symbolic:validator"},
certificates=(budget.certify(),),
)
report = realization.verify_ingression(lax_defects={"verifier_correlation_rho": 0.0})
assert report.strict and report.all_certificates_hold
cone = CognitiveLightCone.from_diagram(diagram, "reviewer", record_horizon=datetime.now(timezone.utc))
print(cone.spatial_width, cone.observable_modules)from operon_ai import (
BiTemporalMemory, MockProvider, Nucleus, SkillStage,
TelemetryProbe, advise_topology, reviewer_gate, skill_organism,
)
advice = advise_topology(task_shape="sequential", tool_count=2, subtask_count=3, error_tolerance=0.02)
print(advice.recommended_pattern, advice.suggested_api)
gate = reviewer_gate(
executor=lambda prompt: f"EXECUTE: {prompt}",
reviewer=lambda prompt, candidate: "safe" in prompt.lower(),
)
print(gate.run("Deploy safe schema migration").allowed)
fast = Nucleus(provider=MockProvider(responses={"route": "EXECUTE: billing"}))
deep = Nucleus(provider=MockProvider(responses={"billing": "EXECUTE: escalate"}))
organism = skill_organism(
stages=[
SkillStage(name="intake", role="Normalizer", handler=lambda task: {"request": task}, emit_output_fact=True),
SkillStage(name="router", role="Classifier", instructions="route", mode="fixed"),
SkillStage(name="planner", role="Planner", instructions="Use routing result.", mode="fuzzy"),
],
fast_nucleus=fast,
deep_nucleus=deep,
substrate=BiTemporalMemory(),
components=[TelemetryProbe()],
)
print(organism.run("Refund missing").final_output)from operon_ai.adapters import ExternalTopology, analyze_external_topology, langgraph_functor
from operon_ai.convergence.langgraph_compiler import run_organism_langgraphSeven focused papers and the updated archival monograph live in article/:
- Monograph (
article/monograph.pdf): Biological Motifs for Agentic Control — functorial interface theory, correlated-error CFFL bounds, bi-temporal epistemic topology, equational diagram rewriting, and empirical boundary conditions. - Paper 7 (
article/paper7/main.pdf): Categorical Semantics of Ingressing Patterns — dedicated category-theoretic formalization of Levin (2026) (Ingressing Minds). - Papers 1–6 (
article/README.md): Epistemic topology, cross-framework convergence, meta-level generalization negative results, 10M+ trial structural-guarantee benchmarks (arXiv:2605.15225), categorical harness compilation (arXiv:2605.12239), and reflective evolution variance analysis. - Core 12 Canonical Examples (plus full historical example archive).
- Public Documentation: banu.be/operon (
docs/site/).
MIT