You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Subagent communication**: `ask_parent` tool for subagents to query the parent agent
29
+
-**Dynamic agent creation**: Runtime agent creation via `create_agent_factory_toolset`
30
+
- New types: `TaskHandle`, `TaskStatus`, `TaskPriority`, `TaskCharacteristics`, `ExecutionMode`
31
+
32
+
### Fixed
33
+
34
+
- Added `chardet>=5.0.0` dependency back - was incorrectly removed in 0.2.13 but is still needed for `DeepAgentDeps.upload_file()` encoding detection ([#22](https://github.com/vstorm-co/pydantic-deep/issues/22))
35
+
- Subagents now automatically get `console_toolset` and `todo_toolset` like in previous versions - the migration to `subagents-pydantic-ai` accidentally removed these default tools ([#21](https://github.com/vstorm-co/pydantic-deep/issues/21))
36
+
37
+
### Documentation
38
+
39
+
- Updated `docs/advanced/processors.md` with SlidingWindowProcessor documentation
40
+
- Updated `docs/api/processors.md` with full API reference for both processors
41
+
- Updated `CLAUDE.md` with new processor imports and subagent imports from external packages
42
+
- Updated `README.md` with subagents-pydantic-ai references in modular architecture
43
+
- Updated `docs/advanced/subagents.md` with dual-mode execution and new SubAgentConfig fields
44
+
- Updated `docs/api/toolsets.md` with complete SubAgentToolset API including task management tools
45
+
- Updated `docs/api/types.md` with new subagent types (TaskHandle, TaskStatus, TaskPriority, ExecutionMode)
46
+
- Updated `docs/examples/subagents.md` with correct tool names and updated SubAgentConfig example
47
+
- Updated `docs/concepts/toolsets.md` with SubAgentToolset tools and correct parameter names
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@
6
6
7
7
> **Need just the backends?** Check out [pydantic-ai-backend](https://github.com/vstorm-co/pydantic-ai-backend) - file storage and sandbox backends that work with any pydantic-ai agent.
8
8
9
+
> **Need just subagents?** Check out [subagents-pydantic-ai](https://github.com/vstorm-co/subagents-pydantic-ai) - task delegation toolset with dual-mode execution (sync/async).
*\*Note: Summarization will be added to pydantic-ai core in late January 2025 ([pydantic-ai#3780](https://github.com/pydantic/pydantic-ai/pull/3780)). We will migrate to use it once available.*
pydantic-deep supports history processors for managing conversation context. The most common use case is automatic summarization to handle long conversations without exceeding token limits.
3
+
pydantic-deep supports history processors for managing conversation context. These processors are powered by [summarization-pydantic-ai](https://github.com/vstorm-co/summarization-pydantic-ai) and provide two strategies:
This feature will be added to pydantic-ai core in late January 2025 ([pydantic-ai#3780](https://github.com/pydantic/pydantic-ai/pull/3780)). Once available, we will migrate to use the upstream implementation. The API will remain compatible.
7
10
8
11
## Summarization Processor
9
12
10
-
The `SummarizationProcessor` monitors conversation length and automatically summarizes older messages when thresholds are reached.
13
+
The `SummarizationProcessor` monitors conversation length and automatically summarizes older messages when thresholds are reached. This provides intelligent compression that preserves important context.
11
14
12
15
### Basic Usage
13
16
14
17
```python
15
-
from pydantic_deep import create_deep_agent
16
-
from pydantic_deep.processors import create_summarization_processor
18
+
from pydantic_deep import create_deep_agent, create_summarization_processor
17
19
18
20
# Create a summarization processor
19
21
processor = create_summarization_processor(
@@ -32,6 +34,8 @@ agent = create_deep_agent(
32
34
You can trigger summarization based on different criteria:
33
35
34
36
```python
37
+
from pydantic_deep import create_summarization_processor
By default, the processor uses a simple character-based estimation (~4 characters per token). For more accurate counting, provide a custom token counter:
88
94
89
95
```python
90
-
defcount_tokens(messages):
96
+
from pydantic_ai.messages import ModelMessage
97
+
from pydantic_deep import create_summarization_processor
The `SlidingWindowProcessor` provides a zero-cost alternative that simply discards old messages without LLM calls. This is useful when you don't need to preserve historical context.
146
+
147
+
### Basic Usage
148
+
149
+
```python
150
+
from pydantic_deep import create_deep_agent, create_sliding_window_processor
151
+
152
+
# Create a sliding window processor
153
+
processor = create_sliding_window_processor(
154
+
trigger=("messages", 100), # Trim when reaching 100 messages
155
+
keep=("messages", 50), # Keep last 50 messages
156
+
)
157
+
158
+
# Create agent with the processor
159
+
agent = create_deep_agent(
160
+
history_processors=[processor],
161
+
)
162
+
```
163
+
164
+
### When to Use Sliding Window
165
+
166
+
Choose `SlidingWindowProcessor` when:
167
+
168
+
-**Cost matters**: No LLM calls for processing
169
+
-**Speed matters**: Instant trimming without API latency
170
+
-**Recent context is sufficient**: Tasks don't need historical information
171
+
-**Conversations are long**: High-volume chat applications
133
172
134
-
For more control, use `SummarizationProcessor` directly:
173
+
Choose `SummarizationProcessor` when:
174
+
175
+
-**Context preservation matters**: Need to remember earlier decisions
176
+
-**Tasks span multiple topics**: Important details scattered throughout
177
+
-**Quality over speed**: Willing to trade latency for better context
178
+
179
+
### Configuration Examples
135
180
136
181
```python
137
-
from pydantic_deep.processorsimportSummarizationProcessor
182
+
from pydantic_deep importcreate_sliding_window_processor
138
183
139
-
processor = SummarizationProcessor(
184
+
# Message-based window
185
+
processor = create_sliding_window_processor(
186
+
trigger=("messages", 100),
187
+
keep=("messages", 50),
188
+
)
189
+
190
+
# Token-based window
191
+
processor = create_sliding_window_processor(
192
+
trigger=("tokens", 100000),
193
+
keep=("tokens", 50000),
194
+
)
195
+
196
+
# Fraction-based window
197
+
processor = create_sliding_window_processor(
198
+
trigger=("fraction", 0.8),
199
+
keep=("fraction", 0.4),
200
+
max_input_tokens=200000,
201
+
)
202
+
```
203
+
204
+
## Using Processor Classes Directly
205
+
206
+
For more control, use the processor classes directly:
207
+
208
+
```python
209
+
from pydantic_deep import SummarizationProcessor, SlidingWindowProcessor
0 commit comments