SuperAPI AI Directory

pydantic-deepagents

Pydantic Deep Agents is an open-source Python framework built on Pydantic AI that also provides a self-hosted terminal AI assistant. It supports any model that supports tool calling, and offers capabilities such as tool calling, sandboxed execution, multi-agent teams, skills, checkpoints, and unlimited context, and features its unique Live Run Forking capability. The project is MIT-licensed and emphasizes type safety.

Open website

About this tool

Pydantic Deep Agents is an open-source, self-hostable project that provides two forms of use in the same code repository: first, a terminal AI assistant, and second, a Python framework for building agents. The project is built on Pydantic AI, supports any model that supports tool calling, is officially claimed to be 100% type-safe, and is MIT-licensed.

[Purpose] The project positions itself as the "open-source Claude Code"—both a ready-to-use self-hosted terminal AI assistant and a reusable Python framework. Users can either directly install and use the terminal assistant, or build their own assistant, research agent, or coding tool through a single function call (create_deep_agent()).

[Main Capabilities]

  1. Live Run Forking: When an agent faces multiple options at a decision point, it can split a single run into multiple parallel branches. Each branch has a fully isolated copy-on-write filesystem overlay, its own control messages, and its own budget_usd budget cap. The coordinator can resolve forks through four merge modes: manual, auto, auto_with_fallback (default), vote. The history of the winning branch is treated as the continuation of the parent run.
  2. Terminal AI Assistant (CLI): A Claude Code-style TUI that can plan, edit files, run commands, search the web, remember across sessions, spawn subagents, and connect to MCP servers. It supports switching models and provides 25+ slash commands, session management, streaming output, tool visualization, a live forking panel, and more.
  3. Python Framework: Provides the create_deep_agent() function, with built-in filesystem, Shell, planning, memory, subagents, sandboxed execution, MCP, and unlimited context.
  4. Agent Architecture: Includes planning (task tracking with subtasks, dependencies, and loop detection), subagents/multi-agent clusters (synchronous/asynchronous delegation, background task management, soft/hard cancellation), agent teams (shared TODO list, peer-to-peer message bus), Plan Mode, persistent memory (MEMORY.md), self-improvement (/improve analyzes past sessions).
  5. Context and Memory: Automatic summarization when approaching the token budget (LLM-based or sliding window), context limit warnings, eviction capability, automatic discovery of AGENTS.md, CLAUDE.md, SOContext files such as UL.md and .cursorrules, checkpoints (saving state, rolling back, or branching conversations).
  6. Production features: MCP support, lifecycle hooks, security presets, fallback models, structured output, cost tracking, output styles, streaming, image support, human-in-the-loop confirmation workflows.

[Usage] The terminal assistant (macOS and Linux) requires no Python environment; the installation script automatically installs uv and the CLI. For Windows or manual installation, run pip install "pydantic-deep[cli]", and the update command is pydantic-deep update. To switch models, use pydantic-deep config set model openai:gpt-5.4 or use /model in the TUI. For framework usage, build a deep agent through a single function call, create_deep_agent().

[Applicable scenarios] Developers who need a self-hosted terminal AI assistant, teams that want to build custom research or coding agents, and production-grade scenarios that require multi-agent collaboration, sandboxed execution, and long-context management. The project also includes the reference application DeepResearch (a research deep agent built on Pydantic Deep Agents, with a Web UI).

[Limitations] The materials do not provide specific pricing, platform compatibility details, or performance data. Some features (such as MCP support, Docker sandboxing, and Playwright browser automation) have a version introduction history, and specific availability depends on the installed version.