Agentic workflow
The Neat framework's public API is designed not just for human application authors, but for AI coding agents that write Modalix-targeted code on a developer's behalf. This page explains why several of the framework's design choices look the way they do — they're optimized for the agent reading the API surface, not just the human.
What an agent needs from a framework
An AI agent generating code against an unfamiliar API typically needs:
- A small public surface — fewer types means less to learn.
- Self-describing types — the type signature should encode the contract, not just hint at it.
- One way to do each thing — multiple equivalent paths are exactly the kind of choice an agent gets wrong.
- Adjacent docs — the agent reads
@briefblocks, not 8000-line design docs. Critical context must live next to the symbol. - Deterministic outputs — when an agent writes test snapshots, byte-for-byte determinism makes them stable.
- Errors that name root causes — when something fails, the error needs to say which kernel / contract / option is wrong, not "Graph build failed."
- Reproducer artifacts — if the agent's code fails, it can paste the
repro_gst_launchstring into a debugger and iterate without rerunning the agent. - No hidden globals — every behavior should be a constructor argument or a Node option, not an environment variable read at runtime.
- Stable identifiers — same Nodes + same options ⇒ same element names ⇒ same launch string ⇒ stable test fixtures.
- Model archives as data, not code — the model is a bundle the framework loads, not a header the agent has to compile against.
- Composable building blocks — Nodes, Models, and reusable Graph fragments snap together; the agent doesn't have to know which combinations the framework "supports" because the planner answers that at build time.
- Loud build-time validation — failures surface from
Graph::build(), not at the firstpull(). An agent's iteration loop needs the error pointed at the right line. - Structured
GraphReport— programmatic access to what the build did, so the agent can verify its own work. - Progressive disclosure —
Modelis the simple path,Graph::add()is the next, custom Nodes are the deep path. An agent hits the simple path first. - Versioned MPK contracts — a model archive carries enough metadata that an agent generating code against it doesn't need to consult external docs.
These show up across the framework as concrete design decisions:
- The small public surface (Model, Tensor, Sample, Node, Graph, and Run) is all an agent needs to learn for application code.
Graph::describe()returns a structured plan summary — agents can verify their own pipelines.NeatErrorcarrieserror_code()plus aGraphReport— agents can switch on the code.Node::backend_fragment()is deterministic — agents can write golden-string tests against pipelines.MpkContractis the only authoritative description of a model — agents generating wiring code against a model never need anything else.
How application authors benefit
Even if you're not an agent, you benefit from agent-friendly API design: the same properties that make automated code generation reliable also make manual code review easier, refactoring safer, and AI-assisted development (Claude Code, Copilot, Cursor) more productive on Modalix code.
Further reading
- "Introducing Neat" — §0.1 of the design deep dive.
Graph::describe()— programmatic plan summary.NeatError— structured error type.Model— loaded model archive and parsed MPK contract.