Architecture
Forge is structured as a layered runtime, not a monolithic library. The reference Rust implementation ships as 32 crates organised into seven layers.
Layers
┌─────────────────────────────────────────────────────────────┐
│ forge-sdk (single-import surface) │
├─────────────────────────────────────────────────────────────┤
│ forge-agent forge-collab forge-comm │
│ ── tool loop ── multi-agent ── A2A messaging │
├─────────────────────────────────────────────────────────────┤
│ forge-tool forge-generate forge-mcp │
│ ── registry/exec ── stream_text ── MCP client/server │
├─────────────────────────────────────────────────────────────┤
│ forge-provider-* (anthropic / openai / google / │
│ litellm / foundry / codex / │
│ claude-code / bedrock / cohere / │
│ azure / xai / deepseek / mistral) │
├─────────────────────────────────────────────────────────────┤
│ forge-identity forge-auth forge-settings │
│ ── OAS DID + HMR ── Arsenal ACT ── settings introspect│
├─────────────────────────────────────────────────────────────┤
│ forge-core │
│ ── LanguageModel + ChunkStream + StreamChunk + types │
├─────────────────────────────────────────────────────────────┤
│ forge-telemetry forge-error forge-wasm │
│ ── tracing + OTel ── ForgeError ── WASM runtime │
└─────────────────────────────────────────────────────────────┘
Crate map
Core (3)
- forge-core —
LanguageModeltrait,StreamChunk,ChunkStream,ModelMessage,ToolDefinition,Usage,FinishReason. No I/O. - forge-error — single
ForgeErrortype,ForgeResultalias. - forge-telemetry —
tracing+ OpenTelemetry initialiser.
Identity & authorization (3)
- forge-identity —
did:oasresolution, HMR/MHR creation, lineage verification, glyph derivation. - forge-auth — Arsenal ACT verification (
verify_act), capability scoping, delegation chains. - forge-settings — provider settings introspection — what each provider needs to start, what's configured, what's missing.
Agent runtime (4)
- forge-agent —
Agenttrait,AgentConfig,StreamingToolLoopAgent,ToolLoopAgent,AgentEvent,ToolInvocationRecord,AgentLoopObserver. - forge-tool —
ToolRegistry,ToolExecutor, three-tier classification (read / write / execute), approval handlers. - forge-comm — agent-to-agent message envelope.
- forge-collab — multi-agent coordination primitives.
Generation (1)
- forge-generate —
stream_text,stream_text_chunks,stream_object,generate_object. Built on top offorge-core::LanguageModel.
MCP (1)
- forge-mcp — Model Context Protocol client and server.
Providers (13)
The provider crates split into two families:
Native streaming (per-token from the upstream wire):
forge-provider-anthropicforge-provider-openaiforge-provider-google
Buffered shims (wait for the full response, then chunk it):
forge-provider-litellmforge-provider-foundryforge-provider-codex(Codex CLI bridge)forge-provider-claude-code(Claude Code CLI bridge)forge-provider-bedrockforge-provider-cohereforge-provider-azureforge-provider-xaiforge-provider-deepseekforge-provider-mistral
Both families implement the same LanguageModel trait — switching providers
is a one-line change. See Provider Capability Matrix.
x402 micropayments (1)
- forge-agent402 — agent-side x402 wallet + per-call settlement.
Surface (1)
- forge-sdk — re-exports everything above as a single crate. Most
consumers import only this:
use forge::prelude::*;
Coding & tooling (5)
forge-coding-*— coding-platform subscription bridge (Claude, Cursor, etc.).
Memory & workflow (3)
forge-memory-*— agent memory adapters.forge-workflow— durable workflow primitives.
Runtime (2)
- forge-wasm — WASM execution surface (Wasmtime).
- forge-runtime-host — host bindings for WASM-compiled agents.
Bridges
Three official bridge crates connect Forge to other L1fe systems:
- harness-sdk-forge — drop a Forge agent into a Codex-style TUI. See Harness integration.
- forge-flowers — bridge to the Flowers durable workflow engine in Aut0. See Aut0 integration.
- arise-bridge — bridge to the ARISE distributed GPU marketplace.
Where to read next
- The ANVIL contract — what every SDK guarantees
- SDK Overview — runtime concepts in depth
- Streaming —
stream_chunksand the RFC 0001 design