AgentX-Dev 3.5.0__tar.gz → 3.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/CHANGELOG.md +94 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/PKG-INFO +52 -6
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/README.md +50 -5
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/ChatModel.py +15 -1
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/MCP.py +423 -426
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Observability.py +5 -3
- agentx_dev-3.6.1/agentx_dev/Operator.py +782 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Runner/AgentRun.py +77 -10
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Runner/AsyncAgentRun.py +31 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Runner/Persistence.py +106 -35
- agentx_dev-3.6.1/agentx_dev/SubAgents.py +772 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Supervisor.py +614 -488
- agentx_dev-3.6.1/agentx_dev/SupervisorMemory.py +224 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/VectorStores/chroma_store.py +171 -171
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/VectorStores/pg_store.py +241 -237
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/VectorStores/qdrant_store.py +4 -3
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/WebTools.py +43 -3
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/__init__.py +4 -0
- agentx_dev-3.6.1/agentx_dev/_optional.py +43 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev.egg-info/PKG-INFO +52 -6
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev.egg-info/SOURCES.txt +5 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev.egg-info/requires.txt +1 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/agentic_rag_demo.py +270 -270
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/async_quickstart.py +81 -81
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/chatbot_example.py +206 -206
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/mcp_github_triage_demo.py +37 -52
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/orchestration_demo.py +441 -440
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/planner_example.py +93 -93
- agentx_dev-3.6.1/examples/subagents_demo.py +195 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/supervisor_codebase_analysis_demo.py +1 -1
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/sync_quickstart.py +75 -75
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/v3_1_1_features_demo.py +246 -246
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/v3_1_comprehensive_demo.py +446 -446
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/v3_1_features_demo.py +260 -260
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/pyproject.toml +2 -1
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/AGENTX.md +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/CONTRIBUTING.md +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/LICENSE +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/MANIFEST.in +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Agents/Agent.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Agents/__init__.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/AsyncTools.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/AutoSetup.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Cache.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Compiler.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Config.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/DefaultTools.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Embeddings.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Evals.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Handoffs.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Loader.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Media.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Memory.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Planner.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Runner/__init__.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Runner/promptTemplate.yaml +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Session.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Splitters.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Streaming.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/Tools.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/VectorStores/__init__.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/resources/__init__.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev/resources/promptTemplate.yaml +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev.egg-info/dependency_links.txt +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/agentx_dev.egg-info/top_level.txt +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/README.md +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/async_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/auto_features_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/caching_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/complete_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/concurrent_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/concurrent_tool_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/file_agent_demo.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/function_calling_demo.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/mcp_demo.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/observability_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/robust_link_scraper.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/examples/supervisor_example.py +0 -0
- {agentx_dev-3.5.0 → agentx_dev-3.6.1}/setup.cfg +0 -0
|
@@ -4,6 +4,100 @@ All notable changes to `agentx-dev` are documented here. Format loosely
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/); versioning is
|
|
5
5
|
[Semver](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [3.6.1] - 2026-10-09
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- A package that was installed but failed to import was reported as not installed. A user whose project
|
|
12
|
+
folder held a `google.py` saw "ChromaVectorStore requires the chromadb package" although chromadb was
|
|
13
|
+
installed: the file hid the real `google` package that chromadb's dependencies use, and the catch-all
|
|
14
|
+
hid that. The error now says which case it is. Not installed: it names the extra
|
|
15
|
+
(`python -m pip install "agentx-dev[chroma]"`) and the Python that is running. Installed but failing:
|
|
16
|
+
it shows the real error and common causes (a file named like a library, a version conflict) and no
|
|
17
|
+
install command. Applies to `ChromaVectorStore`, `QdrantVectorStore`, `PgVectorStore`, `MCPClient`,
|
|
18
|
+
`OTelHook` and `Claude`.
|
|
19
|
+
|
|
20
|
+
### Docs
|
|
21
|
+
|
|
22
|
+
- Install pages list the `chroma`, `qdrant` and `pgvector` extras and say why a plain install leaves
|
|
23
|
+
them out; the troubleshooting page covers both messages.
|
|
24
|
+
|
|
25
|
+
## [3.6.0] - 2026-10-09
|
|
26
|
+
|
|
27
|
+
Sub-agents: the Supervisor can create its own helpers. Opt-in, with the behavior changes listed below.
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **Inline helpers**: a plan step can carry `new_agent` (name, free-form
|
|
32
|
+
instructions, tools). The helper runs the step, is reused by name, and is
|
|
33
|
+
discarded when the run ends. Recovery plans can define a replacement for a
|
|
34
|
+
stuck step.
|
|
35
|
+
- **`delegate` tool**: specialists hand a side job to a fresh sub-agent (clean
|
|
36
|
+
context) and get a short summary back; refusals are plain text and a helper
|
|
37
|
+
that fails comes back as a tool error the caller's stuck logic sees.
|
|
38
|
+
`AgentRunner(..., delegation=SpawnConfig(...))` gives a standalone runner the
|
|
39
|
+
same tool; `runner.spawned` lists what it created.
|
|
40
|
+
- **One ceiling**: `SpawnConfig(capabilities=..., tools=..., max_spawns=...,
|
|
41
|
+
max_depth=...)` bounds every helper; spawns inside it need no approval and
|
|
42
|
+
over-asks are clipped, not fatal. New read-only `files_read` preset.
|
|
43
|
+
- **`AsyncSupervisor(spawn_config=...)`**: async parity; spawned steps run in
|
|
44
|
+
parallel. `AsyncAgentRunner` gained `system_addendum=`.
|
|
45
|
+
- `SupervisorResult.spawned`, `spawn` and `delegate_result` stream events,
|
|
46
|
+
`AgentSpec`, `ToolRegistry.unregister`, `AgentRunner.add_tool` /
|
|
47
|
+
`remove_tool`.
|
|
48
|
+
- New guide: Sub-agents.
|
|
49
|
+
- **Ask the operator**: `Supervisor(ask_user=True | function)` lets the planner ask for facts the task
|
|
50
|
+
leaves out and gives every agent an `ask_user` tool. `True` uses a built-in asker that works in
|
|
51
|
+
notebooks (the input box), terminals and IDE consoles and never blocks a headless process; a
|
|
52
|
+
function routes questions through your own channel (chatbot, backend). `max_questions`,
|
|
53
|
+
`ask_timeout`, `SupervisorResult.asked`, `question`/`answer` events,
|
|
54
|
+
`agentx_dev.ask_human_tool()`; waiting on the operator pauses the persistent deadline. The built-in prompt names who is asking (`[planner]` or the agent's name) with a raised-hand marker. Each agent
|
|
55
|
+
may ask once per run (the planner may ask several questions in its one round), and after the
|
|
56
|
+
operator answers the planner is told to do the work instead of planning another question. The
|
|
57
|
+
helper-creation instructions now say a helper can only look things up with the tools it is given
|
|
58
|
+
(this applies to every Supervisor that enables spawning).
|
|
59
|
+
- **Supervisor long-term memory**: `Supervisor(memory=store)` (any vector store: `VectorStore`, Chroma,
|
|
60
|
+
Qdrant, pgvector) gives the planner and every dispatched step the few relevant stored items as a
|
|
61
|
+
FROM MEMORY block, saves each operator answer and each completed run's final answer, and answers an
|
|
62
|
+
exact repeat of an answered question from memory (a run whose synthesis was cut off by the budget
|
|
63
|
+
saves nothing). `memory_top_k`, `memory_min_score`,
|
|
64
|
+
`memory_write`, `SupervisorResult.memory`, `memory` stream events.
|
|
65
|
+
- `web_fetch_tool(text_only=True)`: return an HTML page as readable text (scripts, styles and tags
|
|
66
|
+
removed) instead of the first 50,000 characters of raw markup, which on a modern page can hold no
|
|
67
|
+
content at all. Default off (unchanged for existing agents); the helpers a Supervisor builds use it.
|
|
68
|
+
Helpers are also told not to answer with a script unless they have a code tool, and to say what
|
|
69
|
+
they tried and what was missing.
|
|
70
|
+
- `SpawnConfig(max_iterations=15)`: the step limit for the helpers a Supervisor creates (it was fixed at 15).
|
|
71
|
+
Registered specialists keep the limit set on their own `AgentRunner`. Helpers are told their step limit
|
|
72
|
+
so they can finish with a Final_Answer in time.
|
|
73
|
+
- A helper that runs out of steps (`iteration_limit`) is retried with a note that it ran out, a short
|
|
74
|
+
recap of what it did, and an instruction to do fewer lookups; other failures keep the generic retry note.
|
|
75
|
+
- The unknown-tool error now lists the valid tools and says that a response-format name such as `React_`
|
|
76
|
+
is not a tool, so a model that called one can recover.
|
|
77
|
+
- `RunBudget` now carries a `PausableClock` (it holds a lock), so a `RunBudget` can no longer be
|
|
78
|
+
deep-copied or pickled.
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
- A spawned agent no longer stays on the supervisor after the run.
|
|
83
|
+
- A spawn is no longer refused (or rerouted) because an existing specialist
|
|
84
|
+
has the same tools. The `spawn` event gained `origin`, `tools`, `dropped`,
|
|
85
|
+
`reused` and `refused`; `rerouted_from` is always `None`.
|
|
86
|
+
- A `Supervisor` / `AsyncSupervisor` with `persistence=` and no `spawn_config`
|
|
87
|
+
now allows helpers with web and read-only file access (`max_spawns=6`) and
|
|
88
|
+
gives its specialists the `delegate` tool. Pass
|
|
89
|
+
`spawn_config=SpawnConfig(enabled=False)` to opt out.
|
|
90
|
+
- A legacy spawn config (`enabled=True` with neither `capabilities` nor
|
|
91
|
+
`tools`) keeps the 3.5 approval flow and gives specialists no `delegate`
|
|
92
|
+
tool; set a ceiling to turn delegation on.
|
|
93
|
+
- The planner prompt teaches `new_agent` instead of the `__spawn__` step; old
|
|
94
|
+
`__spawn__` steps still work, but their `name` must now match
|
|
95
|
+
`[A-Za-z0-9_-]{1,40}`.
|
|
96
|
+
- Agent names starting with `__` and names of the form `delegate_<N>` are
|
|
97
|
+
reserved: a `new_agent` that uses one is dropped by plan sanitization.
|
|
98
|
+
- `SpawnConfig.max_spawns` is `Optional[int]` (unset: 3, or 6 in ceiling mode).
|
|
99
|
+
`SUPERVISOR_SPAWN_INSTRUCTION` was removed.
|
|
100
|
+
|
|
7
101
|
## [3.5.0] - 2026-10-04
|
|
8
102
|
|
|
9
103
|
Agents that keep working through errors. Opt-in; one default change (below).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentx-dev
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.1
|
|
4
4
|
Summary: A production-grade Python framework for building LLM agents. Multi-provider chat, permission-gated tools, RAG (in-mem + Chroma/Qdrant/pgvector), semantic memory, Supervisor + Handoffs multi-agent orchestration with streaming, evals harness, prompt caching, Batch API, prompt-optimizer, MCP integration.
|
|
5
5
|
Author-email: Bruce-Arhin Shadrach <brucearhin098@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -56,6 +56,7 @@ Requires-Dist: openpyxl>=3.1; extra == "excel"
|
|
|
56
56
|
Provides-Extra: dev
|
|
57
57
|
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
58
58
|
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
59
|
+
Requires-Dist: httpx>=0.24; extra == "dev"
|
|
59
60
|
Requires-Dist: numpy>=1.24; extra == "dev"
|
|
60
61
|
Requires-Dist: pandas>=1.5; extra == "dev"
|
|
61
62
|
Requires-Dist: openpyxl>=3.1; extra == "dev"
|
|
@@ -82,6 +83,44 @@ you can paste and run.
|
|
|
82
83
|
|
|
83
84
|
---
|
|
84
85
|
|
|
86
|
+
## What's new in 3.6 — sub-agents
|
|
87
|
+
|
|
88
|
+
A Supervisor can now create its own helpers, like Claude Code's Task tool.
|
|
89
|
+
The planner defines a helper inline (its own instructions and tools), and a
|
|
90
|
+
specialist can hand a side job to a fresh agent and get a short summary back.
|
|
91
|
+
You set the most a helper may ever do, once.
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from agentx_dev import Supervisor, SpawnConfig
|
|
95
|
+
|
|
96
|
+
supervisor = Supervisor(
|
|
97
|
+
model=model, agents=my_specialists,
|
|
98
|
+
spawn_config=SpawnConfig(enabled=True, capabilities={"web", "files_read"}),
|
|
99
|
+
)
|
|
100
|
+
result = supervisor.run("Compare the pricing pages of our three competitors")
|
|
101
|
+
print(result.spawned) # the helpers it created, with outcomes
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
| Feature | What you get |
|
|
105
|
+
|---|---|
|
|
106
|
+
| **Inline helpers** | A plan step can carry `new_agent` (name, instructions, tools). Reused by name, discarded when the run ends. |
|
|
107
|
+
| **`delegate` tool** | A specialist hands part of its work to a fresh sub-agent (clean context) and gets a summary back. |
|
|
108
|
+
| **One ceiling** | `SpawnConfig(capabilities=..., tools=..., max_spawns=..., max_depth=...)` bounds every helper. Over-asks are clipped, not fatal. |
|
|
109
|
+
| **Sync and async** | `AsyncSupervisor` takes `spawn_config=` too; spawned steps run in parallel. |
|
|
110
|
+
| **Persistent mode** | On by default with a safe ceiling (web plus read-only files); helpers share the run deadline; recovery plans can spawn a replacement. |
|
|
111
|
+
| **Ask the operator** | `Supervisor(ask_user=True)` lets the planner ask for facts the task leaves out ("which three competitors?") and gives every agent an `ask_user` tool. Works in a notebook's input box and in terminals; `ask_user=my_function` routes questions through your own channel. |
|
|
112
|
+
| **Long-term memory** | `Supervisor(memory=store)` (any vector store: `VectorStore`, Chroma, Qdrant, pgvector) gives the planner and every step the few relevant stored items, saves operator answers and finished results, and answers an exact repeat of a question from memory instead of asking again. |
|
|
113
|
+
|
|
114
|
+
[Guide](docs/guides/sub-agents.md). To let the Supervisor ask you for missing facts, see [Asking the operator](docs/guides/sub-agents.md#asking-the-operator). To keep what it learns between runs, see [Long-term memory](docs/guides/sub-agents.md#long-term-memory).
|
|
115
|
+
|
|
116
|
+
### Upgrade notes
|
|
117
|
+
|
|
118
|
+
- Nothing is on unless you configure it, except persistent supervisors (`persistence=` with no `spawn_config`), which now allow web and read-only file helpers. Pass `spawn_config=SpawnConfig(enabled=False)` to opt out.
|
|
119
|
+
- Helpers a Supervisor spawns no longer stay on it after the run.
|
|
120
|
+
- A spawn is no longer refused because an existing specialist has the same tools.
|
|
121
|
+
|
|
122
|
+
Full notes: [docs/guides/upgrading.md](docs/guides/upgrading.md).
|
|
123
|
+
|
|
85
124
|
## What's new in 3.5 — agents that keep working
|
|
86
125
|
|
|
87
126
|
Long jobs no longer end at the first wall. Turn on persistent mode and
|
|
@@ -460,9 +499,14 @@ Add optional providers / integrations as extras:
|
|
|
460
499
|
pip install agentx-dev[anthropic] # enables agentx_dev.Claude
|
|
461
500
|
pip install agentx-dev[mcp] # enables MCPClient (stdio / sse / http)
|
|
462
501
|
pip install agentx-dev[otel] # OpenTelemetry observability adapter
|
|
502
|
+
pip install agentx-dev[chroma] # ChromaVectorStore (also [qdrant], [pgvector])
|
|
463
503
|
pip install agentx-dev[all] # everything above
|
|
464
504
|
```
|
|
465
505
|
|
|
506
|
+
A plain `pip install agentx-dev` does not install these on purpose (most users need one provider
|
|
507
|
+
and one store). If a class says it needs a package, install the extra it names, with the same
|
|
508
|
+
Python that runs your code: `python -m pip install "agentx-dev[chroma]"`.
|
|
509
|
+
|
|
466
510
|
Requires Python **3.10+** (the codebase uses PEP 604 union types).
|
|
467
511
|
|
|
468
512
|
Set your provider API key as an environment variable:
|
|
@@ -844,14 +888,16 @@ supervisor = Supervisor(
|
|
|
844
888
|
|
|
845
889
|
Recognized capability keywords the planner can request:
|
|
846
890
|
- `"web"` — installs `web_search` + `web_fetch`.
|
|
891
|
+
- `"files_read"` — read / list / find / grep inside the sandbox (read-only).
|
|
847
892
|
- `"files"` — read / write / edit / list inside the sandbox.
|
|
848
893
|
- `"code"` — `run_python`.
|
|
849
|
-
- `"delete"` —
|
|
894
|
+
- `"delete"` — grants `delete_files` only (the `delete_path` tool inside the
|
|
895
|
+
sandbox); it adds no read or write access.
|
|
850
896
|
|
|
851
|
-
|
|
852
|
-
(
|
|
853
|
-
|
|
854
|
-
|
|
897
|
+
Since 3.6 a spawn is not refused because an existing specialist has the
|
|
898
|
+
same tools (a helper can carry its own instructions), the planner can
|
|
899
|
+
write those instructions inline, and a `capabilities=` / `tools=` ceiling
|
|
900
|
+
replaces per-spawn approval. See [Sub-agents](docs/guides/sub-agents.md).
|
|
855
901
|
|
|
856
902
|
### AsyncSupervisor
|
|
857
903
|
|
|
@@ -9,6 +9,44 @@ you can paste and run.
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## What's new in 3.6 — sub-agents
|
|
13
|
+
|
|
14
|
+
A Supervisor can now create its own helpers, like Claude Code's Task tool.
|
|
15
|
+
The planner defines a helper inline (its own instructions and tools), and a
|
|
16
|
+
specialist can hand a side job to a fresh agent and get a short summary back.
|
|
17
|
+
You set the most a helper may ever do, once.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from agentx_dev import Supervisor, SpawnConfig
|
|
21
|
+
|
|
22
|
+
supervisor = Supervisor(
|
|
23
|
+
model=model, agents=my_specialists,
|
|
24
|
+
spawn_config=SpawnConfig(enabled=True, capabilities={"web", "files_read"}),
|
|
25
|
+
)
|
|
26
|
+
result = supervisor.run("Compare the pricing pages of our three competitors")
|
|
27
|
+
print(result.spawned) # the helpers it created, with outcomes
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Feature | What you get |
|
|
31
|
+
|---|---|
|
|
32
|
+
| **Inline helpers** | A plan step can carry `new_agent` (name, instructions, tools). Reused by name, discarded when the run ends. |
|
|
33
|
+
| **`delegate` tool** | A specialist hands part of its work to a fresh sub-agent (clean context) and gets a summary back. |
|
|
34
|
+
| **One ceiling** | `SpawnConfig(capabilities=..., tools=..., max_spawns=..., max_depth=...)` bounds every helper. Over-asks are clipped, not fatal. |
|
|
35
|
+
| **Sync and async** | `AsyncSupervisor` takes `spawn_config=` too; spawned steps run in parallel. |
|
|
36
|
+
| **Persistent mode** | On by default with a safe ceiling (web plus read-only files); helpers share the run deadline; recovery plans can spawn a replacement. |
|
|
37
|
+
| **Ask the operator** | `Supervisor(ask_user=True)` lets the planner ask for facts the task leaves out ("which three competitors?") and gives every agent an `ask_user` tool. Works in a notebook's input box and in terminals; `ask_user=my_function` routes questions through your own channel. |
|
|
38
|
+
| **Long-term memory** | `Supervisor(memory=store)` (any vector store: `VectorStore`, Chroma, Qdrant, pgvector) gives the planner and every step the few relevant stored items, saves operator answers and finished results, and answers an exact repeat of a question from memory instead of asking again. |
|
|
39
|
+
|
|
40
|
+
[Guide](docs/guides/sub-agents.md). To let the Supervisor ask you for missing facts, see [Asking the operator](docs/guides/sub-agents.md#asking-the-operator). To keep what it learns between runs, see [Long-term memory](docs/guides/sub-agents.md#long-term-memory).
|
|
41
|
+
|
|
42
|
+
### Upgrade notes
|
|
43
|
+
|
|
44
|
+
- Nothing is on unless you configure it, except persistent supervisors (`persistence=` with no `spawn_config`), which now allow web and read-only file helpers. Pass `spawn_config=SpawnConfig(enabled=False)` to opt out.
|
|
45
|
+
- Helpers a Supervisor spawns no longer stay on it after the run.
|
|
46
|
+
- A spawn is no longer refused because an existing specialist has the same tools.
|
|
47
|
+
|
|
48
|
+
Full notes: [docs/guides/upgrading.md](docs/guides/upgrading.md).
|
|
49
|
+
|
|
12
50
|
## What's new in 3.5 — agents that keep working
|
|
13
51
|
|
|
14
52
|
Long jobs no longer end at the first wall. Turn on persistent mode and
|
|
@@ -387,9 +425,14 @@ Add optional providers / integrations as extras:
|
|
|
387
425
|
pip install agentx-dev[anthropic] # enables agentx_dev.Claude
|
|
388
426
|
pip install agentx-dev[mcp] # enables MCPClient (stdio / sse / http)
|
|
389
427
|
pip install agentx-dev[otel] # OpenTelemetry observability adapter
|
|
428
|
+
pip install agentx-dev[chroma] # ChromaVectorStore (also [qdrant], [pgvector])
|
|
390
429
|
pip install agentx-dev[all] # everything above
|
|
391
430
|
```
|
|
392
431
|
|
|
432
|
+
A plain `pip install agentx-dev` does not install these on purpose (most users need one provider
|
|
433
|
+
and one store). If a class says it needs a package, install the extra it names, with the same
|
|
434
|
+
Python that runs your code: `python -m pip install "agentx-dev[chroma]"`.
|
|
435
|
+
|
|
393
436
|
Requires Python **3.10+** (the codebase uses PEP 604 union types).
|
|
394
437
|
|
|
395
438
|
Set your provider API key as an environment variable:
|
|
@@ -771,14 +814,16 @@ supervisor = Supervisor(
|
|
|
771
814
|
|
|
772
815
|
Recognized capability keywords the planner can request:
|
|
773
816
|
- `"web"` — installs `web_search` + `web_fetch`.
|
|
817
|
+
- `"files_read"` — read / list / find / grep inside the sandbox (read-only).
|
|
774
818
|
- `"files"` — read / write / edit / list inside the sandbox.
|
|
775
819
|
- `"code"` — `run_python`.
|
|
776
|
-
- `"delete"` —
|
|
820
|
+
- `"delete"` — grants `delete_files` only (the `delete_path` tool inside the
|
|
821
|
+
sandbox); it adds no read or write access.
|
|
777
822
|
|
|
778
|
-
|
|
779
|
-
(
|
|
780
|
-
|
|
781
|
-
|
|
823
|
+
Since 3.6 a spawn is not refused because an existing specialist has the
|
|
824
|
+
same tools (a helper can carry its own instructions), the planner can
|
|
825
|
+
write those instructions inline, and a `capabilities=` / `tools=` ceiling
|
|
826
|
+
replaces per-spawn approval. See [Sub-agents](docs/guides/sub-agents.md).
|
|
782
827
|
|
|
783
828
|
### AsyncSupervisor
|
|
784
829
|
|
|
@@ -1808,7 +1808,13 @@ class Claude(BaseChatModel):
|
|
|
1808
1808
|
drop or clamp it, retry, and remember it for this model.
|
|
1809
1809
|
Logged at WARNING. Set False to surface the raw error.
|
|
1810
1810
|
"""
|
|
1811
|
-
|
|
1811
|
+
try:
|
|
1812
|
+
import anthropic as _anthropic
|
|
1813
|
+
except ImportError as e:
|
|
1814
|
+
from agentx_dev._optional import optional_import_error
|
|
1815
|
+
raise optional_import_error(
|
|
1816
|
+
"Claude", e, modules=("anthropic",), pip="anthropic", extra="anthropic",
|
|
1817
|
+
) from e
|
|
1812
1818
|
self._anthropic = _anthropic
|
|
1813
1819
|
self.model_name = model
|
|
1814
1820
|
self.max_tokens = max_tokens
|
|
@@ -2008,6 +2014,10 @@ class Claude(BaseChatModel):
|
|
|
2008
2014
|
try:
|
|
2009
2015
|
final = stream.get_final_message()
|
|
2010
2016
|
self._record_usage(final)
|
|
2017
|
+
except CostBudgetExceeded:
|
|
2018
|
+
# The cap is a control signal, not a bookkeeping hiccup --
|
|
2019
|
+
# swallowing it here meant a streaming run never hit it.
|
|
2020
|
+
raise
|
|
2011
2021
|
except Exception as e:
|
|
2012
2022
|
logger.warning(f"Failed to record streaming usage: {e}")
|
|
2013
2023
|
finally:
|
|
@@ -2030,6 +2040,10 @@ class Claude(BaseChatModel):
|
|
|
2030
2040
|
try:
|
|
2031
2041
|
final = await stream.get_final_message()
|
|
2032
2042
|
self._record_usage(final)
|
|
2043
|
+
except CostBudgetExceeded:
|
|
2044
|
+
# The cap is a control signal, not a bookkeeping hiccup --
|
|
2045
|
+
# swallowing it here meant a streaming run never hit it.
|
|
2046
|
+
raise
|
|
2033
2047
|
except Exception as e:
|
|
2034
2048
|
logger.warning(f"Failed to record streaming usage: {e}")
|
|
2035
2049
|
finally:
|