Documentation / guides
Overview
Define Loops, assemble a Rig, run and restore Sessions, observe events, add gates and hooks, delegate work, and serve clients.
Harness is the composition runtime. A Loop freezes one agent’s model, instructions, tools, and limits. A Rig combines Loops with session storage, workspaces, gates, hooks, and delegation policy. A Session owns live turns, events, control commands, and shutdown.
assistant, err := loop.Define(
loop.WithName("assistant"),
loop.WithInference(client, selectedModel),
)
runtime, err := rig.Define(
rig.WithLoops(assistant),
rig.WithPrimers("assistant"),
rig.WithSessionStore(sessions),
)
session, err := runtime.NewSession(ctx)
Explore the Harness runtime
Follow the runtime from its public control surface into reusable configuration and live execution:
- Commands control a live Session, including submit, interrupt, approval, compaction, and shutdown.
- Events expose the durable record emitted by those commands and by runtime execution.
- Step is one model request followed by any tool calls and their results.
- Turn begins with one admitted user input and ends with a durable terminal event.
- Loop freezes one agent’s model, instructions, tools, limits, and delegation choices.
- Rig assembles loops, storage, hooks, workspaces, gates, and Hustles.
- Session runtime owns the live controllers, queues, subscriptions, resources, and shutdown boundary.
- Skills load reusable instructions on demand from curated embedded catalogs or gated project workspaces.
- Hustles run bounded auxiliary inference for facilities such as compaction and permission review.
- Compaction replaces an older transcript prefix with a validated summary tied to the exact context basis.
Start with Build an agent with Harness, then build the Weather Assistant or Research Assistant. Use the complete Harness module guide for repository and dependency details.