01 / SCHEMAOne source of truth
Input, output, Tool, wire, and stored values begin as Effect Schemas. Provider shapes are derived.
● An agent runtime for Effect applications
Build autonomous TypeScript agents without leaving Effect behind. Schemas stay canonical, failures stay typed, dependencies stay visible, and every resource stays inside a Scope.
The whole runtime contract
No hidden runtime. The signature is the architecture.
01 / SCHEMAInput, output, Tool, wire, and stored values begin as Effect Schemas. Provider shapes are derived.
02 / LAYERModels, Tool handlers, stores, clocks, sandboxes, and policies arrive through explicit Layers.
03 / SCOPEModel streams, Tool fibers, queues, clients, and attached children belong to the Run Scope.
04 / RECORDReplay rebuilds state, never external effects. Ambiguous outcomes stay explicit rather than guessed.
const Definition = Agent.define("triage", {
input: Schema.Struct({ repo: Schema.String, issueNumber: Schema.Int }),
output: Schema.Struct({
severity: Schema.Literals(["low", "medium", "high", "critical"]),
explanation: Schema.String,
}),
instructions: ({ repo, issueNumber }) => `Triage ${repo}#${issueNumber}.`,
toolkit: TriageTools,
policy: AgentPolicy.make({ maxTurns: 12, maxToolCalls: 20, maxDuration: "10 minutes" }),
});
const Triage = Agent.withModel(Definition, AnthropicLanguageModel.model("claude-sonnet-5"));
const result = AgentRuntime.run(Triage, { repo: "acme/api", issueNumber: 123 }).pipe(
Effect.provide(AppLive),
Effect.scoped,
); // Effect<AgentResult<Output>, AgentFailure | DomainFailure, Requirements>Schema input and output, native Effect AI Tools, a bounded policy, one explicit Model binding.
Agent definitions →RUNOne interpreter, three views: an Effect result, a semantic Stream, or a scoped detached Run.
Run & stream →RECOVERDurable admission and crash recovery on Node/SQLite and Cloudflare, with one terminal Settlement.
Persistence & durability →PROVEScript model Turns, inject Layers, control time and IDs, and verify the semantic trace offline.
Deterministic testing →