python · langgraph · human-in-the-loop

Agents that pause for humans, without losing state.

RelayG is a production triage agent rebuilt as a LangGraph state machine. An LLM classifies the ticket, pure Python applies refund policy, and interrupt() pauses the graph mid-node when a human needs to sign off. State survives the pause via a SQLite checkpointer.

typed graph state durable interrupts pytest covered
relayg · thread runner

Interactive simulation running the same policy rules in JavaScript. The real Python implementation with SQLite checkpointing is on GitHub.

classify policy_check act END
Select a ticket above to start a run. Refunds between $50 and $200 pause for approval, exactly like LangGraph's interrupt().
Graph paused · awaiting human input

Architecture

Four edges. One durable pause.

The whole graph is four edges. The interesting part is the interrupt inside act: the run is checkpointed to SQLite and resumed later with the human verdict injected.

ticket classifyLLM or mock policy_checkpure Python rules actmock tools END refund $50 to $200 interrupt()state checkpointed to SQLite human resumes with Command(resume=...)
Why LangGraph

Code-first, on purpose.

RelayG is a rebuild of Resolvd, the same triage agent originally built on n8n. The comparison is the point.

Typed state, checked at dev time

State flows through every node as a typed schema and is checked while you write the code, not discovered broken at runtime inside a workflow canvas.

Durable interrupts are the core model

interrupt() suspends mid-node, the checkpointer persists the run, and Command(resume=...) continues from the same checkpoint with the human verdict injected. In n8n you approximate this with webhooks, wait nodes, and state stuffed into a database by hand.

Plain Python you can unit test

The whole graph, including the interrupt and resume path, is covered by pytest. The honest tradeoff: you give up the visual editor and drag-and-drop integrations and take on code ownership.