langgraph-ts-agents
Strictly typed TypeScript port of LangGraph supervisor/worker patterns — streaming-first, Zod-validated, with a human-in-the-loop approval gate.
langgraph-ts-agents is an open-source TypeScript project I built that ports the supervisor + workers + human-in-the-loop pattern from Python LangGraph to LangGraph.js: github.com/AleSZanello/langgraph-ts-agents.
The problem
I built it because most LangGraph.js examples are weakly typed, single-agent chatbots. This repo shows a real Multi-Agent Systems graph in strict TypeScript, with a side-by-side table mapping each Python concept to its TypeScript equivalent.
Architecture
- Supervisor/worker graph. A supervisor inspects state and routes to a researcher, an analyst or the writer; workers append their findings and hand control back. Routing uses
Command, and the supervisor's decision comes fromwithStructuredOutputwith a Zod enum instead of parsing free text. - Typed state.
Annotation.Rootwith a message reducer, the TypeScript counterpart of Python'sAnnotated[List, operator.add]. - Human-in-the-Loop gate. Before the writer runs, an approval node calls
interrupt(...); the run pauses until the caller resumes withtrue(approve),false(send it back to the supervisor) or a string (an edited draft that is passed to the writer). - Streaming-first. The default command runs
graph.stream()withstreamMode: "updates"and renders each node event in the terminal, where the original Python course used blockinginvoke(). - Checkpointing with
MemorySaver, swappable for the SQLite checkpointer. - Offline tests with Vitest and a fake chat model, so CI needs no API key. OpenAI or Anthropic Claude for real runs.
Origin
The pattern comes from the supervisor module of Multi-Agent Systems with LangGraph, part of my Agentic AI Engineering Specialization specialization; this repo is my deliberate translation of it to TypeScript.
Status
Live, 2026, MIT licensed.
Related
- LangGraph · LangChain · TypeScript · Node.js
- Multi-Agent Systems · Agent Orchestration · Human-in-the-Loop
- langgraph-langserve-starter · local-rag-chatbot — sibling labs in Python
- Akashi — the same multi-agent and HITL ideas, built from scratch in Dart
- Ale Zanello