Skip to content

Introduction

Last updated 1 day ago · 5ad31ba

Updated yesterday

"docs: first-timer onboarding fixes — broken first command, zero-key path, funnel order" · 5ad31ba · 2026-07-21

  • ### Interaction Modes (standalone package)

Reactive Agents is a composable TypeScript framework for building reliable LLM agents on a harness you fully control. It’s built on Effect-TS, so the runtime is type-safe, observable, and composable end to end.

Building production AI agents is hard:

  • No type safety — Most agent frameworks are dynamically typed. Errors surface at runtime, often in production.
  • Monolithic — You get everything or nothing; opting into memory but not guardrails is rarely supported.
  • Opaque — Agent decisions are black boxes, which makes them hard to debug, audit, or steer.
  • Unsafe — Prompt injection, PII leaks, and runaway costs are afterthoughts.

Reactive Agents solves each of these with a layered, composable architecture:

ProblemSolution
No type safetyEffect-TS schemas validate every boundary
MonolithicLayer system — enable only what you need
Opaque12-phase execution engine with lifecycle hooks
UnsafeBuilt-in guardrails, verification, and cost controls

Transparent harness

Every one of the 12 phases emits typed events with before / after / on-error hooks. System prompts are readable templates, not buried strings. Raw provider clients ship standalone — skip the harness entirely if you want.

Reliable on local models

A 4-stage healing pipeline repairs malformed tool calls on the fly — deterministic string/type fixes instead of an LLM reprompt — so local Ollama models can run the same tool-calling loop as frontier APIs.

Typed structured output

Attach a Zod / Valibot / ArkType / Effect schema and read a fully-typed result.object — streaming field-by-field if you want. No prompt engineering, no manual parsing. (New in v0.12)

Durable by design

Opt a run into a durable store and resume it from its last checkpoint after a crash, restart, or pause — across process boundaries. (New in v0.12)

Every capability is an independent Effect Layer. Compose them like building blocks:

const agent = await ReactiveAgents.create()
.withMemory() // Default memory tier (see Memory guide for enhanced + embeddings)
.withReasoning() // ReAct reasoning loop
.withGuardrails() // Injection & PII detection
.withCostTracking() // Budget enforcement
.build();

Every agent task flows through a deterministic lifecycle:

  1. Bootstrap — Load memory context
  2. Guardrail — Safety checks on input
  3. Cost Route — Select optimal model tier
  4. Strategy Select — Choose reasoning strategy
  5. Think — LLM completion (one or more iterations)
  6. Act — Tool execution
  7. Observe — Append tool results to context
  8. Verify — Fact-check output (entropy, decomposition, NLI)
  9. Memory Flush — Persist session, episodic, and procedural memories
  10. Cost Track — Record spend against budget
  11. Audit — Emit audit events (tokens, cost, strategy, duration)
  12. Complete — Return final result with metadata

Each phase supports before, after, and on-error lifecycle hooks.

@reactive-agents/interaction is an opt-in, standalone package that models five autonomy levels — autonomous, supervised, collaborative, consultative, and interrogative — with mode switching, checkpoints, and notifications as composable Effect services.

It is used directly, not through createAgent or the builder: createInteractionLayer() provides the InteractionManager service as an Effect layer you compose into your own program. See the interaction modes example in the Examples Catalog for the working pattern.

  • TypeScript developers building AI-powered applications
  • Teams that need observable, auditable agent behavior
  • Projects that require fine-grained control over agent capabilities
  • Anyone tired of agent frameworks that feel like magic boxes