Migrating Deep Agents To Pydantic Ai Harness logo

Migrating Deep Agents To Pydantic Ai Harness

Organization
pydantic
migrating-deep-agents-to-pydantic-ai-harness

Migrate Python LangChain Deep Agents applications to Pydantic AI and Pydantic AI Harness. Use when the source uses the upstream `deepagents` package or demonstrably reproduces its middleware, backends, skills, memory, subagents, or sandbox contracts. Use `migrating-langchain-to-pydantic-ai` for plain LangChain, LangGraph, or LCEL migrations and `pydantic-ai-harness` for greenfield Harness usage.

Overview

Publisherpydantic
Repositorypydantic-ai-harness
Skill namemigrating-deep-agents-to-pydantic-ai-harness
Stars
954
Forks
150
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by pydantic on GitHub. Read the source before you install it.

Installation

Install the Migrating Deep Agents To Pydantic Ai Harness AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/pydantic/pydantic-ai-harness/tree/main/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pydantic/pydantic-ai-harness.git /tmp/pydantic-ai-harness
mkdir -p .claude/skills
cp -r /tmp/pydantic-ai-harness/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness .claude/skills/migrating-deep-agents-to-pydantic-ai-harness
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Migrating Deep Agents To Pydantic Ai Harness in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Migrating Deep Agents To Pydantic Ai Harness on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Migrating Deep Agents To Pydantic Ai Harness is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Migrate Deep Agents to Pydantic AI Harness

Preserve the application's observed contracts, not the shape of create_deep_agent. Compose Pydantic AI primitives and Harness capabilities; keep infrastructure with the application that already owns it.

Establish the source contract

  1. Resolve the deepagents import origin before applying these mappings. Route a local module or project-owned create_deep_agent to the ordinary LangChain migration only when its implementation has ordinary LangChain or LangGraph semantics; vendored implementations that reproduce Deep Agents contracts remain in scope. Read repository instructions, manifests, lockfiles, tests, runtime entrypoints, and the resolved source. Record exact Deep Agents, LangChain, LangGraph, Pydantic AI, and Harness versions. If the locked source is unavailable, reproduce its environment without changing the target lockfile. If that is not possible, mark affected behavior unverified and do not claim parity.
  2. Trace one representative request through prompt and model profile, tools and integrations, middleware and permissions, backend and execution, skills and memory, delegation, state, checkpoints and approvals, retries and limits, events, side effects, and the public boundary. Inspect every caller of that boundary.
  3. Run the cheapest deterministic baseline. Record evidence separately from the outcome: source-inspected, probe-observed, or regression-tested.
  4. Load only the mapping needed for the detected source features:
    • Core Migration for construction, models and profiles, prompts, tools and MCP, middleware, state, outputs, caching, or tracing.
    • Context and Execution for coding-agent defaults, planning, files, permissions, backends, sandboxes, interpreters, media, skills, memory, retrieval, or context limits.
    • Orchestration and Recovery for synchronous, dynamic, or background subagents; grading loops; approvals; checkpoints; fault tolerance; durable execution; or streaming.
    • Hosts and Protocols only when migrating Deep Agents Code, a frontend, ACP, A2A, or a deployment boundary.

Build the Pydantic AI target

  • Start with one reusable Agent. Pydantic AI owns the model/provider boundary, normalized messages, agent loop, typed dependencies and outputs, tools and toolsets, run APIs, usage limits, and generic hooks.
  • Put authenticated identity, service clients, and configuration in deps_type and RunContext; expose only model-chosen inputs through typed tools. Choose instructions versus system_prompt from the required history behavior, and consume result.output rather than leaking framework messages through the application boundary.
  • Add Harness capabilities one at a time for observed optional behavior. A capability composes instructions, toolsets, hooks, and model settings onto the agent; it does not replace application infrastructure or Pydantic AI runtime semantics.
  • Select run_sync, run, run_stream, run_stream_events, iter, deferred results, and message history from the caller's actual lifecycle. Preserve the old wire shape with a boundary adapter while callers migrate.
  • Before coding, inspect the locked pydantic_ai and pydantic_ai_harness public exports, docs, and source signatures for the selected provider, Agent, tools/toolsets, capabilities, run and deferred APIs, and persistence integration. Import capabilities from their owning public submodules, reject deprecation warnings, and run an import-and-construction smoke test in the exact target environment. Record the interpreter and resolved pydantic_ai and pydantic_ai_harness module paths with the result. Add only the required extras; do not pass LangChain objects through or copy remembered examples.
  • Keep queues, tenancy, artifact storage, remote sandbox lifecycle, durable domain state, deployment, and external side-effect recovery in application services.
  • Classify orchestration as model-controlled delegation, a fixed application workflow, or a background worker before selecting SubAgents or DynamicWorkflow; keep fixed sequencing and worker queues in application code.
  • If public Pydantic AI primitives cannot implement required generic runtime semantics correctly, propose the core primitive instead of recreating the runtime in Harness.

When there is no direct equivalent, do not stop at "unsupported." State the source contract and impact, then recommend either an existing composition, a narrow adapter or application service, a new Harness capability built from public primitives, or a Pydantic AI core change. Recommend one option and name its residual risk; ask before choosing when the options materially change behavior, architecture, public API, or scope.

Migrate and verify

  1. Port one vertical slice behind the existing application boundary: typed dependencies, one tool family, output, and one representative request.
  2. Preserve source request, result, error, event, and continuation shapes with a small adapter while callers migrate.
  3. Run the original suite together with focused characterization, parity, and evaluation checks before expanding to the next capability. Exercise the supported Agent boundary in the same interpreter and installed checkout the target will use; do not accept results from another environment. Read Tested Composition only when a local coding-agent composition is useful.
  4. Read Validation and Cutover before publishing examples or claiming cutover; for a simple slice, use only the applicable checks.
  5. Cut over only when each in-scope contract is regression-tested, intentionally changed with agreement, or explicitly not applicable. Report anything else as unverified.

Match validation to observed contracts. Focused characterization and parity tests are sufficient for a stateless slice; persistence, approvals, concurrency, streaming, and external side effects require the ledger and applicable restart and idempotency checks.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Migrating Deep Agents To Pydantic Ai Harness AI skill do?

Migrate Python LangChain Deep Agents applications to Pydantic AI and Pydantic AI Harness. Use when the source uses the upstream `deepagents` package or demonstrably reproduces its middleware, backends, skills, memory, subagents, or sandbox contracts. Use `migrating-langchain-to-pydantic-ai` for plain LangChain, LangGraph, or LCEL migrations and `pydantic-ai-harness` for greenfield Harness usage.

Why use Migrating Deep Agents To Pydantic Ai Harness on TypingMind?

Because you install it once and use it with any model. Migrating Deep Agents To Pydantic Ai Harness is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Migrating Deep Agents To Pydantic Ai Harness in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/pydantic/pydantic-ai-harness/tree/main/pydantic_ai_harness/.agents/skills/migrating-deep-agents-to-pydantic-ai-harness. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Migrating Deep Agents To Pydantic Ai Harness?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Migrating Deep Agents To Pydantic Ai Harness?

As many as you like. As long as a model supports skills, you can use Migrating Deep Agents To Pydantic Ai Harness with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Migrating Deep Agents To Pydantic Ai Harness AI skill free?

Yes. It is published on GitHub by pydantic under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇