agentforge-oss 0.1.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.
- agentforge_oss-0.1.0.dist-info/METADATA +397 -0
- agentforge_oss-0.1.0.dist-info/RECORD +51 -0
- agentforge_oss-0.1.0.dist-info/WHEEL +4 -0
- agentforge_oss-0.1.0.dist-info/entry_points.txt +2 -0
- agentforge_oss-0.1.0.dist-info/licenses/LICENSE +21 -0
- forge/__init__.py +183 -0
- forge/_version.py +8 -0
- forge/agents/__init__.py +7 -0
- forge/agents/agent.py +106 -0
- forge/agents/base.py +140 -0
- forge/agents/supervisor.py +174 -0
- forge/cli/__init__.py +5 -0
- forge/cli/console.py +63 -0
- forge/cli/main.py +142 -0
- forge/compliance/__init__.py +6 -0
- forge/compliance/audit.py +152 -0
- forge/compliance/redaction.py +48 -0
- forge/config.py +187 -0
- forge/exceptions.py +125 -0
- forge/memory/__init__.py +7 -0
- forge/memory/base.py +47 -0
- forge/memory/conversation.py +49 -0
- forge/memory/vector.py +77 -0
- forge/models/__init__.py +16 -0
- forge/models/base.py +73 -0
- forge/models/providers/__init__.py +14 -0
- forge/models/providers/anthropic.py +198 -0
- forge/models/providers/echo.py +171 -0
- forge/models/providers/openai.py +205 -0
- forge/models/registry.py +225 -0
- forge/models/router.py +160 -0
- forge/observability/__init__.py +16 -0
- forge/observability/events.py +92 -0
- forge/observability/logging.py +85 -0
- forge/observability/usage.py +86 -0
- forge/orchestration/__init__.py +6 -0
- forge/orchestration/context.py +96 -0
- forge/orchestration/orchestrator.py +284 -0
- forge/py.typed +0 -0
- forge/security/__init__.py +20 -0
- forge/security/access.py +77 -0
- forge/security/sandbox.py +111 -0
- forge/security/sanitization.py +90 -0
- forge/tools/__init__.py +15 -0
- forge/tools/base.py +234 -0
- forge/tools/builtin/__init__.py +14 -0
- forge/tools/builtin/calculator.py +64 -0
- forge/tools/builtin/http.py +36 -0
- forge/tools/builtin/time.py +12 -0
- forge/tools/registry.py +53 -0
- forge/types.py +164 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentforge-oss
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Forge — an open-source, enterprise-ready multi-agent orchestration platform with cost awareness, governance, and security built in.
|
|
5
|
+
Project-URL: Homepage, https://github.com/sekacorn/AgentForge
|
|
6
|
+
Project-URL: Documentation, https://github.com/sekacorn/AgentForge#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/sekacorn/AgentForge
|
|
8
|
+
Project-URL: Issues, https://github.com/sekacorn/AgentForge/issues
|
|
9
|
+
Author-email: Sekacorn <Sekacorn@gmail.com>
|
|
10
|
+
Maintainer-email: Sekacorn <Sekacorn@gmail.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: agents,ai,anthropic,claude,enterprise,governance,llm,multi-agent,observability,openai,orchestration,rag
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Requires-Dist: httpx>=0.27
|
|
28
|
+
Requires-Dist: pydantic>=2.6
|
|
29
|
+
Requires-Dist: rich>=13.7
|
|
30
|
+
Requires-Dist: typer>=0.12
|
|
31
|
+
Requires-Dist: typing-extensions>=4.10
|
|
32
|
+
Provides-Extra: all
|
|
33
|
+
Requires-Dist: anthropic>=0.20; extra == 'all'
|
|
34
|
+
Requires-Dist: openai>=1.0; extra == 'all'
|
|
35
|
+
Provides-Extra: anthropic
|
|
36
|
+
Requires-Dist: anthropic>=0.20; extra == 'anthropic'
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
43
|
+
Provides-Extra: openai
|
|
44
|
+
Requires-Dist: openai>=1.0; extra == 'openai'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
<div align="center">
|
|
48
|
+
|
|
49
|
+
# Forge
|
|
50
|
+
|
|
51
|
+
### The open-source multi-agent orchestration platform for teams that ship.
|
|
52
|
+
|
|
53
|
+
**Build, run, optimize, and govern teams of AI agents for real business workflows —
|
|
54
|
+
with cost-awareness, security, and compliance built in from line one.**
|
|
55
|
+
|
|
56
|
+
[](https://github.com/sekacorn/AgentForge/actions/workflows/ci.yml)
|
|
57
|
+
[](https://pypi.org/project/agentforge-oss/)
|
|
58
|
+
[](LICENSE)
|
|
59
|
+
[](https://www.python.org/)
|
|
60
|
+
[](pyproject.toml)
|
|
61
|
+
[](#roadmap)
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Why Forge?
|
|
68
|
+
|
|
69
|
+
A single AI agent is a clever assistant. **A coordinated _team_ of agents is a force
|
|
70
|
+
multiplier** — it can plan, divide work, call tools, check itself, and deliver a
|
|
71
|
+
finished outcome instead of a suggestion.
|
|
72
|
+
|
|
73
|
+
But most teams can't put multi-agent systems into production. The demos are
|
|
74
|
+
impressive; the operational reality is not. The questions that kill adoption are
|
|
75
|
+
always the same:
|
|
76
|
+
|
|
77
|
+
> _"What is this going to cost? Who can run it? What happens when a tool
|
|
78
|
+
> misbehaves? Can we prove what it did for the auditors? Will it leak our data?"_
|
|
79
|
+
|
|
80
|
+
**Forge is built to answer those questions out of the box.** It is an orchestration
|
|
81
|
+
core that treats cost, security, governance, and observability as first-class
|
|
82
|
+
features — not afterthoughts you bolt on before launch.
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import asyncio
|
|
86
|
+
from forge import Orchestrator
|
|
87
|
+
|
|
88
|
+
async def main() -> None:
|
|
89
|
+
# Zero config. Runs fully offline with the deterministic echo provider,
|
|
90
|
+
# and automatically uses Claude when ANTHROPIC_API_KEY is set.
|
|
91
|
+
async with Orchestrator() as forge:
|
|
92
|
+
result = await forge.run(
|
|
93
|
+
"Draft an outreach email to a prospect and compute a 12% discount on $4,200"
|
|
94
|
+
)
|
|
95
|
+
print(result.output)
|
|
96
|
+
print(result.usage.format_table()) # tokens + dollars, per model and per agent
|
|
97
|
+
|
|
98
|
+
asyncio.run(main())
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## The force-multiplier thesis
|
|
104
|
+
|
|
105
|
+
| Without Forge | With Forge |
|
|
106
|
+
|---|---|
|
|
107
|
+
| One prompt, one answer, no division of labor | A supervisor decomposes the goal and delegates to specialized workers |
|
|
108
|
+
| Every call hits your most expensive model | Intelligent routing sends easy work to cheap models, hard work to frontier models |
|
|
109
|
+
| Cost is a surprise on the invoice | Cost is tracked per run, per agent, per model — with hard budget caps |
|
|
110
|
+
| Tools run with full trust | Tools run sandboxed, with side-effecting tools **denied by default** |
|
|
111
|
+
| "Trust me, it worked" | A tamper-evident, hash-chained audit trail of every action |
|
|
112
|
+
| Prototype you can't ship | A typed, tested core designed for production |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Key features
|
|
117
|
+
|
|
118
|
+
### Multi-agent orchestration
|
|
119
|
+
- **Supervisor + dynamic workers.** A supervisor breaks a goal into independent
|
|
120
|
+
subtasks and spawns a focused worker agent for each, then synthesizes the result.
|
|
121
|
+
- **Real agentic loop.** Workers reason, call tools, observe results, and iterate
|
|
122
|
+
until done — with a hard step budget so they never spin forever.
|
|
123
|
+
|
|
124
|
+
### Intelligent routing & cost optimization
|
|
125
|
+
- **Capability/price-aware router** with `cost_optimized`, `quality_first`,
|
|
126
|
+
`balanced`, and `fixed` strategies.
|
|
127
|
+
- **One pricing source of truth.** The model registry knows real list pricing
|
|
128
|
+
(Claude Opus 4.8, Sonnet 4.6, Haiku 4.5, Fable 5) and computes spend consistently.
|
|
129
|
+
- **Budgets that bite.** Per-run USD and token caps halt a runaway before the next
|
|
130
|
+
expensive call.
|
|
131
|
+
|
|
132
|
+
### Tools, memory & RAG — extensible by design
|
|
133
|
+
- **`@tool` decorator** turns any typed Python function into an agent tool, with
|
|
134
|
+
JSON-Schema generated automatically from your type hints and docstring.
|
|
135
|
+
- **Pluggable memory.** Short-term conversation memory plus a dependency-free
|
|
136
|
+
in-memory vector store for RAG — swap in any backend behind one tiny interface.
|
|
137
|
+
- **Provider-agnostic core.** Anthropic (Claude) and a deterministic offline
|
|
138
|
+
provider ship in the box; add any provider by implementing one method.
|
|
139
|
+
|
|
140
|
+
### Security from the start
|
|
141
|
+
- **Tool sandboxing** with allowlists/denylists, per-tool timeouts, and
|
|
142
|
+
**dangerous (network/filesystem) tools denied unless explicitly allowed**.
|
|
143
|
+
- **Prompt-injection heuristics** and input normalization on untrusted goals.
|
|
144
|
+
- **RBAC** — map your IdP groups onto roles and gate who can run agents or use
|
|
145
|
+
dangerous tools.
|
|
146
|
+
|
|
147
|
+
### Compliance & governance
|
|
148
|
+
- **Tamper-evident audit log.** Every model call, tool call, plan, and decision is
|
|
149
|
+
written to an append-only, **SHA-256 hash-chained** JSONL trail. Edits break the
|
|
150
|
+
chain — and `forge audit` detects it.
|
|
151
|
+
- **PII redaction** of logs and audit records (emails, cards, SSNs, IPs, phones).
|
|
152
|
+
- **Data-residency & retention** hints recorded on every entry for GDPR/SOC 2 stories.
|
|
153
|
+
|
|
154
|
+
### Observability built in
|
|
155
|
+
- A structured **event bus** emits every lifecycle moment (routing, model calls,
|
|
156
|
+
tool calls, budget thresholds, security violations).
|
|
157
|
+
- **Structured logging** (human or JSON) and a per-run **usage/cost report**.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Install
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pip install agentforge-oss # core (works offline, zero config)
|
|
165
|
+
pip install "agentforge-oss[anthropic]" # + Claude provider
|
|
166
|
+
pip install "agentforge-oss[all,dev]" # everything + test/lint tooling
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
> Forge runs **fully offline** out of the box using a deterministic provider, so you
|
|
170
|
+
> can explore the whole platform — routing, tools, supervision, audit — without an
|
|
171
|
+
> API key. Set `ANTHROPIC_API_KEY` to route to Claude automatically.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Quickstart (CLI)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Works with no API key — uses the offline provider.
|
|
179
|
+
forge run "Plan a product launch and calculate 15% of 3,400" --verbose
|
|
180
|
+
|
|
181
|
+
# See the model registry and pricing the router reasons over.
|
|
182
|
+
forge models
|
|
183
|
+
|
|
184
|
+
# Verify the audit log hasn't been tampered with.
|
|
185
|
+
forge audit
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`--verbose` streams a live trace so you can watch the supervisor plan, route each
|
|
189
|
+
call, run tools in the sandbox, and tally cost in real time.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Quickstart (library)
|
|
194
|
+
|
|
195
|
+
### A custom tool + a single agent
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import asyncio
|
|
199
|
+
from forge import Orchestrator, ToolRegistry, tool, calculator
|
|
200
|
+
|
|
201
|
+
@tool
|
|
202
|
+
def fx_convert(amount: float, rate: float) -> float:
|
|
203
|
+
"""Convert an amount using an FX rate.
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
amount: The amount in the source currency.
|
|
207
|
+
rate: The exchange rate to apply.
|
|
208
|
+
"""
|
|
209
|
+
return round(amount * rate, 2)
|
|
210
|
+
|
|
211
|
+
async def main() -> None:
|
|
212
|
+
tools = ToolRegistry([calculator, fx_convert])
|
|
213
|
+
async with Orchestrator() as forge:
|
|
214
|
+
result = await forge.run(
|
|
215
|
+
"Convert 250 USD to EUR at 0.92 and then add a 3 EUR fee",
|
|
216
|
+
mode="single",
|
|
217
|
+
tools=tools,
|
|
218
|
+
)
|
|
219
|
+
print(result.output)
|
|
220
|
+
|
|
221
|
+
asyncio.run(main())
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Retrieval-augmented generation (RAG), offline
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
import asyncio
|
|
228
|
+
from forge import InMemoryVectorStore
|
|
229
|
+
|
|
230
|
+
async def main() -> None:
|
|
231
|
+
store = InMemoryVectorStore()
|
|
232
|
+
await store.add("Forge routes cheap tasks to small models to save cost.")
|
|
233
|
+
await store.add("The audit log is hash-chained and tamper-evident.")
|
|
234
|
+
hits = await store.search("how does Forge keep costs down?", k=1)
|
|
235
|
+
print(hits[0].text) # -> the cost-routing fact
|
|
236
|
+
|
|
237
|
+
asyncio.run(main())
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
See [`examples/`](examples/) for runnable end-to-end scripts, including enterprise
|
|
241
|
+
governance (RBAC + budgets + audit verification).
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Architecture
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
┌──────────────────────────────────────────────┐
|
|
249
|
+
│ Orchestrator │
|
|
250
|
+
│ access control · sanitization · accounting │
|
|
251
|
+
└───────────────┬──────────────────────────────┘
|
|
252
|
+
│ RunContext (per run)
|
|
253
|
+
┌──────────────────────────┼───────────────────────────┐
|
|
254
|
+
▼ ▼ ▼
|
|
255
|
+
┌───────────────┐ ┌─────────────────┐ ┌──────────────┐
|
|
256
|
+
│ Supervisor │ spawns │ Worker Agent │ calls │ Tool Sandbox │
|
|
257
|
+
│ plan→delegate│────────▶│ reason ↔ act │─────────▶│ allow/deny + │
|
|
258
|
+
│ →synthesize │ │ (agentic loop)│ │ timeouts │
|
|
259
|
+
└───────┬───────┘ └────────┬────────┘ └──────────────┘
|
|
260
|
+
│ │
|
|
261
|
+
│ ┌───────────────────┴───────────────┐
|
|
262
|
+
▼ ▼ ▼
|
|
263
|
+
┌────────────────┐ ┌──────────────────┐
|
|
264
|
+
│ Model Router │ picks model by │ Model Providers │
|
|
265
|
+
│ cost / quality │ strategy + budget ───▶│ Anthropic · Echo │
|
|
266
|
+
└───────┬────────┘ └──────────────────┘
|
|
267
|
+
│ pricing
|
|
268
|
+
▼
|
|
269
|
+
┌────────────────┐ cross-cutting, on every step:
|
|
270
|
+
│ Model Registry │ Usage/Cost · Event Bus · Audit Log · Redaction
|
|
271
|
+
└────────────────┘
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Every layer is swappable:
|
|
275
|
+
|
|
276
|
+
| Layer | Default | Swap in… |
|
|
277
|
+
|---|---|---|
|
|
278
|
+
| Provider | Echo (offline), Anthropic | Any `ModelProvider` (OpenAI, local, Bedrock, …) |
|
|
279
|
+
| Routing | `balanced` strategy | Your own strategy / `fixed` model |
|
|
280
|
+
| Memory | In-memory vector store | Any `Memory` backend (pgvector, Pinecone, …) |
|
|
281
|
+
| Tools | `calculator`, `utc_now` | Any `@tool` function |
|
|
282
|
+
| Audit | Hash-chained JSONL | Forward events to your SIEM via the event bus |
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Enterprise use cases
|
|
287
|
+
|
|
288
|
+
Forge is a force multiplier wherever a workflow is **multi-step, judgment-heavy, and
|
|
289
|
+
needs a paper trail**:
|
|
290
|
+
|
|
291
|
+
- **Revenue & RevOps** — enrich a lead, draft tailored outreach, compute discounts
|
|
292
|
+
within policy, and log every step for the deal record.
|
|
293
|
+
- **Customer support** — triage a ticket, retrieve the right KB articles (RAG),
|
|
294
|
+
draft a grounded reply, and escalate by policy.
|
|
295
|
+
- **Finance & operations** — reconcile figures with a sandboxed calculator, summarize
|
|
296
|
+
variances, and produce an auditable trail for controllers.
|
|
297
|
+
- **Compliance & risk** — run document review where _every_ action is recorded in a
|
|
298
|
+
tamper-evident log, with PII redacted and access role-gated.
|
|
299
|
+
- **Engineering** — fan out research across a codebase with a supervisor, keeping
|
|
300
|
+
cheap models on grunt work and frontier models on the hard reasoning.
|
|
301
|
+
|
|
302
|
+
The common thread: Forge lets you **say yes to production** because the governance
|
|
303
|
+
questions already have answers.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Security & compliance posture
|
|
308
|
+
|
|
309
|
+
- **Least privilege by default.** Dangerous tools (network egress, filesystem) are
|
|
310
|
+
denied unless you explicitly allowlist them.
|
|
311
|
+
- **Defense in depth.** Input sanitization + prompt-injection heuristics sit in front
|
|
312
|
+
of every untrusted goal; tool execution is bounded by timeouts.
|
|
313
|
+
- **Provable history.** The audit log is append-only and hash-chained; `forge audit`
|
|
314
|
+
(or `Orchestrator.verify_audit()`) detects any tampering.
|
|
315
|
+
- **Privacy aware.** PII redaction runs before anything is written to logs or audit.
|
|
316
|
+
- **Access control.** RBAC gates sensitive operations; map roles to your IdP groups.
|
|
317
|
+
|
|
318
|
+
> Forge gives you strong application-level controls. It is not a substitute for OS-
|
|
319
|
+
> level isolation when executing untrusted code — for that, run tools in a container
|
|
320
|
+
> or microVM behind the same `ToolSandbox` interface. The design makes that a drop-in.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Configuration
|
|
325
|
+
|
|
326
|
+
Configuration layers (lowest to highest priority): **defaults → `forge.toml` →
|
|
327
|
+
environment**.
|
|
328
|
+
|
|
329
|
+
```toml
|
|
330
|
+
# forge.toml
|
|
331
|
+
[routing]
|
|
332
|
+
strategy = "balanced" # cost_optimized | quality_first | balanced | fixed
|
|
333
|
+
default_model = "claude-opus-4-8"
|
|
334
|
+
|
|
335
|
+
[budget]
|
|
336
|
+
max_usd_per_run = 0.50
|
|
337
|
+
max_steps_per_agent = 12
|
|
338
|
+
max_workers = 6
|
|
339
|
+
|
|
340
|
+
[security]
|
|
341
|
+
detect_prompt_injection = true
|
|
342
|
+
tool_timeout_seconds = 30
|
|
343
|
+
# allow_tools = ["calculator", "http_get"] # uncomment to permit a dangerous tool
|
|
344
|
+
|
|
345
|
+
[compliance]
|
|
346
|
+
audit_enabled = true
|
|
347
|
+
redact_pii = true
|
|
348
|
+
data_region = "eu-west-1"
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Common environment variables: `ANTHROPIC_API_KEY`, `FORGE_DEFAULT_MODEL`,
|
|
352
|
+
`FORGE_ROUTING_STRATEGY`, `FORGE_MAX_USD_PER_RUN`, `FORGE_LOG_LEVEL`,
|
|
353
|
+
`FORGE_JSON_LOGS`, `FORGE_AUDIT_ENABLED`, `FORGE_REDACT_PII`. See
|
|
354
|
+
[`.env.example`](.env.example).
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Development
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
git clone https://github.com/sekacorn/AgentForge.git
|
|
362
|
+
cd AgentForge
|
|
363
|
+
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
364
|
+
pip install -e ".[all,dev]"
|
|
365
|
+
|
|
366
|
+
pytest # run the test suite (offline, no API key needed)
|
|
367
|
+
ruff check . # lint
|
|
368
|
+
mypy forge # strict type-check
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
The entire test suite runs offline against the deterministic provider — fast,
|
|
372
|
+
hermetic, and free.
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Roadmap
|
|
377
|
+
|
|
378
|
+
- [ ] Streaming token output through the event bus
|
|
379
|
+
- [ ] First-party OpenAI / Bedrock / local (Ollama) providers
|
|
380
|
+
- [ ] Durable memory backends (pgvector, Redis, object storage)
|
|
381
|
+
- [ ] Parallel worker execution & inter-agent messaging
|
|
382
|
+
- [ ] OpenTelemetry export for traces and metrics
|
|
383
|
+
- [ ] Policy-as-code for tool governance
|
|
384
|
+
- [ ] Hosted SaaS control plane (TypeScript / Next.js) — Python core first
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Contributing
|
|
389
|
+
|
|
390
|
+
Contributions are very welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Good first
|
|
391
|
+
areas: new providers, new tools, memory backends, and routing strategies. Please keep
|
|
392
|
+
the core typed (`mypy --strict`) and tested.
|
|
393
|
+
|
|
394
|
+
## License
|
|
395
|
+
|
|
396
|
+
[MIT](LICENSE) — free for commercial and private use. Build something that multiplies
|
|
397
|
+
your team.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
forge/__init__.py,sha256=C2KVD-9sR4usLA3l_V1dULXxr2E7rDokgE5V07Jrlqo,4073
|
|
2
|
+
forge/_version.py,sha256=S58BeCqmY14bx8xoXBKCUG-ENzAp5Vh5HFNFxa8BO00,277
|
|
3
|
+
forge/config.py,sha256=myeWvI5yJtcb29Yp6WEczft4B1c-X4FyL6FXQ1-lLlM,7272
|
|
4
|
+
forge/exceptions.py,sha256=86WTZSiT82euOVh3jJPE6wRimrWzlqNTbk_s2tYa95w,3967
|
|
5
|
+
forge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
forge/types.py,sha256=Wz_rBX_DOIrNdagyh7P60_DB-qaExJCdY6kMhWmV3Zs,5076
|
|
7
|
+
forge/agents/__init__.py,sha256=3QfFyYJ7zsGbC3otEFeOoXvW4_W8uZZ78WY-jjHdTww,272
|
|
8
|
+
forge/agents/agent.py,sha256=3QrOTgyOrhq1L8-pVuSpHlOwitkdaZefBg7NFDc2YM8,4055
|
|
9
|
+
forge/agents/base.py,sha256=UHlx_NolbROG5aGfmMQDymEccXxCHen4yfNT3mYqqNI,4767
|
|
10
|
+
forge/agents/supervisor.py,sha256=545W2I5P-qSxGoyhwlQ5YxjoKMDEyaGOsiTD7V4-WsI,6709
|
|
11
|
+
forge/cli/__init__.py,sha256=mNg1utbiYubQgWjv6hn7LA1r83IyXQYEttaM2d8fA-8,91
|
|
12
|
+
forge/cli/console.py,sha256=iT4vyS-932a-yyXzaFyOFEA7526teZrupjnlxRmx-4g,3214
|
|
13
|
+
forge/cli/main.py,sha256=XZNKFc3LCmYWMEgNNivD9tw4gLnlEKueYexX96bqId0,4639
|
|
14
|
+
forge/compliance/__init__.py,sha256=ShmSPxIiB6EBq-ZJzlDrWJsz8FWzoksi1MXyLuDyon0,233
|
|
15
|
+
forge/compliance/audit.py,sha256=dLN-rQcnuEceZpSQiW0mPn-9lj9ZW-inKESXiAG1W2A,5121
|
|
16
|
+
forge/compliance/redaction.py,sha256=CZ1dcjDfqbjZ3N85HavWT_p06YZlTQIgNak0oM_pIJQ,1746
|
|
17
|
+
forge/memory/__init__.py,sha256=kC9T7P0vbvDb1FFYLNx6aNn71dF14W5ef1L5-dVbB5k,317
|
|
18
|
+
forge/memory/base.py,sha256=LM-3Fs7DtdQjygPZpqoJx9KyWLVeA-cKAbevd3qlXPE,1521
|
|
19
|
+
forge/memory/conversation.py,sha256=yqikrwHl4ka2aDMsCSIzk24M9nRCy58stMwMZHNldPU,1640
|
|
20
|
+
forge/memory/vector.py,sha256=15XcfQRIPirEvtZ3F-uGTZF4veXcxmDBlBorvWvzAK4,2905
|
|
21
|
+
forge/models/__init__.py,sha256=qCAy-uzmp1R-rN5RGuWQAkFjE29oFi6Ezl39enMlTGw,438
|
|
22
|
+
forge/models/base.py,sha256=VrVs4LYdOhEYuzVAqwWGnRNOVzk87yDNX0gi2WrMdMg,2665
|
|
23
|
+
forge/models/registry.py,sha256=xXyos97NiiduvCqw9DtONSoNHqdsntwHV1hs8oAtHmc,7905
|
|
24
|
+
forge/models/router.py,sha256=eCvmLeAk6XKLecZaETfteAI_qcNrmmuxK_zkTLfyxUg,5882
|
|
25
|
+
forge/models/providers/__init__.py,sha256=yQc3WRQhgAJYH8d8QHWIMACch_-UeRElMx_kozNy_ws,573
|
|
26
|
+
forge/models/providers/anthropic.py,sha256=AC-Ff4ROqeV48CKk3cALwEMcso6Q9F9vGBVHN6Ee--8,7394
|
|
27
|
+
forge/models/providers/echo.py,sha256=59ONIHh8RIt4ISyHYocGRfYM8DlVRHFI5kV8SFkm1IQ,6777
|
|
28
|
+
forge/models/providers/openai.py,sha256=2t6HcemPmkzCVpecrsdQGDgmri2rnmamepgj0wT29sI,7576
|
|
29
|
+
forge/observability/__init__.py,sha256=Wog7XA4koWP1vxvKE4BqsYbqUvGnyrPTtFXqZfO1hRM,456
|
|
30
|
+
forge/observability/events.py,sha256=XaovN8Bwzwm-EcbnVVzOsKS33XBitX3-Y6zgWEZurGI,3004
|
|
31
|
+
forge/observability/logging.py,sha256=e2OfmHlk-1ML1ohqk3uXblIne-C-TShrrj3JhdT4OnE,2813
|
|
32
|
+
forge/observability/usage.py,sha256=SjsbwAoVDVB0se3HnhPPmDjKjY3Xg20FrIDCNtlHXhA,2911
|
|
33
|
+
forge/orchestration/__init__.py,sha256=M5dPkjUGFFE10XOHE7CSSaXeSsDMqBPBdYZgkBUXTDQ,265
|
|
34
|
+
forge/orchestration/context.py,sha256=LhJTOhzG2vCkSkmwq_JGXy6uVLbqjm5zqN10JEkqovY,3733
|
|
35
|
+
forge/orchestration/orchestrator.py,sha256=dL6lWRUEcra4QsotLRcaYi6B4y2czLCFaoaTj86Lk58,11338
|
|
36
|
+
forge/security/__init__.py,sha256=Umfe6Ajb8pxKV1J1mxnxA7Tizi7UY720PxMjuF8XRQE,490
|
|
37
|
+
forge/security/access.py,sha256=db74CTvBAcjtR8JneGPFho7zntAkRm4dcc_17A9xafw,2664
|
|
38
|
+
forge/security/sandbox.py,sha256=qKFl2KI0v7s0I32QRInvFYGG6bjYGOV4YMR0WVH_pr4,4377
|
|
39
|
+
forge/security/sanitization.py,sha256=B0HS6K5o-iiXm5COksexJHgs7ITQ07SRsrq29eDl7NA,3381
|
|
40
|
+
forge/tools/__init__.py,sha256=u3vuLER54jXLeqXzKZ-0tsamvuKpBi_mNvtU_bTUlZE,361
|
|
41
|
+
forge/tools/base.py,sha256=G9lCdJozOS5-GeRYH-K3jSG8vWyJtod4uroQqmxgGhI,7354
|
|
42
|
+
forge/tools/registry.py,sha256=BHua-ofAAdsGoqKIWKTtF7Uc8peffrwvSPdgGJftKUc,1590
|
|
43
|
+
forge/tools/builtin/__init__.py,sha256=30AX_vQCOjBNVVniuN4BJ7keWvwVePlGVvV63eJVEOg,502
|
|
44
|
+
forge/tools/builtin/calculator.py,sha256=bqfWINSkE_-_Gzy47rHXGYEHWgWOdohqhZGoJUVOVQw,2204
|
|
45
|
+
forge/tools/builtin/http.py,sha256=v0uqTpiJwty7PU2JC27IxsUvvRqh8zMWscLM8AV7MUQ,1268
|
|
46
|
+
forge/tools/builtin/time.py,sha256=VqW5U40eSePLFjQp02ZxiYONCxT4brPnXgwD9FV9UAM,264
|
|
47
|
+
agentforge_oss-0.1.0.dist-info/METADATA,sha256=r2YBXblwx49A7kTMVMWajE7mo9XCm-97UlqQhMdhhNk,16468
|
|
48
|
+
agentforge_oss-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
49
|
+
agentforge_oss-0.1.0.dist-info/entry_points.txt,sha256=5UQL796DdhlixNcJTesU1Tf39hyqe7gwuFDCfRKJLiI,45
|
|
50
|
+
agentforge_oss-0.1.0.dist-info/licenses/LICENSE,sha256=1Lhwyrb1s7nZFr69Lo0MQpRv8NeH9FEecPO8pcX_150,1065
|
|
51
|
+
agentforge_oss-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sekacorn
|
|
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.
|
forge/__init__.py
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"""Forge (AgentForge) — an open-source, enterprise-ready multi-agent platform.
|
|
2
|
+
|
|
3
|
+
Quick start::
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from forge import Orchestrator
|
|
7
|
+
|
|
8
|
+
async def main() -> None:
|
|
9
|
+
async with Orchestrator() as forge: # zero-config, offline by default
|
|
10
|
+
result = await forge.run("Research X and summarise the findings")
|
|
11
|
+
print(result.output)
|
|
12
|
+
print(result.usage.format_table()) # tokens + cost
|
|
13
|
+
|
|
14
|
+
asyncio.run(main())
|
|
15
|
+
|
|
16
|
+
The most important entry point is :class:`Orchestrator`. The rest of the public
|
|
17
|
+
surface is re-exported here for convenience and stability.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from forge._version import __version__
|
|
23
|
+
from forge.agents import Agent, AgentResult, BaseAgent, Supervisor
|
|
24
|
+
from forge.compliance import AuditEntry, AuditLogger, PIIRedactor
|
|
25
|
+
from forge.config import (
|
|
26
|
+
BudgetConfig,
|
|
27
|
+
ComplianceConfig,
|
|
28
|
+
ForgeConfig,
|
|
29
|
+
ObservabilityConfig,
|
|
30
|
+
RoutingConfig,
|
|
31
|
+
SecurityConfig,
|
|
32
|
+
)
|
|
33
|
+
from forge.exceptions import (
|
|
34
|
+
AccessDeniedError,
|
|
35
|
+
AgentError,
|
|
36
|
+
BudgetExceededError,
|
|
37
|
+
ConfigurationError,
|
|
38
|
+
ForgeError,
|
|
39
|
+
MaxStepsExceededError,
|
|
40
|
+
ModelRoutingError,
|
|
41
|
+
OrchestrationError,
|
|
42
|
+
PromptInjectionError,
|
|
43
|
+
ProviderAuthError,
|
|
44
|
+
ProviderError,
|
|
45
|
+
ProviderRateLimitError,
|
|
46
|
+
ProviderResponseError,
|
|
47
|
+
SecurityError,
|
|
48
|
+
ToolError,
|
|
49
|
+
ToolExecutionError,
|
|
50
|
+
ToolNotFoundError,
|
|
51
|
+
ToolTimeoutError,
|
|
52
|
+
ToolValidationError,
|
|
53
|
+
)
|
|
54
|
+
from forge.memory import ConversationMemory, InMemoryVectorStore, Memory, MemoryItem
|
|
55
|
+
from forge.models import (
|
|
56
|
+
Complexity,
|
|
57
|
+
ModelInfo,
|
|
58
|
+
ModelProvider,
|
|
59
|
+
ModelRegistry,
|
|
60
|
+
ModelRouter,
|
|
61
|
+
ModelTier,
|
|
62
|
+
RoutingDecision,
|
|
63
|
+
)
|
|
64
|
+
from forge.models.providers import AnthropicProvider, EchoProvider, OpenAIProvider
|
|
65
|
+
from forge.observability import (
|
|
66
|
+
Event,
|
|
67
|
+
EventBus,
|
|
68
|
+
EventType,
|
|
69
|
+
UsageReport,
|
|
70
|
+
UsageTracker,
|
|
71
|
+
configure_logging,
|
|
72
|
+
get_logger,
|
|
73
|
+
)
|
|
74
|
+
from forge.orchestration import Orchestrator, RunContext, RunResult
|
|
75
|
+
from forge.security import (
|
|
76
|
+
AccessController,
|
|
77
|
+
InputSanitizer,
|
|
78
|
+
Permission,
|
|
79
|
+
Principal,
|
|
80
|
+
ToolSandbox,
|
|
81
|
+
)
|
|
82
|
+
from forge.tools import SAFE_TOOLS, Tool, ToolRegistry, calculator, http_get, tool, utc_now
|
|
83
|
+
from forge.types import (
|
|
84
|
+
FinishReason,
|
|
85
|
+
Message,
|
|
86
|
+
ModelResponse,
|
|
87
|
+
Role,
|
|
88
|
+
ToolCall,
|
|
89
|
+
ToolResult,
|
|
90
|
+
ToolSchema,
|
|
91
|
+
Usage,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
__all__ = [
|
|
95
|
+
"__version__",
|
|
96
|
+
# Orchestration
|
|
97
|
+
"Orchestrator",
|
|
98
|
+
"RunResult",
|
|
99
|
+
"RunContext",
|
|
100
|
+
# Agents
|
|
101
|
+
"Agent",
|
|
102
|
+
"Supervisor",
|
|
103
|
+
"BaseAgent",
|
|
104
|
+
"AgentResult",
|
|
105
|
+
# Config
|
|
106
|
+
"ForgeConfig",
|
|
107
|
+
"RoutingConfig",
|
|
108
|
+
"BudgetConfig",
|
|
109
|
+
"SecurityConfig",
|
|
110
|
+
"ComplianceConfig",
|
|
111
|
+
"ObservabilityConfig",
|
|
112
|
+
# Types
|
|
113
|
+
"Role",
|
|
114
|
+
"Message",
|
|
115
|
+
"ToolCall",
|
|
116
|
+
"ToolResult",
|
|
117
|
+
"ToolSchema",
|
|
118
|
+
"Usage",
|
|
119
|
+
"ModelResponse",
|
|
120
|
+
"FinishReason",
|
|
121
|
+
# Models
|
|
122
|
+
"ModelProvider",
|
|
123
|
+
"ModelRegistry",
|
|
124
|
+
"ModelInfo",
|
|
125
|
+
"ModelTier",
|
|
126
|
+
"ModelRouter",
|
|
127
|
+
"Complexity",
|
|
128
|
+
"RoutingDecision",
|
|
129
|
+
"EchoProvider",
|
|
130
|
+
"AnthropicProvider",
|
|
131
|
+
"OpenAIProvider",
|
|
132
|
+
# Tools
|
|
133
|
+
"Tool",
|
|
134
|
+
"tool",
|
|
135
|
+
"ToolRegistry",
|
|
136
|
+
"SAFE_TOOLS",
|
|
137
|
+
"calculator",
|
|
138
|
+
"http_get",
|
|
139
|
+
"utc_now",
|
|
140
|
+
# Memory
|
|
141
|
+
"Memory",
|
|
142
|
+
"MemoryItem",
|
|
143
|
+
"ConversationMemory",
|
|
144
|
+
"InMemoryVectorStore",
|
|
145
|
+
# Observability
|
|
146
|
+
"Event",
|
|
147
|
+
"EventBus",
|
|
148
|
+
"EventType",
|
|
149
|
+
"UsageTracker",
|
|
150
|
+
"UsageReport",
|
|
151
|
+
"get_logger",
|
|
152
|
+
"configure_logging",
|
|
153
|
+
# Security
|
|
154
|
+
"InputSanitizer",
|
|
155
|
+
"ToolSandbox",
|
|
156
|
+
"AccessController",
|
|
157
|
+
"Principal",
|
|
158
|
+
"Permission",
|
|
159
|
+
# Compliance
|
|
160
|
+
"AuditLogger",
|
|
161
|
+
"AuditEntry",
|
|
162
|
+
"PIIRedactor",
|
|
163
|
+
# Exceptions
|
|
164
|
+
"ForgeError",
|
|
165
|
+
"ConfigurationError",
|
|
166
|
+
"ProviderError",
|
|
167
|
+
"ProviderAuthError",
|
|
168
|
+
"ProviderRateLimitError",
|
|
169
|
+
"ProviderResponseError",
|
|
170
|
+
"ModelRoutingError",
|
|
171
|
+
"ToolError",
|
|
172
|
+
"ToolNotFoundError",
|
|
173
|
+
"ToolValidationError",
|
|
174
|
+
"ToolExecutionError",
|
|
175
|
+
"ToolTimeoutError",
|
|
176
|
+
"AgentError",
|
|
177
|
+
"MaxStepsExceededError",
|
|
178
|
+
"OrchestrationError",
|
|
179
|
+
"BudgetExceededError",
|
|
180
|
+
"SecurityError",
|
|
181
|
+
"PromptInjectionError",
|
|
182
|
+
"AccessDeniedError",
|
|
183
|
+
]
|
forge/_version.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Single source of truth for the package version.
|
|
2
|
+
|
|
3
|
+
Hatchling reads ``__version__`` from this file at build time (see
|
|
4
|
+
``[tool.hatch.version]`` in ``pyproject.toml``), and ``forge.__init__`` re-exports
|
|
5
|
+
it for runtime access via ``forge.__version__``.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "0.1.0"
|
forge/agents/__init__.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""Agents: the worker agent, the supervisor, and their shared base."""
|
|
2
|
+
|
|
3
|
+
from forge.agents.agent import Agent
|
|
4
|
+
from forge.agents.base import AgentResult, BaseAgent
|
|
5
|
+
from forge.agents.supervisor import Supervisor
|
|
6
|
+
|
|
7
|
+
__all__ = ["Agent", "AgentResult", "BaseAgent", "Supervisor"]
|