Batteries-included agent harness for Python — tool-calling, sandboxed execution, multi-agent teams, and unlimited context on Pydantic AI
$git clone https://github.com/vstorm-co/pydantic-deepagentsInstalls into the current project.
Install pydantic-deepagents by running `git clone https://github.com/vstorm-co/pydantic-deepagents`, then use it for the current task and follow its documentation at https://github.com/vstorm-co/pydantic-deepagents.
| 1 | <h1 align="center">Pydantic Deep Agents</h1> |
| 2 | |
| 3 | <p align="center"> |
| 4 | <b>Open-source Claude Code — that you can also build on.</b><br> |
| 5 | A self-hosted <b>terminal AI assistant</b> <i>and</i> the <b>Python framework</b> behind it.<br> |
| 6 | Use it today, or ship your own agent in <b>one function call</b>. Any model. 100% type-safe. MIT. |
| 7 | </p> |
| 8 | |
| 9 | <p align="center"> |
| 10 | <img src="assets/cli_demo_v2.gif" alt="Pydantic Deep Agents CLI demo" width="800"> |
| 11 | </p> |
| 12 | |
| 13 | <p align="center"> |
| 14 | <a href="https://vstorm-co.github.io/pydantic-deepagents/">Docs</a> · |
| 15 | <a href="https://pypi.org/project/pydantic-deep/">PyPI</a> · |
| 16 | <a href="#-live-run-forking--the-feature-no-one-else-has">Forking</a> · |
| 17 | <a href="#-why-pydantic-deep">Why</a> · |
| 18 | <a href="#-cli--terminal-ai-assistant">CLI</a> · |
| 19 | <a href="#-framework--build-your-own-agent">Framework</a> · |
| 20 | <a href="https://vstorm-co.github.io/pydantic-deepagents/examples/">Examples</a> |
| 21 | </p> |
| 22 | |
| 23 | <p align="center"> |
| 24 | <a href="https://pypi.org/project/pydantic-deep/"><img src="https://img.shields.io/pypi/v/pydantic-deep.svg" alt="PyPI version"></a> |
| 25 | <a href="https://pepy.tech/projects/pydantic-deep"><img src="https://static.pepy.tech/badge/pydantic-deep/month" alt="PyPI Downloads"></a> |
| 26 | <a href="https://github.com/vstorm-co/pydantic-deep/stargazers"><img src="https://img.shields.io/github/stars/vstorm-co/pydantic-deep?style=flat&logo=github&color=yellow" alt="GitHub Stars"></a> |
| 27 | <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-blue?logo=python&logoColor=white" alt="Python 3.10+"></a> |
| 28 | <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a> |
| 29 | <a href="https://coveralls.io/github/vstorm-co/pydantic-deepagents?branch=main"><img src="https://coveralls.io/repos/github/vstorm-co/pydantic-deepagents/badge.svg?branch=main" alt="Coverage Status"></a> |
| 30 | <a href="https://github.com/vstorm-co/pydantic-deepagents/actions/workflows/ci.yml"><img src="https://github.com/vstorm-co/pydantic-deepagents/actions/workflows/ci.yml/badge.svg" alt="CI"></a> |
| 31 | <a href="https://www.bestpractices.dev/projects/12495"><img src="https://www.bestpractices.dev/projects/12495/badge" alt="OpenSSF Best Practices"></a> |
| 32 | <a href="https://github.com/vstorm-co/pydantic-deep/blob/main/SECURITY.md"><img src="https://img.shields.io/badge/security-policy-blueviolet?logo=shieldsdotio&logoColor=white" alt="Security Policy"></a> |
| 33 | <a href="https://github.com/pydantic/pydantic-ai"><img src="https://img.shields.io/badge/Powered%20by-Pydantic%20AI-E92063?logo=pydantic&logoColor=white" alt="Pydantic AI"></a> |
| 34 | <a href="https://x.com/Kacper95682155"><img src="https://img.shields.io/badge/X-000000?logo=x&logoColor=white" alt="X"></a> |
| 35 | </p> |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | **Pydantic Deep Agents is two things in one repo:** |
| 40 | |
| 41 | 🖥️ **A terminal AI assistant** — a self-hosted, open-source alternative to Claude Code. Install it, point it at any model, and it plans, edits files, runs commands, searches the web, remembers across sessions, spawns sub-agents, and connects to MCP servers. Almost everything Claude Code does — on the model *you* choose. |
| 42 | |
| 43 | 🐍 **A Python framework** — the *exact same harness* behind a single function call. `create_deep_agent()` hands a model a filesystem, shell, planning, memory, sub-agents, sandboxed execution, MCP, and unlimited context. Build your own assistant, research agent, or coding tool without rewiring the plumbing every time. |
| 44 | |
| 45 | Both run on **[Pydantic AI](https://github.com/pydantic/pydantic-ai)**, work with **any model** (Claude, GPT, Gemini, local), and are **100% type-safe** and MIT-licensed — and they share one trick nothing else has: [**Live Run Forking**](#-live-run-forking--the-feature-no-one-else-has), splitting a single run into parallel branches an AI judge merges back together. |
| 46 | |
| 47 | ## Two ways to use it |
| 48 | |
| 49 | ### 🖥️ 1. Use the assistant |
| 50 | |
| 51 | A Claude-Code-style TUI in your terminal, on **any** model — n |