API Reference
The complete API reference covers every public type, protocol, and API in the Swarm framework.
Complete Reference
The Complete API Reference is a single document covering all subsystems:
- Overview & Architecture — What Swarm is, layer diagram, platform requirements
- Quick Start — Minimal working example
- Agents — All agent types,
AgentRuntimeprotocol, configuration - Tools —
@Toolmacro,FunctionTool, tool chaining, parallel execution - Workflow — Fluent core API (
step,parallel,route,repeatUntil,timeout) plus namespaced advanced APIs (workflow.advanced) - Handoffs —
HandoffConfigurationand handoff coordination - Memory — All memory types, sessions, backends, embeddings
- Guardrails — Input/output/tool guardrails, tripwire modes
- Resilience — Retry, circuit breaker, fallback, timeout
- Observability — Tracers, trace events, spans, metrics
- MCP Integration — Client and server
- Providers — LLM providers, MultiProvider, Foundation Models
- Macros —
@Tool,@Parameter,@AgentActor,@Traceable,#Prompt,@Builder - Hive Runtime — DAG compilation, checkpointing, resume
By Topic
| Topic | Description |
|---|---|
| Agents | Agent types, configuration, @AgentActor macro |
| Tools | @Tool macro, FunctionTool, runtime toggling |
| Workflow | Fluent workflow composition and execution |
| Handoffs | Agent handoffs and routing between runtime agents |
| Memory | Conversation, Vector, Summary, SwiftData backends |
| Streaming | AgentEvent streaming, SwiftUI integration |
| Guardrails | Input/output validation, tripwires |
| Resilience | Retry, circuit breakers, fallback, timeouts |
| Observability | Tracing, OSLogTracer, SwiftLogTracer, metrics |
| MCP | Model Context Protocol client and server |
| Providers | Inference providers, MultiProvider routing |
| Hive Swarm Hardening | Non-fork run control, checkpoint capability, deterministic transcript/state hashing |