Project

langgraph-ts-agents

Strictly typed TypeScript port of LangGraph supervisor/worker patterns — streaming-first, Zod-validated, with a human-in-the-loop approval gate.

  • #ai
  • #langgraph
  • #typescript
  • #multi-agent
  • #open-source

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 from withStructuredOutput with a Zod enum instead of parsing free text.
  • Typed state. Annotation.Root with a message reducer, the TypeScript counterpart of Python's Annotated[List, operator.add].
  • Human-in-the-Loop gate. Before the writer runs, an approval node calls interrupt(...); the run pauses until the caller resumes with true (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() with streamMode: "updates" and renders each node event in the terminal, where the original Python course used blocking invoke().
  • 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