--- id: pydantic-graph version: "2.29.0" license: MIT license_treatment: permissive maintenance: active --- # pydantic-graph — Graph and state machine library License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install pydantic-graph uv add pydantic-graph poetry add pydantic-graph ## Description # Pydantic Graph [![CI](https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml?query=branch%3Amain) [![Coverage](https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic-ai.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/pydantic/pydantic-ai) [![PyPI](https://img.shields.io/pypi/v/pydantic-graph.svg)](https://pypi.python.org/pypi/pydantic-graph) [![python versions](https://img.shields.io/pypi/pyversions/pydantic-graph.svg)](https://github.com/pydantic/pydantic-ai) [![license](https://img.shields.io/github/license/pydantic/pydantic-ai.svg)](https://github.com/pydantic/pydantic-ai/blob/main/LICENSE) Graph and finite state machine library. This library is developed as part of [Pydantic AI](https://ai.pydantic.dev), however it has no dependency on `pydantic-ai` or related packages and can be considered as a pure graph-based state machine library. You may find it useful whether or not you're using Pydantic AI or even building with GenAI. As with Pydantic AI, this library prioritizes type safety and use of common Python syntax over esoteric, domain-specific... ## AI interpretation — verify before relying A type-safe graph and finite state machine library that lets you define stateful workflows using standard Python syntax, with edges inferred from return type hints. Verdict: Production-ready, actively maintained library from the Pydantic team with no known vulnerabilities. MIT licensing and low install friction make it accessible. Best suited for developers building type-safe, async-first state machines or workflow graphs where return-type-driven edge definition aligns with their design. [View on SkillFed](https://skillfed.io/packages/pydantic-graph) · [View on PyPI](https://pypi.org/project/pydantic-graph/)