Skip to content

leventilo/mobius

Repository files navigation

Mobius

Drop a physics paper, get a Ciechanowski-grade interactive simulator with the paper's real physics under the hood, validated against its own figures.

Live demo · Demo video · Hackathon submission, Apr 28 2026 — links pending submission

License: MIT Stack Hackathon

What it does

Drag a PDF onto the drop zone. An Opus 4.7 orchestrator runs a DAG of nine specialist skills: parse the paper, infer its physics, compose a typed SimSpec, generate Python solver primitives, ship them to the Anthropic Managed Agents Python sandbox for isolated execution, then render a Ciechanowski-grade interactive HTML scene wired to those primitives. The user moves a slider; the real solver re-runs in the sandbox; the scene redraws with the new physics — not an animation, the actual solution. Every output is gated by a parallel science-integrity critic checking units, CFL stability, conservation, figure-diff, and claim-match against the source paper.

Why it's interesting

  • Multi-agent orchestrator. A single Opus 4.7 conductor (server/src/orchestrator.ts) drives nine specialist skills as a DAG, not a chat loop. Phases A-G are explicit and re-runnable.
  • Physics lives in scripts, not prompts. Each primitive is a deterministic Python solver (Verlet, FDTD, FFT, Crank-Nicolson, ...) generated under contract and executed byte-for-byte. The LLM picks the regime; numpy does the math.
  • Parallel science-integrity critic. Eight orthogonal checks (skill) — five pre-render (pint units, CFL bound, conservation residual, claim-match, eligibility) plus three post-render (perceptual figure-diff via Opus 4.7 vision, narration-bijection, multimodal triangulation) — block or warn upstream generators. Inspired by JutulGPT's "interpret-act-validate" loop (arXiv:2603.00214), but with an external arbiter, not the simulator itself.
  • Ciechanowski-grade rendering. Nine scene archetypes (templates) — 2D fields, ray optics, 3D orbitals, lattices, particle clouds, glass dispersion, time graphs, schematics, explainer. Palette c0-c5, Geist + IBM Plex Sans + Inter, flat-Lambert 3D (no PBR), KaTeX, quintic smoothstep, 1.5 px strokes — anchored on ciechanow.ski.
  • Managed Agents sandbox. Python 3.12 / 8 GB / numpy + scipy + matplotlib + sympy, isolated per run (managed-agents-2026-04-01 beta). Pyodide fallback for fork-friendly local dev without an API key.
  • Open source. MIT, single repo. Run locally with an Anthropic API key (make live-young / make live-lorenz / make live-tunneling).

Try it (3 hero papers)

Paper Physics arXiv
Luo et al. 2024, Single-photon Young's double-slit Wave-optics interference arXiv:2401.02351
Lorenz 1963, Deterministic Nonperiodic Flow Strange attractor / chaos JAS 20:130
Goldberg-Schey-Schwartz 1967 + Ko et al. 2024, Schrödinger tunneling Quantum wave-packet arXiv:2410.10060

Architecture

A single Opus 4.7 conductor drives nine specialist skills as an explicit DAG over seven phases. Three parsers fan out in parallel, fan into a typed SimSpec, then fan back out into generation, sandboxed execution, rendering, and narration. The science-integrity critic runs in parallel — not after — gating both construction and post-render outputs.

flowchart LR
    PDF([📄 PDF])

    subgraph A["Phase A · parse (parallel)"]
        PP[paper-parser]
        PI[physics-interpreter]
        CE[claim-extractor]
    end

    subgraph BC["Phase B-C · author"]
        SA[simspec-author]
        TOPO{{topology<br/>router}}
    end

    subgraph D["Phase D · generate"]
        PG[primitive-generator]
    end

    subgraph E["Phase E · execute"]
        SBX[("Managed Agents<br/>Python sandbox<br/>numpy · scipy · sympy")]
    end

    subgraph FG["Phase F-G · render & narrate"]
        VM[viz-mapper]
        NAR[narration]
        PD[paper-diff]
    end

    SI{{"science-integrity<br/>parallel critic<br/>(5 pre + 3 post)"}}

    SCENE([🎬 scene.html])

    PDF --> PP & PI & CE
    PP --> SA
    PI --> SA
    CE --> SA
    SA --> TOPO --> PG --> SBX
    SBX --> VM
    SBX --> NAR
    VM --> PD
    VM --> SCENE
    NAR --> SCENE
    PD --> SCENE

    SA -.gate.-> SI
    PG -.gate.-> SI
    SBX -.gate.-> SI
    VM -.gate.-> SI
    SI -.block / warn.-> SA

    classDef parser fill:#efc540,stroke:#444,color:#222
    classDef author fill:#31c0b1,stroke:#444,color:#fff
    classDef render fill:#ef7f39,stroke:#444,color:#fff
    classDef sandbox fill:#256bb9,stroke:#444,color:#fff
    classDef critic fill:#a41247,stroke:#444,color:#fff

    class PP,PI,CE parser
    class SA,TOPO,PG author
    class VM,NAR,PD render
    class SBX sandbox
    class SI critic
Loading

When the user moves a slider in the rendered scene, the same sandbox re-runs the actual solver — not an animation, the real solution.

sequenceDiagram
    participant Browser as 🖥️ Browser
    participant Orch as Orchestrator (Opus 4.7)
    participant Sandbox as Managed Agents<br/>Python sandbox
    participant Critic as science-integrity

    Browser->>Orch: POST /api/slider {param, value} (SSE)
    Orch->>Orch: mutate SimSpec
    Orch->>Sandbox: re-exec primitive (numpy)
    Sandbox-->>Orch: frames.jsonl (new telemetry)
    Orch->>Critic: claim-match · conservation · CFL
    Critic-->>Orch: pass | warn | fail
    Orch-->>Browser: SSE scene_updated
    Browser->>Browser: redraw canvas
Loading

Files of interest

mobius/
  server/src/orchestrator.ts          DAG conductor (Opus 4.7, beta header skills-2025-10-02)
  server/src/managed_agent_client.ts  Python sandbox bridge (managed-agents-2026-04-01)
  server/src/topology.ts              SimSpec -> archetype router
  server/src/schema_validator.ts      simspec.schema.json gate
  skills/<name>/SKILL.md              x9 specialist skills (frontmatter + bundled scripts)
  skills/viz-mapper/templates/*.html  x9 scene archetypes
  runs/                               local-only — every full pipeline run lands here (gitignored)
  public/index.html                   drop-zone landing

Skills

Skill Role
paper-parser Ingest a physics PDF; extract equations (LaTeX + sympy), figures, and numerical claims using Opus 4.7 vision.
physics-interpreter Translate equations into a typed physics sub-tree: governing PDEs, BCs, ICs, regime, approximations.
claim-extractor Surface verifiable assertions so each can be tested against the simulator.
simspec-author Compose the canonical SimSpec JSON; validates against schema; logs ambiguities.
primitive-generator Emit deterministic Python solver code per primitive, indexed pattern library + LLM fallback.
science-integrity Parallel critic. Five bundled scripts: units, CFL, conservation, figure-diff, claim-match.
viz-mapper Compile SimSpec to a self-contained HTML scene via 8 archetype templates; wires sliders to primitives over SSE.
paper-diff User-facing side-by-side comparison: rendered scene vs source figures, VLM + deterministic metrics.
narration Time-aligned natural-language voiceover/captions, Ciechanowski editorial register.

Aesthetic principles

The design north star is Bartosz Ciechanowski's editorial work at ciechanow.ski. Concretely:

  • Palette c0-c5: #efc540 · #ef7f39 · #31c0b1 · #256bb9 · #da7ba3 · #a41247 on #f8f8f8 paper.
  • Type: Geist (landing) + IBM Plex Sans (scenes, body) + Inter (headings) + IBM Plex Mono (numerics), all self-hosted.
  • 3D: flat-Lambert shading by default, no PBR. MeshTransmissionMaterial reserved for the glass-dispersion archetype.
  • Math: KaTeX 0.16.45 inlined; never re-rendered per frame.
  • Motion: quintic smoothstep on transitions, 1.5 px strokes, paused-by-default playback.

Run it locally

pnpm install
uv sync                            # python dev tooling, optional
cp .env.example .env               # set ANTHROPIC_API_KEY
pnpm dev:server                    # backend on :5174
pnpm dev                           # frontend on :5173 (Vite)

Open http://localhost:5173 and drop a PDF onto the drop zone. With no API key, Mobius falls back to Pyodide for primitive execution; with ANTHROPIC_API_KEY set, it uses Managed Agents (managed-agents-2026-04-01) and Skills (skills-2025-10-02).

Stack

  • Model: Opus 4.7 (claude-opus-4-7), beta skills-2025-10-02 for skill bundling.
  • Compute: Anthropic Managed Agents (managed-agents-2026-04-01), Python 3.12 / 8 GB sandbox.
  • SDK: @anthropic-ai/sdk ^0.91.1.
  • Backend: TypeScript on Node 22, native fetch, SSE streaming.
  • Frontend: vanilla JS + ES module importmap (no bundler in scenes).
  • 3D: Three.js r0.184 + drei-vanilla MeshTransmissionMaterial (MIT, vendored at public/lib/) + postprocessing v6.39.
  • 2D: Pixi.js v8.18 for high-density particle scenes, Canvas 2D for annotations.
  • Math: KaTeX 0.16.45, GSAP 3.15 for editorial motion.
  • Tooling: Vite 8, biome 2.2, pnpm 9, uv (Python).

Acknowledgements

  • Bartosz Ciechanowski — design north star (ciechanow.ski). The aesthetic target.
  • InteractScience — used for retro-engineering and palette/typography calibration only (arXiv:2510.09724, Apache 2.0). Not claimed as a benchmark Mobius beats; the two systems solve different problems.
  • JutulGPT — vocabulary inspiration for the "interpret-act-validate" loop (arXiv:2603.00214, MIT). Mobius differs by treating the validator as an external parallel critic, not the simulator itself.
  • MiniMax-AI shader-dev — vendored as a GLSL technique reference (MIT).
  • Anthropic — Claude Opus 4.7, Managed Agents, Skills.

License

MIT. Copyright (c) 2026 David Hayot. See LICENSE.

About

Drop a physics paper, get a Ciechanowski-grade interactive simulator with the paper's real physics under the hood. Built with Claude Opus 4.7 + Managed Agents + Skills for the Cerebral Valley hackathon (Apr 2026).

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors