Deep Agent framework built on Pydantic-ai with planning, filesystem, and subagent capabilities
Project description
pydantic-deep
Deep agent framework built on pydantic-ai with planning, filesystem, and subagent capabilities.
Demo
See the full demo application - a complete example showing how to build a chat interface with file uploads, skills, and streaming responses.
Features
- Multiple Backends: StateBackend (in-memory), FilesystemBackend, DockerSandbox, CompositeBackend
- Rich Toolsets: TodoToolset, FilesystemToolset, SubAgentToolset, SkillsToolset
- File Uploads: Upload files for agent processing with
run_with_files()ordeps.upload_file() - Skills System: Extensible skill definitions with markdown prompts
- Structured Output: Type-safe responses with Pydantic models via
output_type - Context Management: Automatic conversation summarization for long sessions
- Human-in-the-Loop: Built-in support for human confirmation workflows
- Streaming: Full streaming support for agent responses
Installation
pip install pydantic-deep
Or with uv:
uv add pydantic-deep
Optional dependencies
# Docker sandbox support
pip install pydantic-deep[sandbox]
Quick Start
import asyncio
from pydantic_deep import create_deep_agent, create_default_deps
from pydantic_deep.backends import StateBackend
async def main():
# Create a deep agent with state backend
backend = StateBackend()
deps = create_default_deps(backend)
agent = create_deep_agent()
# Run the agent
result = await agent.run("Help me organize my tasks", deps=deps)
print(result.output)
asyncio.run(main())
Structured Output
Get type-safe responses with Pydantic models:
from pydantic import BaseModel
from pydantic_deep import create_deep_agent, create_default_deps
class TaskAnalysis(BaseModel):
summary: str
priority: str
estimated_hours: float
agent = create_deep_agent(output_type=TaskAnalysis)
deps = create_default_deps()
result = await agent.run("Analyze this task: implement user auth", deps=deps)
print(result.output.priority) # Type-safe access
File Uploads
Process user-uploaded files with the agent:
from pydantic_deep import create_deep_agent, DeepAgentDeps, run_with_files
from pydantic_deep.backends import StateBackend
agent = create_deep_agent()
deps = DeepAgentDeps(backend=StateBackend())
# Upload and process files
with open("sales.csv", "rb") as f:
result = await run_with_files(
agent,
"Analyze this sales data and find top products",
deps,
files=[("sales.csv", f.read())],
)
Or upload files directly to deps:
deps.upload_file("config.json", b'{"key": "value"}')
# File is now at /uploads/config.json and agent sees it in system prompt
Context Management
Automatically summarize long conversations to manage token limits:
from pydantic_deep import create_deep_agent
from pydantic_deep.processors import create_summarization_processor
processor = create_summarization_processor(
trigger=("tokens", 100000), # Summarize when reaching 100k tokens
keep=("messages", 20), # Keep last 20 messages
)
agent = create_deep_agent(history_processors=[processor])
Documentation
- Full Documentation - Complete guides and API reference
- PyPI Package - Package information and releases
- GitHub Repository - Source code and issues
Quick Links
Development
# Clone the repository
git clone https://github.com/vstorm-co/pydantic-deepagents.git
cd pydantic-deepagents
# Install dependencies
make install
# Run tests
make test
# Run all checks (lint, typecheck, test, coverage)
make all
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_deep-0.2.6.tar.gz.
File metadata
- Download URL: pydantic_deep-0.2.6.tar.gz
- Upload date:
- Size: 274.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f12bcb9f46518267d71ef3ea4f13645e11f71a9a1cf5a7cccccb71d3af81af8
|
|
| MD5 |
80110aa3dc567699588370a6c49824e1
|
|
| BLAKE2b-256 |
063c6276824c04cb46a0e154c9c05d5b8867e14a2b5c4289662b999e86be9395
|
Provenance
The following attestation bundles were made for pydantic_deep-0.2.6.tar.gz:
Publisher:
publish.yml on vstorm-co/pydantic-deepagents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_deep-0.2.6.tar.gz -
Subject digest:
3f12bcb9f46518267d71ef3ea4f13645e11f71a9a1cf5a7cccccb71d3af81af8 - Sigstore transparency entry: 756599833
- Sigstore integration time:
-
Permalink:
vstorm-co/pydantic-deepagents@eddf9c76907386e218657e3878d55263d7c8a9b8 -
Branch / Tag:
- Owner: https://github.com/vstorm-co
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eddf9c76907386e218657e3878d55263d7c8a9b8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pydantic_deep-0.2.6-py3-none-any.whl.
File metadata
- Download URL: pydantic_deep-0.2.6-py3-none-any.whl
- Upload date:
- Size: 48.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f8dd671c0d98c03031d1395719bdd4a6cd6760cb33bea9e666bf6774317eda1
|
|
| MD5 |
f89f917752e8f9fcfc2225b5104e5e06
|
|
| BLAKE2b-256 |
9571fad4a847e6838c5f33b0ed3ee21c24d0112d7e1bf76ed1f2f562c0b50a46
|
Provenance
The following attestation bundles were made for pydantic_deep-0.2.6-py3-none-any.whl:
Publisher:
publish.yml on vstorm-co/pydantic-deepagents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_deep-0.2.6-py3-none-any.whl -
Subject digest:
3f8dd671c0d98c03031d1395719bdd4a6cd6760cb33bea9e666bf6774317eda1 - Sigstore transparency entry: 756599837
- Sigstore integration time:
-
Permalink:
vstorm-co/pydantic-deepagents@eddf9c76907386e218657e3878d55263d7c8a9b8 -
Branch / Tag:
- Owner: https://github.com/vstorm-co
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eddf9c76907386e218657e3878d55263d7c8a9b8 -
Trigger Event:
release
-
Statement type: