What problem does it solve?
Migrating LangChain or LangGraph applications to Pydantic AI is risky because similar-looking APIs differ in semantics: message history formats, structured output transports, checkpointing, interrupts, streaming, and retry behavior rarely map one-to-one. This Skill guides a behavior-preserving migration so contracts are verified rather than assumed.
Core Features & Use Cases
- Contract-first migration workflow: Trace a representative request through prompts, tools, state, persistence, and streaming, then migrate the smallest behaviorally complete vertical slice behind the existing public boundary.
- Concept mapping and semantic-gap analysis: Reference guides map LangChain/LangGraph primitives (agents, LCEL, middleware, checkpointers, interrupts) to Pydantic AI equivalents and flag non-equivalent behaviors like
run_stream() versus run() or tool retry semantics.
- Verification and cutover discipline: Classify every observed contract as verified-equivalent, verified-adapter, intentional-change, or unverified, with parity tests, Logfire-based trace comparison, and safe shadow/canary cutover steps.
- Use Case: Given a LangGraph agent with a checkpointer and human-in-the-loop approval, use this Skill to split state into dependencies, message history, workflow state, and memory, then rebuild approval with deferred tools and prove resume semantics with crash-injection tests.
Quick Start
Ask the AI to use the migrating-langchain-to-pydantic-ai skill to migrate the LangChain agent in your repository to Pydantic AI while preserving its existing public contracts.