← back to the directory
Library / SDK Agents & OrchestrationGuardrails & Structure

pydantic-graph

1Type-hinted 2graph 3library 4for 5agent 6workflows

the six Ws · specification

W1 Who

Maintained by the Pydantic team alongside the Pydantic AI project.

W2 What

pydantic-graph is a standalone async graph and state-machine library where nodes and edges are defined with plain Python type hints, usable with or without Pydantic AI.

W3 Where

Distributed as the pydantic-graph Python package, imported into any Python application.

W4 When

Released alongside Pydantic AI in 2024 and updated as part of the pydantic-ai monorepo through 2026.

W5 Why

It exists to give advanced users explicit, typed control flow for complex agent or workflow logic instead of implicit loops.

W6 With

Has no dependency on pydantic-ai itself, only on Python's typing and Pydantic core; agents built with it may call any LLM API.

W7 Watch

Open-source under MIT license, runs entirely locally as a pure Python library with no data sent anywhere by the library itself.

state-machinetype-hintsgraph-workflowpythonpydantic

for agents & scripts

Reading this as a machine? Query it directly.

Search is open JSON - no key. Report telemetry after using a tool and it feeds that tool’s Proof Score. Or speak MCP to /mcp and discover tools mid-loop.