multi-agent-swarm 3.0.0__py3-none-any.whl

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.
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: multi-agent-swarm
3
+ Version: 3.0.0
4
+ Summary: Deep research with a multi-agent swarm on Claude: free web search, parallel cited workers, every quote checked against its source
5
+ Author: Multi-Agent Swarm contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Chetan0246/multi-agent-swarm
8
+ Project-URL: Documentation, https://chetan0246.github.io/multi-agent-swarm/
9
+ Project-URL: Changelog, https://github.com/Chetan0246/multi-agent-swarm/blob/main/CHANGELOG.md
10
+ Project-URL: Issues, https://github.com/Chetan0246/multi-agent-swarm/issues
11
+ Keywords: llm,multi-agent,agents,claude,deep-research,web-search,citations,fact-checking,tinyfish,research-assistant
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Environment :: Web Environment
15
+ Classifier: Framework :: AsyncIO
16
+ Classifier: Framework :: FastAPI
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: anthropic<3,>=2.12
30
+ Requires-Dist: httpx2>=2.0
31
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
32
+ Provides-Extra: server
33
+ Requires-Dist: fastapi>=0.110; extra == "server"
34
+ Requires-Dist: uvicorn>=0.29; extra == "server"
35
+ Provides-Extra: pdf
36
+ Requires-Dist: pypdf>=4; extra == "pdf"
37
+ Provides-Extra: all
38
+ Requires-Dist: multi-agent-swarm[pdf,server]; extra == "all"
39
+ Provides-Extra: dev
40
+ Requires-Dist: multi-agent-swarm[pdf,server]; extra == "dev"
41
+ Requires-Dist: pytest>=8; extra == "dev"
42
+ Requires-Dist: pytest-cov>=5; extra == "dev"
43
+ Requires-Dist: ruff>=0.6; extra == "dev"
44
+ Requires-Dist: mypy>=1.10; extra == "dev"
45
+ Requires-Dist: matplotlib>=3.8; extra == "dev"
46
+ Requires-Dist: httpx>=0.27; extra == "dev"
47
+ Provides-Extra: docs
48
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
49
+ Dynamic: license-file
50
+
51
+ # Multi-Agent Swarm
52
+
53
+ **Ask a question; get a cited research report you can check.**
54
+
55
+ Parallel Claude workers each research one part of your question. They search the web for
56
+ **free** through [TinyFish](https://tinyfish.ai) and read the sources themselves. Code then
57
+ checks every quote a worker cites against the page it actually read, and throws away quotes
58
+ that don't match. Once the report is written, each cited sentence is checked again against
59
+ those quotes, and anything unsupported is marked.
60
+
61
+ [![CI](https://github.com/Chetan0246/multi-agent-swarm/actions/workflows/ci.yml/badge.svg)](https://github.com/Chetan0246/multi-agent-swarm/actions/workflows/ci.yml)
62
+ ![Python](https://img.shields.io/badge/python-3.10%E2%80%933.13-blue)
63
+ ![Tests](https://img.shields.io/badge/tests-61%20passing-brightgreen)
64
+ ![License](https://img.shields.io/badge/license-MIT-lightgrey)
65
+ [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-informational)](https://chetan0246.github.io/multi-agent-swarm/)
66
+
67
+ ```bash
68
+ pip install "multi-agent-swarm[all]"
69
+ export ANTHROPIC_API_KEY=... # Claude
70
+ export TINYFISH_API_KEY=... # free search + fetch: https://agent.tinyfish.ai/api-keys
71
+ swarm research "How do heat pumps compare to gas boilers in cold climates?" --out report.html
72
+ ```
73
+
74
+ Try it with no keys and no cost first: `swarm research "any question" --mock --out demo.html`.
75
+
76
+ ## Features
77
+
78
+ | | |
79
+ |---|---|
80
+ | **Free web search** | TinyFish Search and Fetch as Claude tools: free within a daily allowance (12,000 searches and 1,000 pages per day). Claude's server-side search ($10 per 1,000 searches) is optional. |
81
+ | **Checked citations** | every quote is matched against the retrieved text; every cited claim is checked against its quotes; unsupported claims are marked in the report |
82
+ | **Predictable cost** | an estimate before the run, the actual cost after it, and a hard cap (`--max-usd`; presets default to $0.75, $2 or $6) |
83
+ | **Safe by default** | web text treated as data, not instructions; findings with injected instructions excluded; reports stripped of images, HTML and unknown links |
84
+ | **Your documents** | PDFs, Markdown, HTML and text files as sources (`--docs`), alone or alongside the web |
85
+ | **Follow-ups** | `--follow-up report.json` researches only what's new and rewrites the report |
86
+ | **Source filters** | domain allow/block lists, recency, news or research papers, language |
87
+ | **Exports** | Markdown, JSON, and self-contained HTML with hover-over source quotes |
88
+ | **Web UI and REST API** | `swarm serve`: live progress, history, downloads, follow-ups; Docker image |
89
+ | **Local cache** | repeated searches and pages cost nothing and use no quota |
90
+
91
+ ## How it works
92
+
93
+ ```
94
+ question ─► cost estimate (refuse if over the cap)
95
+ ─► plan: independent sub-questions, count scaled to the question
96
+ ─► one worker per sub-question, in parallel (a code scheduler, not an LLM manager)
97
+ tools: web_search / web_fetch (TinyFish), search_documents / read_document (your files)
98
+ answer = text + sources with VERBATIM quotes
99
+ code: drop any quote not found in the retrieved text
100
+ gate: ≥ 2 grounded sources from ≥ 2 domains, no injection markers
101
+ weak finding → re-researched at higher effort (low → medium → high)
102
+ ─► synthesis from clean findings only, inline [n] citations
103
+ ─► reference check → claim check (each cited sentence vs. its quotes) → sanitise
104
+ ```
105
+
106
+ The design follows the research summarised in
107
+ [docs/research](docs/research/Multi%20agent%20swarms%20state%20of%20the%20art.md):
108
+ - **Parallel workers on broad questions.** Breadth-first research is where multi-agent
109
+ systems have the strongest evidence: Anthropic's research system scored +90.2% over a
110
+ single agent.
111
+ - **No agent-to-agent chat.** Inter-agent misalignment is about a third of failures in the
112
+ MAST study.
113
+ - **Verification in code.** Adding verification gave +15.6% in MAST, and self-reported
114
+ confidence turns out to be a weak signal.
115
+
116
+ Details are in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
117
+
118
+ ## Usage
119
+
120
+ ```bash
121
+ swarm research "question" --estimate # what will it cost?
122
+ swarm research "question" --preset quick --out r.html # quick | standard | deep
123
+ swarm research "question" --news --recency-days 30 # recent news only
124
+ swarm research "question" --papers --include-domains arxiv.org,nature.com
125
+ swarm research "question" --docs ./papers ./notes.md # your files + the web
126
+ swarm research "question" --docs ./contracts --docs-only # your files only
127
+ swarm research "and costs?" --follow-up r.json --out r2.html # build on an earlier report
128
+ swarm serve # web UI on http://127.0.0.1:8000
129
+ swarm doctor --online # check keys and setup
130
+ swarm eval --estimate # known-answer evaluation vs a single agent
131
+ ```
132
+
133
+ The full flag reference is in [docs/cli.md](docs/cli.md); config files and environment
134
+ variables are in [docs/configuration.md](docs/configuration.md); the web UI and REST API are
135
+ in [docs/web-api.md](docs/web-api.md).
136
+
137
+ ## Costs and privacy
138
+
139
+ - **TinyFish search and fetch:** free within the daily allowance.
140
+ - **Claude:** charged per token. For example, `claude-opus-5-5` costs $4 per million input
141
+ tokens and $20 per million output tokens; `--worker-model claude-sonnet-5-5` makes the
142
+ workers cheaper.
143
+ - **Data flow:** your question and retrieved text go to Anthropic, and search queries go to
144
+ TinyFish. Caches stay on your machine. There is no telemetry. See
145
+ [docs/privacy.md](docs/privacy.md).
146
+
147
+ ## Engine
148
+
149
+ Under the research layer sits a general **cost-aware, fault-tolerant scheduler** for large LLM
150
+ workloads (`swarm run`, `swarm bench`). It has:
151
+ - a pull-based queue sized to the fewest agents that still finish fast;
152
+ - multi-task batching, with batch size and effort learned online by Thompson sampling;
153
+ - effort escalation for failed tasks only;
154
+ - an AIMD rate limiter that understands Anthropic's 429 types;
155
+ - a circuit breaker, request hedging, a token budget and a write-ahead journal;
156
+ - a Batches API backend at half price.
157
+
158
+ On a simulated hostile endpoint it is **9–12× cheaper per task and about 3–4× faster than a
159
+ naive swarm, with about 4× fewer agents**:
160
+
161
+ ![Cost vs time](docs/assets/pareto.svg)
162
+
163
+ ## Development
164
+
165
+ ```bash
166
+ pip install -e '.[dev]'
167
+ make lint test # ruff, mypy, 61 tests (all offline: no keys, no cost)
168
+ make bench chart # engine benchmark + charts
169
+ ```
170
+
171
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Report vulnerabilities privately: see [SECURITY.md](SECURITY.md).
172
+
173
+ ```
174
+ swarm/
175
+ research.py deep research: planner, tool-using workers, quote grounding, synthesis, claim check
176
+ search/ TinyFish (free), local documents (BM25), disk cache, mock
177
+ app.py options → configured run (shared by CLI and server)
178
+ server.py REST API + web UI (web/index.html), job store, SSE progress
179
+ export.py Markdown / JSON / safe self-contained HTML
180
+ safety.py prompt-injection detection, report sanitising
181
+ pricing.py list prices, run cost, estimates
182
+ evaluate.py known-answer evaluation vs a compute-matched single agent
183
+ orchestrator.py, policy.py, reliability.py, limiter.py, backends.py the scheduling engine
184
+ ```
185
+
186
+ ## Roadmap
187
+
188
+ - [ ] Publish `swarm eval` results on live search, then scale to a BrowseComp-style set.
189
+ - [ ] Semantic (meaning-based) matching of quotes and claims, alongside exact matching.
190
+ - [ ] Per-message effort escalation, so the prompt cache survives across effort levels.
191
+ - [ ] More search providers, and OpenTelemetry traces.
192
+
193
+ MIT licensed. Not affiliated with Anthropic or TinyFish.
@@ -0,0 +1,32 @@
1
+ multi_agent_swarm-3.0.0.dist-info/licenses/LICENSE,sha256=dcKJ3tvWMwr5V710U39DgzbnjqJwl479Ay0H3XHmyy0,1087
2
+ swarm/__init__.py,sha256=WHNW9tib4iAaocPQPYgTckcxqcvA1U6y6pBH8kXf4Zk,115
3
+ swarm/__main__.py,sha256=EdwyK8uT36emW21ZByoQO6MGaUzkZ1mFyYppXFDqKug,21819
4
+ swarm/app.py,sha256=czFh_6vxWjJDdz6wb5hfauR43o2hJ7ahKFIrMOOfiME,4089
5
+ swarm/backends.py,sha256=mF46yBXu0vuH2EX6jQOHyR6kXdCN6SGA_9f_thJmEJQ,16669
6
+ swarm/config.py,sha256=427zjVGLtNPtpG11LAT0xtR-NG-jC-EgNNrkVlkhoqo,2416
7
+ swarm/errors.py,sha256=ocF_4mcvc0OeNRZz5SoTR0YRMAAqAPwsxrAt8cmy6ME,1690
8
+ swarm/evaluate.py,sha256=_ERt6jjJaibdou9WeHLr0xyryMpnX7Yrd7yW1Jjbd4o,7097
9
+ swarm/export.py,sha256=Haz7WSPyd5hy02aAn-hrop_ZUrQViRUNEXE6rxwjQbY,7096
10
+ swarm/limiter.py,sha256=-jUmoFiolylwrqBU1SFfUtm_smZbPQ_5IjzrA-5uOec,1303
11
+ swarm/orchestrator.py,sha256=loCC2nWzWKpEB8Wqee8RAEA1ev_G77Atu9puiuJ-mB8,21134
12
+ swarm/planner.py,sha256=mbQrp3qH1kPP8JMhcv1YvO2O-PBoH5wa1AL1OFdsCWM,2313
13
+ swarm/policy.py,sha256=PWLCKhp4gfQge8Ac40fJVBgEBJnIOS9vxAiDQgNwKDo,9933
14
+ swarm/pricing.py,sha256=_61KBDf1McHTEyhJ8EUuI2-Lt2nXqafYSa7dmzQtEJY,4381
15
+ swarm/reliability.py,sha256=5YMP1XlQSVsL2_tdIQyUjDNLv2vKwYQ5EoBt5yfx_Rc,5891
16
+ swarm/research.py,sha256=1b0CPHoBtiSDjcowB05bq8pzEuYrfYcX2s7RqlQT5pU,43125
17
+ swarm/safety.py,sha256=zi4r_QNsrWWe2uAs9nNoG09FE6RurgghykmvjBArD3s,3500
18
+ swarm/server.py,sha256=EBaijwyVYEuTFvTfyjbKRsjXFyXtZT7DvSlEhYLipjI,11510
19
+ swarm/task.py,sha256=CXj7z36VQP_aXgU1oj-zVQ723_P_-VU1lvFMb-5xbu0,2774
20
+ swarm/workloads.py,sha256=WoUG-QDir0uvl6COZnehGNzMSU7oUaL5yqONf6XL814,1764
21
+ swarm/search/__init__.py,sha256=GOjxcYpFAbMmXHaeEztZiz_e5aEbnTPzAtOrCo_sOKg,1277
22
+ swarm/search/base.py,sha256=2_U0ICQJaclP7_q8ZkmDVX7Vn0w9m8XQFPx8XntBsXs,2964
23
+ swarm/search/cache.py,sha256=OL7u6N1Y-nNjtjV9Fx4ntGH1B6ngzFzQlnIfmmHmn6U,2674
24
+ swarm/search/local.py,sha256=7p4Xst9A3Dl7nif8HRaagBhJAHl-PogQbdFDqNCxVlw,3915
25
+ swarm/search/mock.py,sha256=hI5c1fZkXIQ1phBkIhqBWzbociwYb-T5cnqrZvMw_4M,1735
26
+ swarm/search/tinyfish.py,sha256=iD-FEkO8stUkyyAGC2-xHEak7kb-OCDqtdzD3YugKRE,5660
27
+ swarm/web/index.html,sha256=XxrzAY6BZZffyL5UNaK09zvB6ETu-F79AV7p0h-yhfU,11715
28
+ multi_agent_swarm-3.0.0.dist-info/METADATA,sha256=JhFDzLoONnzIzGkjTHE5w9MutGjL7m9CjUZxsezXk8k,10033
29
+ multi_agent_swarm-3.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
30
+ multi_agent_swarm-3.0.0.dist-info/entry_points.txt,sha256=TExGdBKvVwzKy6E_8tsRHKH0Hq17xM0oOXjVqZKc46o,46
31
+ multi_agent_swarm-3.0.0.dist-info/top_level.txt,sha256=ETN-2phSZezexCGmKSre_aUhRK0XI9Rzz7Fw5TCsLsQ,6
32
+ multi_agent_swarm-3.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ swarm = swarm.__main__:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Multi-Agent Swarm contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ swarm
swarm/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """multi-agent-swarm: deep research with a cost-aware, fault-tolerant multi-agent swarm."""
2
+
3
+ __version__ = "3.0.0"