Tutorials¶
Hands-on lessons that take you from a single-node graph to a running
stargraph serve with replay, retrieval, classical ML, and human-in-the-loop
gates wired up. Every tutorial is self-contained: paste the code, run the
command, verify the output.
Learning path¶
Beginner — graph mechanics¶
- First graph — a two-node graph with a Pydantic
state model, routed by a single rule, executed via
stargraph runand inspected viastargraph inspect. - Add a Fathom rule pack — wire deterministic governance onto the first graph, see the routing rule fire in the audit log, validate the pack with the Fathom plugin tooling.
Intermediate — real nodes¶
- Agent with retrieval —
RetrievalNodefans out across a LanceDB vector store, fuses hits, and feeds aDSPyNodesummariser through the force-loud DSPy adapter. - Classical ML in a graph —
MLNoderunning an ONNX classifier inside an otherwise-LLM graph, with the sklearn safe-load gate explained.
Advanced — production wiring¶
- HITL graph —
InterruptNodepauses a run,stargraph respondresumes it, and the whole thing survives a cold-restart of the engine. - Serve and replay — boot the FastAPI app
with
stargraph serve, enqueue a run over HTTP, and replay it byte-identically withstargraph replay.
Prerequisites for every tutorial¶
- Python 3.13+
uv add stargraph(orpip install 'stargraph[stores,ml]'for the retrieval and ML lessons)- A scratch directory to hold per-run state under
./.stargraph/
Reference docs nearby
Each tutorial links into Concepts, Reference / nodes, and the Engine and Serve sections. Read them once you understand the mechanics; the tutorials cover only what each lesson needs.