Skip to content

Introduction

Reactive Agents is a TypeScript framework for building autonomous AI agents. It’s built on Effect-TS — giving you type-safe, composable, and observable agent systems from day one.

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. Want memory but not guardrails? Too bad.
  • Opaque — Agent decisions are black boxes. When something goes wrong, good luck debugging.
  • 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

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.

Agents dynamically adjust their autonomy level:

  • Autonomous — Full self-direction
  • Supervised — Periodic checkpoints
  • Collaborative — Back-and-forth with the user
  • Consultative — Ask before acting
  • Interrogative — Gather information first

Mode transitions happen automatically based on confidence thresholds, cost, and user activity.

  • 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