Graph Workflows
Build stateful workflows as graphs — conditional routing, fan-out/fan-in, checkpointing, and resumable pipelines.
📄️ Graph Workflows — SynapseKit Python LLM Framework
Define async LLM pipelines as directed graphs in Python. Parallel execution, conditional routing, cycles, and checkpointing. LangGraph alternative.
📄️ StateGraph
StateGraph is the fluent builder used to define your graph before compiling it.
📄️ Nodes
A node is any callable that takes the current graph state and returns a partial state to be merged in.
📄️ Edges
Edges connect nodes and determine the execution order.
📄️ CompiledGraph
CompiledGraph is the runnable object returned by StateGraph.compile(). It exposes three execution modes and a Mermaid diagram helper.
📄️ Cycles
By default, StateGraph.compile() raises GraphConfigError if it detects a cycle in static edges. This protects against accidental infinite loops.
📄️ Checkpointing
Checkpointing lets you persist graph state after each execution wave. This enables resuming interrupted runs and inspecting intermediate state.
📄️ Mermaid Export
CompiledGraph.get_mermaid() returns a Mermaid flowchart string for your graph. Use it to visualize pipelines in Markdown, Notion, GitHub, or Jupyter.