-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs: add pydantic-deep to third-party toolsets #3747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
18cb828
ca6c1f7
cfa5162
5098362
af288d7
2e2c9ef
73921c3
e03c227
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| # Multi-agent Applications | ||
|
|
||
| There are roughly four levels of complexity when building applications with Pydantic AI: | ||
| There are roughly five levels of complexity when building applications with Pydantic AI: | ||
|
|
||
| 1. Single agent workflows — what most of the `pydantic_ai` documentation covers | ||
| 2. [Agent delegation](#agent-delegation) — agents using another agent via tools | ||
| 3. [Programmatic agent hand-off](#programmatic-agent-hand-off) — one agent runs, then application code calls another agent | ||
| 4. [Graph based control flow](graph.md) — for the most complex cases, a graph-based state machine can be used to control the execution of multiple agents | ||
| 5. [Deep Agents](#deep-agents) — production-grade agents with planning, file operations, task delegation, and sandboxed code execution | ||
|
|
||
| Of course, you can combine multiple strategies in a single application. | ||
|
|
||
|
|
@@ -322,8 +323,23 @@ graph TB | |
|
|
||
| See the [graph](graph.md) documentation on when and how to use graphs. | ||
|
|
||
| ## Deep Agents | ||
|
|
||
| Deep agents are production-grade autonomous agents that go beyond simple tool use. They combine multiple architectural patterns to handle complex, multi-step tasks reliably: | ||
|
|
||
| - **Planning and progress tracking** — agents break down complex tasks into steps and track their progress, giving users visibility into what the agent is working on | ||
| - **File system operations** — reading, writing, and editing files with proper abstraction layers that work across in-memory storage, real file systems, and sandboxed containers | ||
| - **Task delegation** — spawning specialized sub-agents for specific tasks, with isolated context to prevent recursive delegation issues | ||
| - **Sandboxed code execution** — running AI-generated code in isolated environments (typically Docker containers) to prevent accidents | ||
| - **Context management** — automatic conversation summarization to handle long sessions that would otherwise exceed token limits | ||
| - **Human-in-the-loop** — approval workflows for dangerous operations like code execution or file deletion | ||
|
|
||
| These patterns emerged from teams building production agents (like [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) and [Manus](https://manus.im/)) and discovering what actually works at scale. | ||
|
|
||
| [Pydantic-Deep](https://github.com/vstorm-co/pydantic-deepagents) implements these deep agent patterns for Pydantic AI. See the [toolsets documentation](toolsets.md#pydantic-deep) for usage examples and the [full demo application](https://github.com/vstorm-co/pydantic-deepagents/tree/main/examples/full_app) for a complete example with a chat interface, file uploads, skills, and streaming responses. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to make it clear that each of the items in the list above can already be implemented using some Pydantic AI feature / 3rd party package, (we should have links to each doc, e.g. the toolset sections you're gonna add), and that if one doesn't want to piece this together oneself, Pydantic-Deep is a community package that offers an opinionated take on a deep agent by leveraging these same features.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm happy to take a crack at this at the end to make it sound a little bit more from-Pydantic than from-VStorm. |
||
|
|
||
| ## Examples | ||
|
|
||
| The following examples demonstrate how to use dependencies in Pydantic AI: | ||
| The following examples demonstrate how to use multi-agent patterns in Pydantic AI: | ||
|
|
||
| - [Flight booking](examples/flight-booking.md) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -708,3 +708,18 @@ toolset = ACIToolset( | |
|
|
||
| agent = Agent('openai:gpt-5', toolsets=[toolset]) | ||
| ``` | ||
|
|
||
| ### Pydantic-Deep {#pydantic-deep} | ||
|
|
||
| [Pydantic-Deep](https://github.com/vstorm-co/pydantic-deepagents), built by [Vstorm](https://vstorm.co/), brings deep agent patterns to Pydantic AI. Deep agents are production-grade agents with planning, file system operations, task delegation, and sandboxed code execution — patterns derived from production systems like Claude Code and Manus. | ||
|
|
||
| Available toolsets: | ||
|
|
||
| - `TodoToolset`: Task planning and progress tracking for agent self-organization | ||
| - `FilesystemToolset`: File operations (ls, read, write, edit, glob, grep, execute) | ||
| - `SubAgentToolset`: Spawn and delegate tasks to specialized subagents | ||
| - `SkillsToolset`: Load and use [agent skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills) from markdown files | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming (some of) these can be used stand-alone, without the rest of the Deep Agent framework, would it be possible to extract these into separate packages, that we can consider for upstreaming once they've matured a bit? If they are usable standalone, even if they're still in the same package, I also wouldn't mind subheadings so that it's easier for a user to find "Todo Toolset" or "File system Toolset" in the sidebar ToC if they just want that bit.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it makes sense to have the explanation of your framework in the multi-agent-... page, and then here have a separate section for each of the stand-alone-usable toolsets, that can say "Part of ..." linking to the Deep Agent doc. Those sections should be more generic, less marketing copy, just saying things like "File system access is useful because blablabla. Check out these implementations by the community:", as they may have multiple links, e.g. also https://pypi.org/project/pydantic-ai-filesystem-sandbox/.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion. I've analyzed the toolsets for extractability: Easy to extract:
Would require more work:
I'll look into extracting In the meantime, I can add subheadings for each toolset in the docs for better discoverability in the sidebar.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to have headings under "Third-Party Toolsets" (after MCP Servers, before Langchain) for each type of common toolset that has one or more community implementations and then in that section list each option, i.e. "Task Management"/Todos", "Filesystem" (https://pypi.org/project/pydantic-ai-filesystem-sandbox/ + yours once it's available), "Memory", "Code Execution" (could list https://github.com/pydantic/mcp-run-python), etc. The ones that Pydantic-Deep covers can then have an item saying something to the effect of "The third-party Pydantic-Deep deep agent framework includes a That way it'll be easier to discover for users, not being nested under the not-necessarily-related-seeming Deep Agents heading, and leaves room for more future community alternatives. The copy on the Multi-Agent page can then be the main place where that concept is introduced + Pydantic-Deep is mentioned more clearly, as I don't think a "Deep Agents/Pydantic-Deep" heading necessarily makes sense on the Toolsets page. I also wouldn't be opposed to a new page like https://starlette.dev/third-party-packages/ listing Third Party packages explicitly; that's also where https://github.com/jagreehal/pydantic-ai-guardrails could go for example. |
||
|
|
||
| The framework also includes multiple backends (in-memory, filesystem, Docker sandbox), automatic conversation summarization, and human-in-the-loop approval workflows. | ||
|
|
||
| See the [documentation](https://vstorm-co.github.io/pydantic-deepagents/) for installation and usage, or explore the [full demo application](https://github.com/vstorm-co/pydantic-deepagents/tree/main/examples/full_app) for a complete example with a chat interface, file uploads, skills, and streaming responses. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path has a risk of getting outdated, so let's not include it. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop this paragraph