DEV Community

Cover image for Pydantic Deep Agents 0.3.3: ACP, Thinking, Lifecycle Hooks, and Opinionated Defaults
Kacper Włodarczyk
Kacper Włodarczyk

Posted on • Originally published at oss.vstorm.co

Pydantic Deep Agents 0.3.3: ACP, Thinking, Lifecycle Hooks, and Opinionated Defaults

We just released pydantic-deep 0.3.3 — and this is the biggest release since we open-sourced the project. ACP support, deep subagents by default, thinking, Anthropic caching, lifecycle hooks, skills as slash commands, and a provider setup wizard.

Let's walk through the changes.

ACP: Your Agent in Any Editor

ACP (Agent Client Protocol) is a standardized protocol that lets AI agents run inside editors. Think of it like LSP, but for AI agents instead of language servers.

Our new apps/acp/ adapter exposes any pydantic-deep agent as an ACP-compatible server. The same agent you run in your terminal now runs in Zed with zero code changes.

What you get:

  • Streaming text deltas — real-time output, not waiting for completion
  • Tool call visibility — see tool names, arguments, and results (not a black box)
  • Model switching — change from Claude to GPT mid-session
  • Session management — conversation persistence across editor restarts
  • Auto-detect provider — reads your API keys, no manual config

The adapter wraps the same create_deep_agent() you already use. No new API to learn.

Because ACP is a protocol (not a Zed-specific plugin), it'll work with any editor that adopts it. We expect more editors to support ACP in the coming months.

Subagents Are Now Deep Agents by Default

This is the change that affects the most users.

Previously, subagents were plain pydantic-ai Agents — lightweight, but limited. They couldn't read files, search the web, or remember things between runs.

Now, every subagent (built-in and custom) is created via create_deep_agent() with:

  • Filesystem access (read, write, edit, grep, glob)
  • Web search and web fetch
  • Persistent memory
  • Large output eviction (auto-save to files when output exceeds 20K tokens)
  • Orphaned tool call patching

If your custom subagent doesn't specify agent or agent_factory, it automatically gets the full deep agent factory. You don't have to change anything — your subagents just got more capable.

We also replaced include_general_purpose_subagent with include_builtin_subagents, which adds a "research" deep agent for codebase exploration and web research.

Thinking Enabled by Default

thinking="high" is now the default. This enables model reasoning via pydantic-ai's Thinking capability.

We support 7 levels:

agent = create_deep_agent(
    model="anthropic:claude-opus-4-6",
    thinking="high",  # default
    # Options: True, False, "minimal", "low", "medium", "high", "xhigh"
)
Enter fullscreen mode Exit fullscreen mode

For models that don't support thinking (like GPT-4.1), the parameter is silently ignored.

Anthropic Prompt Caching — On by Default

Three new defaults enabled automatically:

  • anthropic_cache_instructions — cache system prompt
  • anthropic_cache_tool_definitions — cache tool schemas
  • anthropic_cache_messages — cache conversation history

This reduces token costs and latency for Anthropic models significantly. For non-Anthropic models, these settings are silently ignored.

5 New Lifecycle Hooks

class HookEvent(Enum):
    BEFORE_RUN = "before_run"
    AFTER_RUN = "after_run"
    RUN_ERROR = "run_error"
    BEFORE_MODEL_REQUEST = "before_model_request"
    AFTER_MODEL_REQUEST = "after_model_request"
Enter fullscreen mode Exit fullscreen mode

These map directly to pydantic-ai's lifecycle hooks. Use cases:

  • Session tracking — log when an agent run starts and ends
  • LLM call logging — capture every model request for debugging
  • Error alerts — get notified when a run fails
  • Cost monitoring — track token usage per request

Skills as Slash Commands

Skills now work as slash commands in the CLI. Type /code-review and the skill activates directly from the picker.

Discovery follows a 3-tier hierarchy:

  1. Built-in (apps/cli/skills/) — ships with pydantic-deep
  2. User (~/.pydantic-deep/skills/) — your personal skills
  3. Project (.pydantic-deep/skills/) — project-specific skills

Later sources override earlier ones by name, so you can customize built-in skills per project.

Other Notable Changes

  • compact_conversation tool — the agent can manually trigger context compression with an optional focus topic
  • Provider setup wizard — first-run auto-detects missing API keys and guides through provider selection
  • /provider slash command — switch AI provider and model mid-session
  • /config slash command — view and change settings interactively
  • approve_tools config — choose which tools need user approval (default: ["execute"])
  • Enhanced BASE_PROMPT — Claude Code-inspired sections for code quality, careful execution, and formatting
  • Context files simplified to AGENTS.md and SOUL.md only

Opinionated Defaults

The philosophy behind 0.3.3: make the powerful thing the default thing.

Setting Before After
Memory off on
Thinking off "high"
Prompt caching off on (Anthropic)
Subagent type plain Agent deep agent
Max nesting depth 0 1
Eviction limit none 20K tokens
Patch tool calls off on

You get a capable, production-ready agent with create_deep_agent("anthropic:claude-opus-4-6"). No configuration needed.

Get Started

pip install pydantic-deep-agents
Enter fullscreen mode Exit fullscreen mode

Or try the CLI:

pip install pydantic-deep-agents[cli]
pydantic-deep
Enter fullscreen mode Exit fullscreen mode

Full changelog: CHANGELOG.md

Repo: github.com/vstorm-co/pydantic-deepagents


We build open-source AI agent tooling at Vstorm. pydantic-deep is our framework — modular, type-safe, production-tested across 30+ deployments.

Top comments (0)