oh-my-dag

A DAG execution engine, persistent decision maps, and self-consolidating memory for your coding agent — over MCP.

Your agent stays the brain. omd brings the cheap concurrent hands.

MCP server: 30 tools Clients: Claude Code · Codex · any MCP Models: bring your own Runtime: Bun ≥ 1.3 License: MIT

English · 中文 · Get started →

flowchart TB
  TASK(["TASK"])

  subgraph PLAN["1 · PLAN — one LLM call, everything after it is a pure function"]
    direction TB
    CD["Conductor<br/>gpt-5.6-sol · frozen prefix + task"]
    PJ["Plan JSON<br/>zod-validated · unknown card rejects the plan"]
    P1["prune<br/>cut nodes nothing consumes"]
    P2["dedup<br/>merge by semantic key"]
    P3["evidence<br/>UI pixel-chain gate"]
    P4["stamp<br/>pin a model: pick pool, then 3 rules"]
    CD --> PJ --> P1 --> P2 --> P3 --> P4
  end

  subgraph EXEC["2 · EXECUTE — dependency-driven, no level barrier"]
    direction TB
    RS{{"Ready-set scheduler<br/>a node waits only for its own deps"}}
    L1["inproc leaf<br/>one shot, no tools"]
    L2["agent leaf<br/>tools + bwrap jail<br/>the only kind that writes files"]
    L3["command<br/>zero LLM · allowlisted CLI"]
    L4["map · primitive<br/>runtime fan-out / engine-owned control flow"]
    UI["UI evidence branch<br/>render command prints image paths<br/>then attach_media leaf judges real pixels"]
    RS --> L1 & L2 & L3 & L4
    L2 -.-> UI
    L3 -.-> UI
  end

  subgraph FB["3 · FEEDBACK — objective gate first, model judgement second"]
    direction TB
    FI["Fan-in<br/>summaries, never transcripts"]
    OG["Oracle gate<br/>tsc + test · zero LLM, cannot hallucinate"]
    VF["Verifier<br/>glm-5.2 · cross-family · fails on doubt"]
    HL["Heal<br/>a red gate becomes a repair task"]
    ES["Escalation<br/>emits a node PATCH; untouched nodes stay byte-identical"]
    FI --> OG --> VF
    OG -->|red| HL
    VF -->|rejected| ES
  end

  CP[("Checkpoint<br/>.omd/continuity/runId")]

  TASK --> CD
  P4 --> RS
  L1 & L2 & L3 & L4 --> FI
  UI --> FI
  L1 & L2 & L3 & L4 -.->|every done node lands atomically| CP
  CP -.->|resume: same input hash = green, re-run only the rest| RS
  HL --> RS
  ES --> CD

  classDef llm fill:#EEEDFE,stroke:#534AB7,color:#26215C
  classDef pure fill:#E1F5EE,stroke:#0F6E56,color:#04342C
  classDef exec fill:#FAECE7,stroke:#993C1D,color:#4A1B0C
  classDef infra fill:#F1EFE8,stroke:#5F5E5A,color:#2C2C2A
  class CD,PJ,VF,ES llm
  class P1,P2,P3,P4,OG,L3 pure
  class L1,L2,HL,UI exec
  class TASK,RS,L4,FI,CP infra

Purple = an LLM call · teal = deterministic, zero LLM · coral = executor · grey = engine structure. Source of truth, with rationale and changelog: docs/diagrams/01-engine-flow.md.

What it is

Your coding agent is a strong, expensive brain. Using it to type out every file and run every test is the wrong job for the smartest thing in the room.

omd turns one task into a graph of small jobs, runs them concurrently on cheap models you bring, checks the result with an objective gate and a skeptic from a different model family, and spends a frontier model only where judgement actually happens. It mounts into any client as omd mcp — a stdio MCP server, 30 tools.

Three capabilities on one engine:

  • DAG execution — a task becomes typed nodes: agent leaves that really write files, command leaves that run tsc/tests with zero LLM, map nodes that fan out at runtime, primitive nodes for control flow. Nodes run the moment their deps settle; every node is checkpointed, so an interrupted run resumes instead of restarting.
  • Pathfinder — planning for work too big for one session: a decision map in git, advanced by typed tickets, with background research that outlives your client and a delivery gate only you fire.
  • Self-consolidating memory — a per-project fact store with hybrid semantic + lexical recall and a temporal knowledge graph, folding raw session events into layered facts.

Quick start

git clone https://github.com/AbyssCN/oh-my-dag.git && cd oh-my-dag
bun install && bun link      # puts `omd` on your PATH (Bun ≥ 1.3)
omd init                     # wizard: keys, model presets, reachability probe → .env
cd <your-project> && claude mcp add omd -- omd mcp

The slash-command pack (/omd-path, /omd-review, … 20 skills) installs itself into ~/.claude/skills/ on first server start — idempotent, never overwrites a skill you edited. Opt out with OMD_INSTALL_SKILLS=0.

Full walkthrough · command reference

bun run omd (interactive) or bun run omd -p "..." (one-shot); configure with OMD_RUNTIME_PROVIDER + OMD_RUNTIME_MODEL + your backend key in .env (copy .env.example). The MCP server is the primary door; this is a convenience.

The engine in one screen

A task is planned once by an LLM, then transformed by pure functions, then executed by dependency order. Everything after the conductor is deterministic.

Node kinds — what a node can be:

Kind Model? Tools? Use for
leaf one shot no generation, research, judgement, drafting
agent yes read/edit/write/bash, in a bwrap jail the only kind that writes files
command none a CLI from an allowlist gates (tsc/tests), scanners, indexed lookups
map mixed runtime fan-out: a lister discovers the work-list, one child per item
primitive mixed 12 control-flow shapes the engine owns

Plan passes — pure functions between the plan and execution: prune (drop dead nodes) → dedup (semantic-key merge) → evidence (UI pixel-chain gate) → stamp (pin a model on every node).

Control-flow primitives — you pick the shape and its params; the loop / branch / stop / scoring logic belongs to the runtime, never to the model: parallel · pipeline · loop-until · verify · judge · discovery · iterate · tournament · router · race · escalation · saga.

→ Details: architecture · primitives · model layer · MCP tools · memory

Why it's worth wiring in

Cheap concurrency Width, not a bigger model. A dozen small-model leaves run in parallel for the price of one frontier call.
Frontier judges, fleet executes You pay for quality at the decision points and the verify step — not on every node.
Never loses state Every node's output is hashed to a checkpoint. A 429, a crash, a closed laptop — the graph resumes at the first unfinished node.
Memory across sessions Decisions and gotchas survive the context window; recall is one call away.
Any client, any model MCP in, OpenAI-compatible backends out. No vendor lock.

Design rules

  • Contracts over prose. Every seam is a typed schema; a plan that fails validation never runs.
  • The model is not the reliability layer. Gates, verifiers and deterministic passes live outside the model — a stronger model makes them cheaper, not redundant.
  • Fail closed at the edges, fail open in the bookkeeping. Unknown template name rejects the plan; a checkpoint that cannot be written only warns.
  • No silent success. A file-producing node with no file on disk is a failure, not a claim taken on trust.

License

MIT — see LICENSE.