scgnb666 0.1.0__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.
- scgnb666-0.1.0/PKG-INFO +210 -0
- scgnb666-0.1.0/README.md +160 -0
- scgnb666-0.1.0/polyagent/__init__.py +10 -0
- scgnb666-0.1.0/polyagent/cli/__init__.py +682 -0
- scgnb666-0.1.0/polyagent/cli/__main__.py +6 -0
- scgnb666-0.1.0/polyagent/cli/demo.py +89 -0
- scgnb666-0.1.0/polyagent/config.py +41 -0
- scgnb666-0.1.0/polyagent/core/__init__.py +52 -0
- scgnb666-0.1.0/polyagent/core/agent.py +92 -0
- scgnb666-0.1.0/polyagent/core/exceptions.py +35 -0
- scgnb666-0.1.0/polyagent/core/types.py +92 -0
- scgnb666-0.1.0/polyagent/eval/__init__.py +18 -0
- scgnb666-0.1.0/polyagent/eval/dataset.py +23 -0
- scgnb666-0.1.0/polyagent/eval/runner.py +29 -0
- scgnb666-0.1.0/polyagent/eval/scorers.py +107 -0
- scgnb666-0.1.0/polyagent/eval/types.py +42 -0
- scgnb666-0.1.0/polyagent/llm/__init__.py +37 -0
- scgnb666-0.1.0/polyagent/llm/client.py +43 -0
- scgnb666-0.1.0/polyagent/llm/deepseek.py +266 -0
- scgnb666-0.1.0/polyagent/llm/middleware.py +168 -0
- scgnb666-0.1.0/polyagent/llm/mock.py +64 -0
- scgnb666-0.1.0/polyagent/llm/provider.py +22 -0
- scgnb666-0.1.0/polyagent/llm/types.py +27 -0
- scgnb666-0.1.0/polyagent/memory/__init__.py +15 -0
- scgnb666-0.1.0/polyagent/memory/base.py +31 -0
- scgnb666-0.1.0/polyagent/memory/buffer.py +26 -0
- scgnb666-0.1.0/polyagent/memory/compressor.py +70 -0
- scgnb666-0.1.0/polyagent/memory/vector_memory.py +31 -0
- scgnb666-0.1.0/polyagent/observability/__init__.py +32 -0
- scgnb666-0.1.0/polyagent/observability/exporters.py +71 -0
- scgnb666-0.1.0/polyagent/observability/logging.py +29 -0
- scgnb666-0.1.0/polyagent/observability/metrics.py +27 -0
- scgnb666-0.1.0/polyagent/observability/middleware.py +45 -0
- scgnb666-0.1.0/polyagent/observability/report.py +29 -0
- scgnb666-0.1.0/polyagent/observability/tracer.py +78 -0
- scgnb666-0.1.0/polyagent/orchestration/__init__.py +20 -0
- scgnb666-0.1.0/polyagent/orchestration/orchestrator.py +117 -0
- scgnb666-0.1.0/polyagent/orchestration/roles.py +78 -0
- scgnb666-0.1.0/polyagent/orchestration/types.py +36 -0
- scgnb666-0.1.0/polyagent/persistence/__init__.py +6 -0
- scgnb666-0.1.0/polyagent/persistence/chat_store.py +235 -0
- scgnb666-0.1.0/polyagent/persistence/store.py +114 -0
- scgnb666-0.1.0/polyagent/rag/__init__.py +18 -0
- scgnb666-0.1.0/polyagent/rag/embedder.py +67 -0
- scgnb666-0.1.0/polyagent/rag/index.py +51 -0
- scgnb666-0.1.0/polyagent/rag/splitter.py +25 -0
- scgnb666-0.1.0/polyagent/rag/vectorstore.py +82 -0
- scgnb666-0.1.0/polyagent/skills/__init__.py +25 -0
- scgnb666-0.1.0/polyagent/skills/builtins/datetime_skill.py +75 -0
- scgnb666-0.1.0/polyagent/skills/builtins/file_analyzer_skill.py +97 -0
- scgnb666-0.1.0/polyagent/skills/builtins/weather_skill.py +56 -0
- scgnb666-0.1.0/polyagent/skills/installer.py +128 -0
- scgnb666-0.1.0/polyagent/skills/registry.py +57 -0
- scgnb666-0.1.0/polyagent/tools/__init__.py +40 -0
- scgnb666-0.1.0/polyagent/tools/base.py +47 -0
- scgnb666-0.1.0/polyagent/tools/builtins.py +656 -0
- scgnb666-0.1.0/polyagent/tools/registry.py +73 -0
- scgnb666-0.1.0/polyagent/tools/sandbox.py +78 -0
- scgnb666-0.1.0/pyproject.toml +115 -0
- scgnb666-0.1.0/scgnb666.egg-info/PKG-INFO +210 -0
- scgnb666-0.1.0/scgnb666.egg-info/SOURCES.txt +81 -0
- scgnb666-0.1.0/scgnb666.egg-info/dependency_links.txt +1 -0
- scgnb666-0.1.0/scgnb666.egg-info/entry_points.txt +2 -0
- scgnb666-0.1.0/scgnb666.egg-info/requires.txt +22 -0
- scgnb666-0.1.0/scgnb666.egg-info/top_level.txt +1 -0
- scgnb666-0.1.0/setup.cfg +4 -0
- scgnb666-0.1.0/tests/test_agent.py +33 -0
- scgnb666-0.1.0/tests/test_chat_store.py +67 -0
- scgnb666-0.1.0/tests/test_cli.py +54 -0
- scgnb666-0.1.0/tests/test_eval.py +66 -0
- scgnb666-0.1.0/tests/test_exporters.py +58 -0
- scgnb666-0.1.0/tests/test_llm_deepseek.py +57 -0
- scgnb666-0.1.0/tests/test_llm_middleware.py +106 -0
- scgnb666-0.1.0/tests/test_llm_mock.py +47 -0
- scgnb666-0.1.0/tests/test_memory.py +64 -0
- scgnb666-0.1.0/tests/test_observability.py +107 -0
- scgnb666-0.1.0/tests/test_orchestration.py +120 -0
- scgnb666-0.1.0/tests/test_persistence.py +63 -0
- scgnb666-0.1.0/tests/test_rag.py +65 -0
- scgnb666-0.1.0/tests/test_sandbox.py +44 -0
- scgnb666-0.1.0/tests/test_skills.py +97 -0
- scgnb666-0.1.0/tests/test_smoke.py +38 -0
- scgnb666-0.1.0/tests/test_tools.py +400 -0
scgnb666-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scgnb666
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: PolyAgent — a model-agnostic multi-agent orchestration framework.
|
|
5
|
+
Author-email: PolyAgent Contributors <noreply@example.com>
|
|
6
|
+
Maintainer-email: PolyAgent Maintainers <noreply@example.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/ggg0203/polyagent
|
|
9
|
+
Project-URL: Repository, https://github.com/ggg0203/polyagent
|
|
10
|
+
Project-URL: Documentation, https://github.com/ggg0203/polyagent#readme
|
|
11
|
+
Project-URL: Issues, https://github.com/ggg0203/polyagent/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/ggg0203/polyagent/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: agent,llm,multi-agent,orchestration,tool-use,rag,openai,deepseek,middleware
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
22
|
+
Classifier: Framework :: AsyncIO
|
|
23
|
+
Classifier: Framework :: Pydantic
|
|
24
|
+
Classifier: Framework :: Pydantic :: 2
|
|
25
|
+
Classifier: Operating System :: OS Independent
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Classifier: Typing :: Typed
|
|
29
|
+
Requires-Python: >=3.11
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
Requires-Dist: pydantic>=2.6
|
|
32
|
+
Requires-Dist: pydantic-settings>=2.2
|
|
33
|
+
Requires-Dist: httpx>=0.27
|
|
34
|
+
Requires-Dist: typer>=0.12
|
|
35
|
+
Requires-Dist: structlog>=24.1
|
|
36
|
+
Requires-Dist: anyio>=4.3
|
|
37
|
+
Provides-Extra: rag
|
|
38
|
+
Requires-Dist: chromadb>=0.5; extra == "rag"
|
|
39
|
+
Requires-Dist: fastembed>=0.3; extra == "rag"
|
|
40
|
+
Requires-Dist: sentence-transformers>=3.0; extra == "rag"
|
|
41
|
+
Provides-Extra: observability
|
|
42
|
+
Requires-Dist: opentelemetry-sdk>=1.25; extra == "observability"
|
|
43
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.25; extra == "observability"
|
|
44
|
+
Requires-Dist: prometheus_client>=0.20; extra == "observability"
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
48
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
49
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
50
|
+
|
|
51
|
+
# PolyAgent
|
|
52
|
+
|
|
53
|
+
> A **model-agnostic multi-agent orchestration framework** — declare Agent roles,
|
|
54
|
+
> let the orchestrator run them through a `Plan → Execute(parallel) → Critique → Synthesize`
|
|
55
|
+
> pipeline, with reliability middleware and observability at every layer.
|
|
56
|
+
|
|
57
|
+
[](./.github/workflows/ci.yml)
|
|
58
|
+

|
|
59
|
+

|
|
60
|
+
|
|
61
|
+
`polyagent` is a pure-backend, dependency-light Python framework for building
|
|
62
|
+
**multi-agent systems on top of LLMs**. It ships as a reusable **SDK** plus a
|
|
63
|
+
**CLI**. No UI, no web framework — just orchestration.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Why
|
|
68
|
+
|
|
69
|
+
A single agent calling an LLM directly hits three walls on real work:
|
|
70
|
+
|
|
71
|
+
1. **Context explosion** — one agent planning + executing + summarizing balloons the prompt.
|
|
72
|
+
2. **Single-point unreliability** — one timeout / rate-limit kills the whole task.
|
|
73
|
+
3. **No observability, no evaluation** — you can't tell what it cost or how good it was.
|
|
74
|
+
|
|
75
|
+
PolyAgent answers this with **role separation + an orchestration layer + a
|
|
76
|
+
reliability middleware chain**, turning raw LLM calls into a schedulable,
|
|
77
|
+
degradable, observable system.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Install
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# editable install with dev tooling
|
|
85
|
+
pip install -e ".[dev]"
|
|
86
|
+
|
|
87
|
+
# (optional) RAG extras — heavier vector backends
|
|
88
|
+
pip install -e ".[rag]"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Requires Python ≥ 3.11.
|
|
92
|
+
|
|
93
|
+
## Quick start
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
polyagent version # sanity check
|
|
97
|
+
polyagent run "build a small web app" # run the full multi-agent pipeline (mock, offline)
|
|
98
|
+
polyagent eval # run the eval dataset, print pass-rate
|
|
99
|
+
polyagent chat # interactive single-agent chat (Ctrl-D to exit)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
SDK usage:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
import asyncio
|
|
106
|
+
from polyagent.core import Agent, AgentSpec
|
|
107
|
+
from polyagent.llm import LLMClient, MockProvider
|
|
108
|
+
from polyagent.orchestration import Orchestrator, Planner, Worker, Critic, Synthesizer
|
|
109
|
+
from polyagent.observability import Tracer
|
|
110
|
+
|
|
111
|
+
async def main():
|
|
112
|
+
tracer = Tracer()
|
|
113
|
+
# ...assemble Planner/Worker/Critic/Synthesizer with LLMClients...
|
|
114
|
+
orch = Orchestrator(planner, worker, critic, synth, tracer=tracer)
|
|
115
|
+
result = await orch.run("your goal")
|
|
116
|
+
print(result.answer, result.task_graph, result.estimated_cost_usd)
|
|
117
|
+
|
|
118
|
+
asyncio.run(main())
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Architecture
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
polyagent/
|
|
127
|
+
├── core/ # Agent, Message/Role/ToolCall, AgentSpec, exceptions
|
|
128
|
+
├── llm/ # LLMProvider protocol, DeepSeek/Mock, reliability middleware, LLMClient
|
|
129
|
+
├── tools/ # Tool base, registry, pydantic->JSON Schema, 5 built-ins, sandbox
|
|
130
|
+
├── memory/ # ConversationBuffer, VectorMemory, context compressors
|
|
131
|
+
├── rag/ # Embedder/VectorStore protocols, HashEmbedder, InMemoryVectorStore, TextSplitter, RAGIndex
|
|
132
|
+
├── orchestration/ # Planner/Worker/Critic/Synthesizer, DAG scheduler, critique retry
|
|
133
|
+
├── observability/ # Tracer(span tree), Metrics, structlog, ObservabilityMiddleware
|
|
134
|
+
├── eval/ # Dataset, Scorer, EvalRunner, EvalReport
|
|
135
|
+
└── cli/ # typer: run / chat / eval / version
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full design.
|
|
139
|
+
|
|
140
|
+
### Reliability middleware chain (LLM layer)
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
request → RateLimit → Retry(backoff+jitter) → Fallback → BudgetCheck → provider → CostAccount → response
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Each link is composable and unit-testable; `ObservabilityMiddleware` adds an `llm.chat` span per call.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Roadmap — all done ✅
|
|
151
|
+
|
|
152
|
+
| Milestone | Status | What |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| M0 | ✅ | scaffold: pyproject, package tree, ruff/mypy, CI, smoke tests |
|
|
155
|
+
| M1 | ✅ | LLM provider abstraction + reliability middleware + single agent |
|
|
156
|
+
| M2 | ✅ | tool system + pydantic→schema + 5 built-ins + sandbox |
|
|
157
|
+
| M3 | ✅ | memory + RAG (pluggable embedder/vectorstore) |
|
|
158
|
+
| M4 | ✅ | orchestrator: 4-role pipeline + DAG + critique fallback |
|
|
159
|
+
| M5 | ✅ | observability: span-tree tracing + metrics + structured logs |
|
|
160
|
+
| M6 | ✅ | CLI: run / chat / eval / version |
|
|
161
|
+
| M7 | ✅ | eval: datasets + scorers + runner |
|
|
162
|
+
| M8 | ✅ | docs + repo-analysis showcase |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Showcase: code repository analysis
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
python examples/repo_analysis/analyze.py .
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
A Planner decomposes "analyze repo" into `inventory → entrypoints → tests → smells → report`;
|
|
173
|
+
Workers carry `grep_files` + `read_file`; a Critic reviews; a Synthesizer writes the report.
|
|
174
|
+
Mock mode runs offline. See [examples/repo_analysis/README.md](examples/repo_analysis/README.md).
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Resume highlights
|
|
179
|
+
|
|
180
|
+
- **LLM orchestration & reliability** — provider protocol, DeepSeek + Mock,
|
|
181
|
+
retry / fallback / rate-limit / token-budget / cost accounting (`llm/`).
|
|
182
|
+
- **Tool-use & plugins** — function-calling schema auto-generated from pydantic,
|
|
183
|
+
registry, 5 built-in tools, subprocess sandbox (`tools/`).
|
|
184
|
+
- **Memory & RAG** — short-term buffer, vector memory, pluggable embedder/vectorstore,
|
|
185
|
+
context compression (`memory/`, `rag/`).
|
|
186
|
+
- **Observability & evaluation** — contextvars span-tree tracing, metrics, structlog,
|
|
187
|
+
eval datasets + scorers + pass-rate (`observability/`, `eval/`).
|
|
188
|
+
- **Multi-agent architecture** — role pipeline with DAG scheduling, parallel workers,
|
|
189
|
+
critique-driven retry, failure blocking (`orchestration/`).
|
|
190
|
+
|
|
191
|
+
**The one-liner:** "A model-agnostic multi-agent orchestration framework that turns
|
|
192
|
+
raw LLM calls into a schedulable, degradable, observable, evaluable system — SDK + CLI,
|
|
193
|
+
55 offline tests, zero UI."
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Testing
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
pytest -q # 55 tests, all offline (MockProvider)
|
|
201
|
+
ruff check . # clean
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
CI runs on Python 3.11 / 3.12 / 3.13.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT.
|
scgnb666-0.1.0/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# PolyAgent
|
|
2
|
+
|
|
3
|
+
> A **model-agnostic multi-agent orchestration framework** — declare Agent roles,
|
|
4
|
+
> let the orchestrator run them through a `Plan → Execute(parallel) → Critique → Synthesize`
|
|
5
|
+
> pipeline, with reliability middleware and observability at every layer.
|
|
6
|
+
|
|
7
|
+
[](./.github/workflows/ci.yml)
|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
`polyagent` is a pure-backend, dependency-light Python framework for building
|
|
12
|
+
**multi-agent systems on top of LLMs**. It ships as a reusable **SDK** plus a
|
|
13
|
+
**CLI**. No UI, no web framework — just orchestration.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Why
|
|
18
|
+
|
|
19
|
+
A single agent calling an LLM directly hits three walls on real work:
|
|
20
|
+
|
|
21
|
+
1. **Context explosion** — one agent planning + executing + summarizing balloons the prompt.
|
|
22
|
+
2. **Single-point unreliability** — one timeout / rate-limit kills the whole task.
|
|
23
|
+
3. **No observability, no evaluation** — you can't tell what it cost or how good it was.
|
|
24
|
+
|
|
25
|
+
PolyAgent answers this with **role separation + an orchestration layer + a
|
|
26
|
+
reliability middleware chain**, turning raw LLM calls into a schedulable,
|
|
27
|
+
degradable, observable system.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# editable install with dev tooling
|
|
35
|
+
pip install -e ".[dev]"
|
|
36
|
+
|
|
37
|
+
# (optional) RAG extras — heavier vector backends
|
|
38
|
+
pip install -e ".[rag]"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Requires Python ≥ 3.11.
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
polyagent version # sanity check
|
|
47
|
+
polyagent run "build a small web app" # run the full multi-agent pipeline (mock, offline)
|
|
48
|
+
polyagent eval # run the eval dataset, print pass-rate
|
|
49
|
+
polyagent chat # interactive single-agent chat (Ctrl-D to exit)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
SDK usage:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import asyncio
|
|
56
|
+
from polyagent.core import Agent, AgentSpec
|
|
57
|
+
from polyagent.llm import LLMClient, MockProvider
|
|
58
|
+
from polyagent.orchestration import Orchestrator, Planner, Worker, Critic, Synthesizer
|
|
59
|
+
from polyagent.observability import Tracer
|
|
60
|
+
|
|
61
|
+
async def main():
|
|
62
|
+
tracer = Tracer()
|
|
63
|
+
# ...assemble Planner/Worker/Critic/Synthesizer with LLMClients...
|
|
64
|
+
orch = Orchestrator(planner, worker, critic, synth, tracer=tracer)
|
|
65
|
+
result = await orch.run("your goal")
|
|
66
|
+
print(result.answer, result.task_graph, result.estimated_cost_usd)
|
|
67
|
+
|
|
68
|
+
asyncio.run(main())
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Architecture
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
polyagent/
|
|
77
|
+
├── core/ # Agent, Message/Role/ToolCall, AgentSpec, exceptions
|
|
78
|
+
├── llm/ # LLMProvider protocol, DeepSeek/Mock, reliability middleware, LLMClient
|
|
79
|
+
├── tools/ # Tool base, registry, pydantic->JSON Schema, 5 built-ins, sandbox
|
|
80
|
+
├── memory/ # ConversationBuffer, VectorMemory, context compressors
|
|
81
|
+
├── rag/ # Embedder/VectorStore protocols, HashEmbedder, InMemoryVectorStore, TextSplitter, RAGIndex
|
|
82
|
+
├── orchestration/ # Planner/Worker/Critic/Synthesizer, DAG scheduler, critique retry
|
|
83
|
+
├── observability/ # Tracer(span tree), Metrics, structlog, ObservabilityMiddleware
|
|
84
|
+
├── eval/ # Dataset, Scorer, EvalRunner, EvalReport
|
|
85
|
+
└── cli/ # typer: run / chat / eval / version
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full design.
|
|
89
|
+
|
|
90
|
+
### Reliability middleware chain (LLM layer)
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
request → RateLimit → Retry(backoff+jitter) → Fallback → BudgetCheck → provider → CostAccount → response
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Each link is composable and unit-testable; `ObservabilityMiddleware` adds an `llm.chat` span per call.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Roadmap — all done ✅
|
|
101
|
+
|
|
102
|
+
| Milestone | Status | What |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| M0 | ✅ | scaffold: pyproject, package tree, ruff/mypy, CI, smoke tests |
|
|
105
|
+
| M1 | ✅ | LLM provider abstraction + reliability middleware + single agent |
|
|
106
|
+
| M2 | ✅ | tool system + pydantic→schema + 5 built-ins + sandbox |
|
|
107
|
+
| M3 | ✅ | memory + RAG (pluggable embedder/vectorstore) |
|
|
108
|
+
| M4 | ✅ | orchestrator: 4-role pipeline + DAG + critique fallback |
|
|
109
|
+
| M5 | ✅ | observability: span-tree tracing + metrics + structured logs |
|
|
110
|
+
| M6 | ✅ | CLI: run / chat / eval / version |
|
|
111
|
+
| M7 | ✅ | eval: datasets + scorers + runner |
|
|
112
|
+
| M8 | ✅ | docs + repo-analysis showcase |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Showcase: code repository analysis
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
python examples/repo_analysis/analyze.py .
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
A Planner decomposes "analyze repo" into `inventory → entrypoints → tests → smells → report`;
|
|
123
|
+
Workers carry `grep_files` + `read_file`; a Critic reviews; a Synthesizer writes the report.
|
|
124
|
+
Mock mode runs offline. See [examples/repo_analysis/README.md](examples/repo_analysis/README.md).
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Resume highlights
|
|
129
|
+
|
|
130
|
+
- **LLM orchestration & reliability** — provider protocol, DeepSeek + Mock,
|
|
131
|
+
retry / fallback / rate-limit / token-budget / cost accounting (`llm/`).
|
|
132
|
+
- **Tool-use & plugins** — function-calling schema auto-generated from pydantic,
|
|
133
|
+
registry, 5 built-in tools, subprocess sandbox (`tools/`).
|
|
134
|
+
- **Memory & RAG** — short-term buffer, vector memory, pluggable embedder/vectorstore,
|
|
135
|
+
context compression (`memory/`, `rag/`).
|
|
136
|
+
- **Observability & evaluation** — contextvars span-tree tracing, metrics, structlog,
|
|
137
|
+
eval datasets + scorers + pass-rate (`observability/`, `eval/`).
|
|
138
|
+
- **Multi-agent architecture** — role pipeline with DAG scheduling, parallel workers,
|
|
139
|
+
critique-driven retry, failure blocking (`orchestration/`).
|
|
140
|
+
|
|
141
|
+
**The one-liner:** "A model-agnostic multi-agent orchestration framework that turns
|
|
142
|
+
raw LLM calls into a schedulable, degradable, observable, evaluable system — SDK + CLI,
|
|
143
|
+
55 offline tests, zero UI."
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Testing
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pytest -q # 55 tests, all offline (MockProvider)
|
|
151
|
+
ruff check . # clean
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
CI runs on Python 3.11 / 3.12 / 3.13.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
MIT.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""PolyAgent — a model-agnostic multi-agent orchestration framework.
|
|
2
|
+
|
|
3
|
+
Declare Agent roles, let the orchestrator run them through a
|
|
4
|
+
Plan -> Execute(parallel) -> Critique -> Synthesize pipeline, with
|
|
5
|
+
reliability middleware (retry / fallback / budget) and observability at every layer.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "0.1.0"
|
|
9
|
+
|
|
10
|
+
__all__ = ["__version__"]
|