Reactive marimo notebooks for ML with MLflow tracking, PINA physics-informed neural networks, and a multi-agent team on pydantic-graph + Ollama Cloud.
Project description
Marimo Flow ๐
Like marimo algae drifting in crystal waters, your data flows and evolves โ each cell a living sphere of computation, gently touching others, creating ripples of reactive change. In this digital ocean, data streams like currents, models grow like organic formations, and insights emerge naturally from the depths. Let your ML experiments flow freely, tracked and nurtured, as nature intended.
Why Marimo Flow is Powerful ๐
Marimo Flow combines reactive notebook development with AI-powered assistance and robust ML experiment tracking:
- ๐ค AI-First Development with MCP: Model Context Protocol (MCP) integration brings live documentation, code examples, and AI assistance directly into your notebooks - access up-to-date library docs for Marimo, Polars, Plotly, and more without leaving your workflow
- ๐ Reactive Execution: Marimo's dataflow graph ensures your notebooks are always consistent - change a parameter and watch your entire pipeline update automatically
- ๐ Seamless ML Pipeline: MLflow integration tracks every experiment, model, and metric without breaking your flow
- ๐ฏ Interactive Development: Real-time parameter tuning with instant feedback and beautiful visualizations
This combination eliminates the reproducibility issues of traditional notebooks while providing AI-enhanced, enterprise-grade experiment tracking.
Features โจ
๐ค AI-Powered Development (MCP)
- Model Context Protocol Integration: Live documentation and AI assistance in your notebooks
- Context7 Server: Access up-to-date docs for any Python library without leaving marimo
- Marimo MCP Server: Specialized assistance for marimo patterns and best practices
- Local LLM Support: Ollama integration for privacy-focused AI code completion
๐ ML Development Workflow
- ๐ Reactive Notebooks: Git-friendly
.pynotebooks with automatic dependency tracking - ๐ฌ MLflow Tracking: Complete ML lifecycle management with model registry
- ๐ฏ Interactive Development: Real-time parameter tuning with instant visual feedback
- ๐พ SQLite Backend: Lightweight, file-based storage for experiments
๐ง PINA โ composition-first (no hardcoded PDE factories)
compose_problem(ProblemSpec): agents emit typedEquationSpec+SubdomainSpec+ConditionSpecand the composer compiles apina.Problemsubclass at runtime (sympy.lambdify+pina.operator.grad/laplacian). NoProblemKindenum โ any PDE sympy can express is reachable.- Inverse problems:
UnknownParameterSpec+ data-fittingObservationSpecโ composer wires apina.LearnableParameterand routes a 3-arg residual. - Mesh geometry:
MeshSpec+meshio+MeshDomainbarycentric sampling (tri/tetra/quad/hex).SubdomainSpec.mesh_refpicks cell groups. - 3D visualisation:
core/viz3d.pyvia plotly (Mesh3d,Volume,Scatter3d,Isosurface) โ no 150 MB VTK stack. - Design optimisation:
OptimizationPlan+DesignVariableSpec+ConstraintSpecdriving Optuna TPE or scipy SLSQP with penalty / augmented-Lagrangian handling. - Stochastic + non-local:
NoiseSpec(white / colored / fbm) wraps the residual; fractional Laplacian via Riesz-kernel Monte-Carlo quadrature. - MPC:
marimo_flow.controlโ rolling-horizon scipy SLSQP on a trained PINN surrogate. - Walrus foundation model adapter for Poisson-class problems.
๐ณ Deployment
- Docker: docker-compose setup with CPU, CUDA, and XPU image variants
- ๐ MCP-Powered Docs: Live documentation via Context7 and Marimo MCP servers
Quick Start ๐โโ๏ธ
With Docker (Recommended)
# Clone repository
git clone https://github.com/synapticore-io/marimo-flow.git
cd marimo-flow
# Build and start services
docker compose -f docker/docker-compose.yaml up --build -d
# Access services
# Marimo: http://localhost:2718
# MLflow: http://localhost:5000
# View logs
docker compose -f docker/docker-compose.yaml logs -f
# Stop services
docker compose -f docker/docker-compose.yaml down
Docker Image Variants
| Variant | Image Tag | Use Case |
|---|---|---|
| CPU | ghcr.io/synapticore-io/marimo-flow:latest |
No GPU (lightweight) |
| CUDA | ghcr.io/synapticore-io/marimo-flow:cuda |
NVIDIA GPUs |
| XPU | ghcr.io/synapticore-io/marimo-flow:xpu |
Intel Arc/Data Center GPUs |
# NVIDIA GPU (requires nvidia-docker)
docker compose -f docker/docker-compose.cuda.yaml up -d
# Intel GPU (requires Intel GPU drivers)
docker compose -f docker/docker-compose.xpu.yaml up -d
Local Development
# Install dependencies
uv sync
# Start MLflow server (in background or separate terminal)
uv run mlflow server \
--host 0.0.0.0 \
--port 5000 \
--backend-store-uri sqlite:///data/mlflow/db/mlflow.db \
--default-artifact-root ./data/mlflow/artifacts \
--serve-artifacts
# Start Marimo (in another terminal)
uv run marimo edit examples/
Example Notebooks ๐
All notebooks live in examples/ and can be opened with uv run marimo edit examples/<file>.py.
01_pina_poisson_solver.pyโ Solve the Poisson equation with baseline PINNs or the Walrus foundation model. Training is tracked in MLflow with integrated Optuna sweep analytics and experiment history. Usesmarimo_flow.coredirectly.02_provenance_dashboard.pyโ Review surface over the DuckDB provenance store. Five tables (tasks, experiments, agent decisions, validation verdicts, handoffs) side-by-side plus 3D preset preview. Usesmarimo_flow.agents.services.ProvenanceStore.03_navier_stokes_3d_cavity.pyโ 3D lid-driven cavity composed end-to-end from a declarativeProblemSpec(no hardcoded NS factory). Sliders for viscosity, lid speed, collocation-point count, hidden width, epochs. Renders the spatial domain + mid-plane velocity slice with plotly. Uses the composition-firstservices/composer.py.04_mpc_heat_rod.pyโ Closed-loop MPC on a 1D heat-rod PINN surrogate. Trains a small surrogate via the composer, then drives a rolling-horizon scipy-SLSQP MPC loop frommarimo_flow.controltoward a user-set temperature setpoint.lab.pyโ PINA multi-agent team chat demo (see PINA Multi-Agent Team). Requires Ollama running locally.
Project Structure ๐
marimo-flow/
โโโ examples/ # Marimo notebooks
โ โโโ 01_pina_poisson_solver.py # Poisson PINN demo (uses core/)
โ โโโ 02_provenance_dashboard.py # DuckDB review + 3D preset preview
โ โโโ 03_navier_stokes_3d_cavity.py # 3D NS lid-driven cavity (composer)
โ โโโ 04_mpc_heat_rod.py # Closed-loop MPC via scipy SLSQP
โ โโโ lab.py # PINA team chat demo (uses agents/)
โโโ src/marimo_flow/ # Installable package
โ โโโ core/ # PINA solvers, training, plotly viz3d
โ โโโ control/ # Rolling-horizon MPC (scipy SLSQP)
โ โโโ agents/ # Multi-agent team (pydantic-graph + MLflow)
โ โโโ nodes/ # TriageNode, RouteNode, specialists, ValidationNode
โ โโโ schemas/ # TaskSpec / ProblemSpec / ObservationSpec /
โ โ # MeshSpec / OptimizationPlan / ControlPlan / โฆ
โ โโโ toolsets/ # FunctionToolset per role (incl. design, control)
โ โโโ services/ # composer, mesh_domain, design aggregator,
โ # provenance (DuckDB 13 tables), experiments
โโโ tests/ # Pytest suite (216 passing, 1 xfailed)
โโโ docs/ # Project documentation (see docs/INDEX.md)
โโโ docker/ # Dockerfiles + compose (CPU, CUDA, XPU)
โโโ data/mlflow/ # MLflow storage (artifacts, db)
โโโ pyproject.toml # Dependencies
Two Workflows
| Workflow | Import | Use Case |
|---|---|---|
Classic (core/) |
from marimo_flow.core import ... |
You know the PDE, pick a solver, log to MLflow. See examples/01_pina_poisson_solver.py. |
Agents (agents/) |
from marimo_flow.agents import lead_chat, FlowDeps |
Describe the problem in natural language; a multi-agent team composes Problem + Model + Solver. See examples/lab.py. |
Both write to the same MLflow backend (data/mlflow/). The two packages do not depend on each other โ pick whichever matches the task.
The marimo_flow.core Package
from marimo_flow.core import (
ProblemManager, # Define PDE problems and domains
SolverManager, # Configure PINN / SAPINN solvers
FoundationModelAdapter, # Walrus foundation model adapter
create_model_for_problem, # Build a PINA neural-network model for a Problem
train_solver, # Run training via PINA's Trainer
build_optuna_history_figure,
build_optuna_param_importance_figure,
build_optuna_parallel_figure,
build_trials_scatter_chart,
study_trials_dataframe,
)
MCP (Model Context Protocol) Integration ๐
marimo and AI-assisted IDEs share MCP servers for live documentation and notebook operations. For the full configuration reference see docs/mcp-setup.md.
marimo (in-notebook AI)
Pre-configured in .marimo.toml:
[mcp]
presets = ["marimo", "context7"]
[mcp.mcpServers.mlflow]
command = "mlflow"
args = ["mcp", "run"]
[mcp.mcpServers.mlflow.env]
MLFLOW_TRACKING_URI = "http://localhost:5000"
[ai.ollama]
model = "gpt-oss:20b-cloud"
base_url = "http://localhost:11434/v1"
The Docker container uses a separate docker/.marimo.toml without MCP presets โ containerized sessions run only the notebook UI; MCP servers run on the host and are reached over host.docker.internal.
VS Code / Claude Code
Four MCP servers configured in .vscode/mcp.json:
| Server | Purpose |
|---|---|
| marimo | Notebook inspection, linting (HTTP on port 2718) |
| mlflow | Trace search, feedback, evaluation (stdio via mlflow mcp run) |
| context7 | Live library documentation (stdio via npx) |
| serena | Semantic code search (stdio via uvx) |
Start the marimo MCP server (required for the marimo tool):
uv tool install "marimo[lsp,recommended,sql,mcp]>=0.18.0"
marimo edit --mcp --no-token --port 2718 --headless
Claude Code skills & hooks
Three domain skills in .claude/Skills/ (marimo, mlflow, pina) provide expert guidance and pre-resolved context7 library IDs (/marimo-team/marimo, /mlflow/mlflow, /mathlab/pina).
Automated cross-platform hooks in .claude/settings.json:
| Hook | Trigger | Action |
|---|---|---|
| PostToolUse | Edit/Write .py files |
Auto-format with ruff |
| PreToolUse | Edit uv.lock |
Block (protection) |
Configuration โ๏ธ
Environment Variables
Docker setup (configured in docker/docker-compose.yaml):
MLFLOW_BACKEND_STORE_URI:sqlite:////app/data/mlflow/db/mlflow.dbMLFLOW_DEFAULT_ARTIFACT_ROOT:/app/data/mlflow/artifactsMLFLOW_HOST:0.0.0.0(allows external access)MLFLOW_PORT:5000OLLAMA_BASE_URL:http://host.docker.internal:11434(requires Ollama on host)
Local development:
MLFLOW_TRACKING_URI: defaults tosqlite:///data/mlflow/db/mlflow.db(lead agent auto-createsdata/mlflow/{db,artifacts}/and pins the marimo-flow experiment's artifact root). Set tohttp://localhost:5000if you run a separate MLflow server.
Docker Services
The Docker container runs both services via docker/start.sh:
- Marimo: Port 2718 - Interactive notebook environment
- MLflow: Port 5000 - Experiment tracking UI
GPU Support: Use docker-compose.cuda.yaml for NVIDIA GPUs or docker-compose.xpu.yaml for Intel GPUs. The default docker-compose.yaml is CPU-only.
PINA Multi-Agent Team (marimo_flow.agents) ๐งโ๐๐งโ๐๐งโ๐
Reactive multi-agent team that orchestrates PINA workflows via pydantic-graph,
backed by MLflow for tracing + persistence, exposed via marimo's chat UI and
optionally as A2A and AG-UI ASGI servers.
from marimo_flow.agents import lead_chat, FlowDeps
import marimo as mo
deps = FlowDeps() # uses sqlite:///data/mlflow/db/mlflow.db by default
chat = mo.ui.chat(lead_chat(deps=deps))
chat
Roles (each loads its .claude/Skills/<name>/SKILL.md as instructions=
where applicable):
triageโ parses free-form user intent into a typedTaskSpec(start node)notebookโ marimo MCP cell ops (skills:marimo,marimo-pair)problemโ defines a PINA Problem from an open spec (skill:pina-problem)modelโ designs a neural architecture for the problem (skill:pina-model)solverโ wires Solver + Trainer config (skill:pina-solver)trainingโ runspina.Trainer.fit()via the training toolset (skill:pina-training)validationโ grades the run againsttask_spec.constraintsand records aValidationReportwith anaccept/retry/escalate/rejectverdictmlflowโ MLflow MCP tracking + registry (skill:mlflow)leadโ chat/A2A/AG-UI front-end; wraps the whole graph as one tool
TriageNode runs first and produces the TaskSpec. RouteNode then dispatches
between specialists, emits a HandoffRecord on every dispatch, and short-circuits
to End when the validation verdict is escalate / reject (SPEC ยง13 HITL).
Typed specs + provenance (SPEC ยง8, ยง12):
Every graph run builds typed ProblemSpec / ModelSpec / SolverPlan /
RunConfig on FlowState and mirrors them โ plus AgentDecision,
HandoffRecord, ValidationReport, ExperimentRecord, ArtifactRef,
and lineage edges โ into a DuckDB provenance store
(./provenance.duckdb by default, or MARIMO_FLOW_PROVENANCE_DB).
MLflow still owns the binary artifacts; DuckDB owns the queryable index.
DuckDB 1.5.2 ships transitively via marimo[sql].
from marimo_flow.agents.services import ProvenanceStore
store = ProvenanceStore("provenance.duckdb")
print(store.query("SELECT title, verdict FROM tasks t "
"LEFT JOIN validation_reports v USING (task_id) "
"ORDER BY t.created_at DESC LIMIT 10"))
See examples/02_provenance_dashboard.py for a marimo review surface.
Models: provider-prefixed specs ("<provider>:<model>") resolved through
pydantic-ai's infer_model. Defaults in
marimo_flow.agents.deps.DEFAULT_MODELS all point at Ollama Cloud
(http://localhost:11434/v1, :cloud-suffixed tags).
Override per role either via config.yaml at the repo root
(see config.yaml.example) or with MARIMO_FLOW_MODEL_<ROLE>=<spec>
env vars. Any provider in the pydantic-ai catalogue works โ openai,
anthropic, groq, mistral, google-gla, bedrock, together, fireworks,
openrouter, deepseek, cerebras, xai, ollama, huggingface, ...
Standalone servers:
uv run python -m marimo_flow.agents.server.a2a # A2A on :8000
uv run python -m marimo_flow.agents.server.ag_ui # AG-UI on :8001
See examples/lab.py for the full demo notebook.
Contributing ๐ค
We welcome contributions! Please see our Contributing Guidelines for details on:
- Development setup and workflow
- Code standards and style guide
- Testing requirements
- Pull request process
Quick Start for Contributors:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes following the coding standards
- Test your changes:
uv run pytest - Submit a pull request
See CONTRIBUTING.md for comprehensive guidelines.
Changelog ๐
See CHANGELOG.md for a detailed version history and release notes.
Current Version: 0.3.1
License ๐
This project is licensed under the MIT License - see the LICENSE file for details.
Built with โค๏ธ using Marimo and MLflow
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file marimo_flow-0.3.1.tar.gz.
File metadata
- Download URL: marimo_flow-0.3.1.tar.gz
- Upload date:
- Size: 104.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cfe79df38189bc8e23f39d14769faa8333eefdf7f9b2ee6727d5303421b7d8f
|
|
| MD5 |
91c22b4f055018bb5fef6cf8430d5484
|
|
| BLAKE2b-256 |
8c4154e371d44d4bd328ac5ca5ffa1c63c6581e715b3e2e3491d61d232a9bcaa
|
Provenance
The following attestation bundles were made for marimo_flow-0.3.1.tar.gz:
Publisher:
python-publish.yml on synapticore-io/marimo-flow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
marimo_flow-0.3.1.tar.gz -
Subject digest:
2cfe79df38189bc8e23f39d14769faa8333eefdf7f9b2ee6727d5303421b7d8f - Sigstore transparency entry: 1397337331
- Sigstore integration time:
-
Permalink:
synapticore-io/marimo-flow@cfa396847d698e0ddb35f49cc91d3851c483ace8 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/synapticore-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cfa396847d698e0ddb35f49cc91d3851c483ace8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file marimo_flow-0.3.1-py3-none-any.whl.
File metadata
- Download URL: marimo_flow-0.3.1-py3-none-any.whl
- Upload date:
- Size: 125.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b5a4dc6f3a932b389f8c7775a3fece3900d153f22780862152c5b311bc3cd8
|
|
| MD5 |
5b1246a62b8a636294b86c4e03862564
|
|
| BLAKE2b-256 |
0613ea048c3296d6c4f2a7985566f45f3e3b22805c03b20742571381493a6877
|
Provenance
The following attestation bundles were made for marimo_flow-0.3.1-py3-none-any.whl:
Publisher:
python-publish.yml on synapticore-io/marimo-flow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
marimo_flow-0.3.1-py3-none-any.whl -
Subject digest:
55b5a4dc6f3a932b389f8c7775a3fece3900d153f22780862152c5b311bc3cd8 - Sigstore transparency entry: 1397337335
- Sigstore integration time:
-
Permalink:
synapticore-io/marimo-flow@cfa396847d698e0ddb35f49cc91d3851c483ace8 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/synapticore-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@cfa396847d698e0ddb35f49cc91d3851c483ace8 -
Trigger Event:
push
-
Statement type: