Skip to content
Open Source Framework

Build Autonomous AI Agents
That Actually Ship

Production-grade Python framework implementing the deep agent pattern — agents that plan, code, execute, and delegate like Claude Code.

Terminal

Why use this?

Without DeepAgents

  • Fragile chains that break on unexpected inputs
  • No type safety — dict-based, error-prone
  • Hard to debug agent decision paths
  • Manual context window management
  • No subagent delegation pattern

With DeepAgents

  • Modular agents with structured planning
  • Fully type-safe with Pydantic models
  • Complete observability via Logfire
  • Automatic context summarization
  • Built-in subagent delegation and communication

Get Started in 4 Steps

From pip install to autonomous agents in minutes

1

Install

pip install pydantic-deepagents — one package, zero config, all batteries included.

2

Define Your Agent

Describe what your agent does with typed tools, system prompts, and optional sub-agents.

3

Run

Your agent plans, executes, and delegates — streaming results in real time via WebSocket.

4

Scale with Sub-Agents

Break complex tasks into specialized sub-agents that collaborate autonomously.

Everything an agent needs

From planning to deployment, the complete deep agent toolkit.

Deep Agent Pattern

Implements the Claude Code architecture — agents that reason, plan, and execute multi-step tasks autonomously.

Unlimited Context

Built-in conversation compaction lets agents work on tasks that exceed any model's context window.

Sub-agent Delegation

Spawn specialized sub-agents for parallel research, code generation, or analysis — then merge results.

Persistent Memory

Agents remember across sessions. Project-scoped and global memory with automatic relevance filtering.

Rich Tool System

Filesystem access, shell execution, web search, and custom tools — all with type-safe Pydantic models.

Production-Grade

Streaming, checkpoints, multi-provider support, Logfire integration, and battle-tested in 30+ deployments.

How does it compare?

See how it stacks up against alternatives.

Feature DeepAgents LangChain CrewAI AutoGen
Type Safety
Subagent Delegation
Tool System
Multi-Provider Partial
Observability Partial
Production Tested

How it works

A layered architecture from your application down to the LLM.

Your Application
DeepAgent Orchestrator
Planning
Engine
Memory
Manager
Context
Compactor
Middleware Stack
GuardrailsCost TrackingLoggingPermissions
Tool Registry
FilesystemShellWeb SearchSub-agentsCustom
LLM Provider
ClaudeOpenAIGemini

Three lines to your first agent

From basic setup to custom tools and sub-agent delegation.

agent.py
from pydantic_deep import create_deep_agent, DeepAgentDeps, StateBackend
agent = create_deep_agent(
model="anthropic:claude-sonnet-4-20250514",
instructions="You are a senior Python developer.",
)
deps = DeepAgentDeps(backend=StateBackend())
result = await agent.run(
"Refactor the auth module to use JWT tokens",
deps=deps,
)

Built for real work

From code generation to research pipelines.

Code Generation & Refactoring

Autonomous agents that read codebases, plan changes, and implement them across multiple files.

  • Multi-file refactoring
  • Automated code review
  • Test generation
  • Dependency updates

Research Agents

Agents that search the web, analyze findings, and produce structured research reports.

  • Web search & scraping
  • Source cross-referencing
  • Structured output
  • Citation tracking

Data Pipeline Automation

Build, monitor, and fix data pipelines with agents that understand your infrastructure.

  • Pipeline scaffolding
  • Error diagnosis
  • Schema migrations
  • Performance tuning

CLI & DeepResearch

Interactive terminal, editor integration, and autonomous research — all included.

Interactive CLI

A full-featured terminal interface built with Textual. Resume conversations, switch models, track token usage — or plug into Zed via ACP.

  • Session resume & persistent memory
  • Multi-provider model switching
  • Custom skills & web search
  • Zed editor integration via ACP

DeepResearch

Autonomous research agent that plans queries, delegates to sub-agents, cross-references sources, and writes structured reports with citations.

  • Multi-step research planning
  • Parallel sub-agent delegation
  • Web search with full page fetching
  • Structured reports with citations

Frequently Asked Questions

Everything you need to know about our tools and projects.

What is pydantic-deep?
A Python framework for building autonomous AI agents inspired by Claude Code's architecture. It implements the deep agent pattern — agents that can plan, read/write files, delegate to subagents, and maintain persistent memory across sessions.
How does it differ from LangChain or CrewAI?
DeepAgents is type-safe by default (Pydantic models, not dicts), modular (compose tools, not chains), and observable (Logfire integration). It focuses on the deep agent pattern — long-running agents that plan and execute autonomously — rather than simple chain-of-thought or multi-agent chat.
Which LLM providers are supported?
Any provider supported by Pydantic AI — OpenAI, Anthropic, Google Gemini, Groq, Mistral, and any OpenAI-compatible API (like Ollama for local models). Swap providers with one line of configuration.
Can I use my own tools?
Yes. Define tools using the @tool decorator from Pydantic AI. Tools are type-checked, support async execution, and integrate with the permission system. You can also use pre-built toolsets (filesystem, database, console) from companion libraries.
Is it production-ready?
Yes. DeepAgents powers 30+ production deployments at Vstorm. It includes structured logging via Logfire, error recovery, token usage tracking, and has been battle-tested in real-world AI agent applications.

Ready to build agents that actually think?

Install pydantic-deep, define your agent, and let it plan, code, and delegate — just like Claude Code, but yours.