Six small graphs that earn their keep at a real seam: fan-out over unknown files, one extraction per item, a human signature, a pause that survives a restart. JSON specs, DSH tools, and a ledger — no arbitrary JavaScript.
1212 objectsreadylg_…_w0xwRecorded from the actual DSH Web app: a 12-topic brief, two 12-item maps, a human gate, and a 12-row output. The video is the transcript and the panel, not an illustration.
The graph reads 12 files, extracts one JSON object per file, drafts the outline, and pauses. The human approves the outline; the same thread resumes and writes the brief.
Each card is a real GraphSpec. Copy the prompt, open the JSON, or compose it from the file. The graph is the contract; the model fills the roles.
The model reads a guide for method and a law for rules. The compiler is deterministic: JSON in, StateGraph out. No model translates the IR.
What must still be true after a seam: files, extracts, outline, decision. Typed fields and reducers decide how many writers may settle them.
One tool call, one judgment, or an open agent brief. Open-ended work stays in prose, not in a constellation of tiny nodes.
The run returns interrupted with a thread. The human answer is raw; the graph resumes from the same checkpoint.
Fan out over a list you did not know until runtime; the join settles the ledger. Append follows input order, not completion order.
// the seam, not the ceremony "nodes": [ { "do": "tool", "tool": "glob", "out": { "files": "lines" } }, { "do": "map", "over": "files", "body": { "do": "tool", "tool": "read", "args": { "file_path": { "$state": "item" } } } }, { "do": "map", "over": "contents", // extract per item "body": { "do": "model", "schema": { "type": "object" } } }, { "do": "gate", "question": "Approve this outline?", "out": { "decision": "text" } } // … compose, write ]
From a real 12-topic brief on the same DSH host. The ordinary loop is still the cheapest; a graph is for the seams that justify it.
Don't graph a two-step task. Use the loop for open-ended work; reach for a graph when the work has a real fan-out you cannot enumerate, a human signature, or a pause that must survive a restart. The gallery's research-brief is the honest middle: the ordinary loop still wins on tokens, but the graph makes the seam explicit and resumable.
No JS, no restart: the spec is data. Validate, compose, run; resume an interrupted thread with the raw answer.
langgraph_compose({ action: "validate", path: "gallery/specs/research-brief.lg.json" }) langgraph_compose({ action: "compose", path: "gallery/specs/research-brief.lg.json" }) langgraph_run({ graph: "lg_adhoc_…", input: { pattern: "topics/*.txt" } }) // the gate returns status: "interrupted"; ask, then resume the same thread langgraph_run({ graph: "lg_adhoc_…", thread: "lg_lg_adhoc_…", resume: "Approve" })
The model may compose a graph, but it cannot ship JavaScript. The spec is session-owned; the tools are the ones you already gave the agent.
No arbitrary model-written JS. The compiler is deterministic; the same spec makes the same graph. A published JSON Schema gives editors that same vocabulary.
Specs are immutable and owned by the session that composed them; another session cannot run or delete them.
A node must name a tool visible to the calling agent; args are checked against the tool's own schema at compose time.
Irreversible steps pause with a thread. The answer is raw; the resume is explicit, never a hidden side effect.