Advanced Research Prototype

Nano Agent Graph Engine
Agent graphs inside Claude and OpenCode.

Run an agent fleet on your laptop, with one plugin.

(Get an agent to) write a flow in TypeScript. It fans out headless agents, runs real code, waits for you or a timer, and keeps going after the chat ends. Every flow compiles to a BPMN diagram that you can watch run.

/plugin marketplace add nanobpm/nano-agent-graph-engine

/plugin install nano-agent-graph-engine@nanobpm

Brings the MCP server, skills, hooks, and the /flows pane.

Also works with Codex (nage install codex) and Cursor (nage install cursor): not yet tested by us. Needs Node 22.15 or newer.

See a flow ↓ Open the browser demo →

Reasoning is an LLM concern. Durability isn't.

A primary agent orchestrating subagents is a good pattern: reasoning about what to run next is exactly what an LLM is for. But holding the plan and the run state in context is not. That's durable state living in the most volatile, most expensive place you have: one compaction and the plan is gone; close the chat and the run dies, the tokens re-spent. And every token spent bookkeeping what's done, what's blocked, what's next is a token not spent on the code. Nano Agent Graph Engine takes the orchestration out of context and into a durable engine on your machine. The agent designs the graph; the engine runs it.

Orchestrate scripts, agents, people, and time.

Loops, switches, branches and parallel steps, in plain TypeScript with defineFlow.

Scripts

w.run with Node code and sh(), in your project.

Headless agents

w.task runs a prompt on the agent CLI you bring: Claude Code, Copilot, Qwen Code, Kimi, OpenCode, nano-coder, or any ACP agent.

Your live session

Hand a step to the Claude or OpenCode session you're chatting in.

People

w.human asks you with a form, in the chat, the /flows pane or the explorer.

Time and events

w.timer and w.signal: wait an hour, or for a webhook.

See it in action

Review a branch

Reviews a branch before you merge it, adversarially. A script collects the changeset against main. Reviewers run in parallel, one per lens (correctness, contracts and callers, tests, duplicated logic), and each sees the whole changeset and reads the codebase around it, because the bugs that matter cross files. Code merges their findings and drops duplicates. Then, one per finding, a challenger on a different CLI tries to refute it; only findings that survive go on. A fix agent fixes them and the loop reviews again, until the review comes back clean. When the fix agent can't decide on its own, it escalates to you, and your answer goes back into the loop.

Adversarial review: reviewers by lens, a challenger per finding, a fix agent that fixes or asks you.
import { defineAgents, defineFlow, defineForms, sh } from "@nanobpm/nano-agent-graph-engine";

// The challenger argues the other side, so suggest a different CLI for it.
export const agents = defineAgents({ challenge: { use: "opencode" } });

export const forms = defineForms({
  escalation: {
    title: "The fix agent needs you",
    description: "{{question}}",
    fields: {
      decision: { type: "string", enum: ["fix", "ship"] },
      guidance: { type: "string", title: "Guidance for the fix agent" },
    },
    required: ["decision"],
  },
});

export const review = defineFlow("review", (w) => {
  w.loop((b) => {
    // A script step: real code, in your repo. Every reviewer gets the whole
    // changeset, and reads the rest of the codebase around it.
    b.run("changeset", async () => {
      const files = (await sh("git diff --name-only main")).stdout.split("\n").filter(Boolean);
      return { files, lenses: ["correctness", "contracts and callers", "tests", "duplicated logic"] };
    });

    // Fan out by what to look for, not by file: one reviewer per lens, in parallel.
    b.forEach("lenses", "lens", (l) => {
      l.task("review-lens", { jobType: "senior:review", prompt: { resourceId: "review.md" } });
    }, { name: "Review by lens", outputCollection: "reviews", outputElement: "found" });

    // Code, not an agent: merge every lens's findings and drop duplicates.
    b.run("triage", (job) => {
      const reviews = (job.variables.reviews ?? []) as string[][];
      return { findings: [...new Set(reviews.flat())] };
    });

    // Then fan out per finding: an adversarial challenger, on a different CLI,
    // tries to refute each one against the codebase.
    b.forEach("findings", "finding", (f) => {
      f.task("challenge", { jobType: "senior:challenge", prompt: { resourceId: "challenge.md" } });
    }, { name: "Challenge each finding", outputCollection: "verdicts", outputElement: "verdict" });

    // The fix agent fixes what survived. It reports "clean" (nothing to fix),
    // "fixed" (review again) or "stuck" (it needs a decision from you).
    b.task("fix", { jobType: "senior:fix", prompt: { resourceId: "fix.md" } });
    b.switch("fixState", {
      clean: (c) => c.break(),
      fixed: (c) => c.continue(),
      default: (c) => {
        // Escalate: wait for you, an hour or over the weekend. The run survives.
        c.human("escalate", { form: "escalation" });
        c.switch("decision", { ship: (d) => d.break(), default: (d) => d.continue() });
      },
    });
  });
});

Ask your agent to write one: it reads the flow guide, then saves, checks and deploys the flow in one step. Or start one from the /flows pane.

Right where you work.

No new app to learn. The engine shows up inside Claude Code, Claude Desktop and OpenCode.

  1. 1
    A band above the prompt. ⚙ Agent Graph · 2 flows running · 1 task waiting for you, while anything is going on.
  2. 2
    The /flows pane. Answer forms, start flows, retry or cancel runs, or ask Claude to fix an incident, without leaving the session.
  3. 3
    The explorer. Live diagrams with token counts, variables, jobs and a step-by-step trace: in your browser, or inline in Claude Desktop's chat.
  4. 4
    It wakes the agent. When a flow hands work to your session, the agent picks it up. When a flow needs you, you get a notification.

Durable by default

State is an event log on disk. Close the chat, restart the laptop: runs resume where they left off, and jobs that were mid-run are handed back out.

Tested by killing the engine mid-flow.

A fleet on your laptop

Fan out with w.parallel and w.forEach. Each agent step is its own durable subagent, with its own context, tools and cost line. The engine joins the branches.

Retry one branch without losing the others.

One engine, every project

One engine per user. Each project keeps its flows in flows/; a global library is offered everywhere. Nothing is written into your repos.

See work waiting in every project, in one place.

Bring your own agents. Mix frontier with local.

A flow names a rank and a task, never a CLI. You choose which agent CLI and model serve each step, so the expensive steps can go to a frontier model and the rest stay local and free.

@nanobpm/nano-coder

Your fleet's workers, at ~4MB each.

Bring your own agent CLI. Agent steps run on the CLI you already use: Claude Code, Copilot, Qwen Code, Kimi, OpenCode, or anything else that speaks ACP. Choose one per flow, per step, or per run.

We run nano-coder because it is optimised for size. It is a coding agent written in D, built to be the worker your graphs fan out. Node-based agent CLIs take 150–660MB apiece; nano-coder takes ~4MB (peak footprint on macOS), so a laptop runs a fleet instead of a handful. Interactive in your terminal, or headless over ACP as a flow's agent step.

npm install -g @nanobpm/nano-coder

brew install nanobpm/tap/nano-coder

Meet nano-coder → · Why the worker's size matters →

Outgrown one machine?
Go distributed.

The plugin runs everything on one machine. The Nano server is the same engine, standalone: it orchestrates agents across many machines, and runs as a cluster when it has to stay up. Nano Workforce runs on it and adds PR review loops, time limits and escalations. The server speaks the Camunda 8 REST API, so Camunda's SDKs and tools work unchanged. It takes more setup than the plugin, so start here when one laptop isn't enough.

curl -fsSL https://nanobpm.io/install.sh | sh

Installs the CLI, hires your coding agents, and brings up a Nano engine, a workforce and the app. Prefer to do it by hand? Manual setup →

TypeScript Java Rust Python C# Go PHP D

How Nano compares.

The agent-tooling landscape spans desktop IDEs, terminal runtimes, and in-model scripting. Nano Agent Graph Engine puts a durable engine inside the agent you already use; Nano Workforce runs the same idea as a distributed fleet.

Capability Nano Agent Graph Engine Nano Workforce Orca Herdr Claude Dynamic Workflows
What it is Durable agent graphs in your agent Durable agent-workflow engine Desktop orchestrator IDE Terminal runtime for agents In-Claude subagent scripting
Orchestration lives in The durable graph The durable graph You, in the GUI You / agents via socket The JavaScript the model writes
Authoring surface TypeScript flows, drawn as BPMN Code-first & Model-first (BPMN) Manual, worktree GUI Interactive + socket API A script Claude writes
Survives crash / reboot Yes: Event log on disk; runs resume Yes: Journal-backed step resume Partial: Scrollback only Partial: Terminals reattach Partial: Resumes in the session
Human approval steps Yes: Forms in chat, pane or explorer Yes: First-class durable waits No Partial: Flags a blocked agent No
Agent harnesses Claude, OpenCode, any ACP agent Provider-agnostic Codex, Claude, OpenCode, Pi Claude, Codex, Cursor, Grok… Claude only
Frontier + local models Yes: Pick the CLI and model per step Yes: Mix both on one box Partial: Via the harness Partial: Via the harness No: Anthropic only
Headless / server / CI Partial: Local daemon; runs on after the chat Yes: Engine + Camunda 8 REST No: Desktop app Partial: Background server Partial: Inside Claude Code
Distributed fleet Partial: A fleet on one laptop Yes: Any mix of hardware, local to fleet Partial: One desktop (+ SSH box) Partial: One host, reattach over SSH No: Single machine
Footprint One plugin; no server to run Small — runs on a Raspberry Pi Electron desktop One Rust binary Claude Code
License Apache-2.0 Free to evaluate & personal use MIT Apache-2.0 Proprietary

Overlapping but distinct: Orca and Herdr host the interactive terminals your agents run in, and Nano can drive those same harnesses as durable workers. This grid maps each tool to the job it leads on. Sourced from each project's own docs; corrections welcome.

Videos

Coming soon