Type-Safe from End to End
Every agent, tool, memory entry, and LLM call is validated by Effect-TS schemas. Catch errors at compile time. Runtime validation at every service boundary. Typed errors mean failures are explicit, not surprises.
import { ReactiveAgents } from "reactive-agents";
const agent = await ReactiveAgents.create() .withProvider("anthropic") .withReasoning() // ReAct loop: Think → Act → Observe .withTools() // Built-in: web-search, file-read, code-execute .withObservability({ verbosity: "normal" }) .build();
const result = await agent.run("Find the top 3 TypeScript testing frameworks and compare them");Every run produces a professional metrics dashboard — automatically, with zero instrumentation:
┌─────────────────────────────────────────────────────────────┐│ ✅ Agent Execution Summary │├─────────────────────────────────────────────────────────────┤│ Status: ✅ Success Duration: 13.9s Steps: 7 ││ Tokens: 1,963 Cost: ~$0.003 Model: claude-3.5 │└─────────────────────────────────────────────────────────────┘
📊 Execution Timeline├─ [bootstrap] 100ms ✅├─ [guardrail] 50ms ✅├─ [strategy] 50ms ✅├─ [think] 10,001ms ⚠️ (7 iter, 72% of time)├─ [act] 1,000ms ✅ (2 tools)├─ [observe] 500ms ✅├─ [memory-flush] 200ms ✅└─ [complete] 28ms ✅
🔧 Tool Execution (2 called)├─ web-search ✅ 3 calls, 450ms avg└─ file-write ✅ 2 calls, 280ms avgbun add reactive-agents # or: npm install reactive-agentsThat’s it. One package, 20 composable layers. Enable what you need, skip what you don’t.
Type-Safe from End to End
Every agent, tool, memory entry, and LLM call is validated by Effect-TS schemas. Catch errors at compile time. Runtime validation at every service boundary. Typed errors mean failures are explicit, not surprises.
Composable Layer Architecture
Enable exactly the capabilities you need. Memory without guardrails? Just reasoning and tools? Full production stack? Each layer is an independent Effect Layer with explicit dependencies — no hidden coupling, no wasted resources.
Observable Execution Engine
Every agent task flows through a deterministic 10-phase lifecycle with before/after/error hooks. Every phase emits spans, metrics, and EventBus events. You see exactly what your agent decided, why, and how long it took.
5 Reasoning Strategies
ReAct for tool use. Reflexion for self-improvement. Plan-Execute for structured work. Tree-of-Thought for creative exploration. Adaptive to auto-select the best strategy. Register your own strategies too.
Model-Adaptive Intelligence
Context profiles tune prompts, budgets, and tool strategies per model tier. LLM-based tool classification, completion gap detection, and circuit breakers help smaller models punch above their weight — same code, better results across the full model spectrum.
Great DX
60 seconds to your first agent. Progressive disclosure — start with 3 lines,
add reasoning, memory, guardrails, and observability as you need them. The
builder API reads like a sentence. rax CLI scaffolds, runs, and inspects.
// Token-by-token streaming via AsyncGeneratorfor await (const event of agent.runStream("Write a haiku about TypeScript")) { if (event._tag === "TextDelta") process.stdout.write(event.text); if (event._tag === "StreamCompleted") console.log("\nDone!");}
// One-liner SSE endpointBun.serve({ fetch: (req) => AgentStream.toSSE(agent.runStream("Hello")) });// Multi-turn conversation with memoryconst session = agent.session();
await session.chat("What's the capital of France?");// → "Paris is the capital of France."
await session.chat("What's the population?");// → "Paris has approximately 2.1 million residents..."// (remembers context from previous turn)// Autonomous agent that runs 24/7const agent = await ReactiveAgents.create() .withProvider("anthropic") .withReasoning() .withTools() .withGateway({ heartbeat: { intervalMs: 3_600_000, policy: "adaptive" }, crons: [{ schedule: "0 9 * * MON", instruction: "Weekly report" }], webhooks: [{ path: "/github", adapter: "github" }], policies: { dailyTokenBudget: 50_000 }, }) .build();
const handle = agent.start(); // Runs forever, Ctrl+C to stopconst agent = await ReactiveAgents.create() .withName("production-agent") .withProvider("anthropic") .withModel("claude-sonnet-4-20250514") .withReasoning() // 5 reasoning strategies .withTools([...myTools]) // Sandboxed tool execution .withMemory("2") // Vector + FTS5 search .withGuardrails() // Injection, PII, toxicity detection .withVerification() // Semantic entropy fact-checking .withCostTracking() // Budget enforcement + model routing .withObservability() // Distributed tracing + metrics .withIdentity() // RBAC + agent certificates .withInteraction() // 5 autonomy modes .withAudit() // Compliance audit trail .withGateway({ // Persistent autonomous harness heartbeat: { intervalMs: 1_800_000, policy: "adaptive" }, crons: [{ schedule: "0 9 * * MON", instruction: "Weekly review" }], policies: { dailyTokenBudget: 50_000 }, }) .build();vs. LangChain / LlamaIndex
Python-first, dynamically typed, monolithic. Reactive Agents is TypeScript-native with Effect-TS type safety, fully modular layers, and built-in observability — you see every decision your agent makes, not just the final output.
vs. Vercel AI SDK
Great for streaming and tool calling, but stops there. Reactive Agents adds 5 reasoning strategies, persistent 4-tier memory, guardrails, verification, cost routing, and a 10-phase execution engine with full observability.
vs. AutoGen / CrewAI
Multi-agent frameworks without type safety, composable architecture, or model-adaptive intelligence. Reactive Agents gives you all three — plus model-adaptive context profiles that help local models perform far beyond naive prompting.
vs. Building From Scratch
20 production-ready packages with 1,773+ tests covering memory, reasoning, tools, A2A protocol, gateway, safety, cost, identity, and orchestration. Focus on your agent’s logic, not infrastructure.
ReactiveAgentBuilder -> createRuntime() -> CoreServices (EventBus, AgentService, TaskService) -> LLMProvider (Anthropic, OpenAI, Gemini, Ollama, LiteLLM 40+) -> Memory (Working, Semantic, Episodic, Procedural) -> Reasoning (ReAct, Reflexion, Plan-Execute, ToT, Adaptive) -> Tools (Registry, Sandbox, MCP Client) -> A2A (Agent Cards, JSON-RPC, SSE Streaming) -> Guardrails (Injection, PII, Toxicity, Contracts) -> Verification (Semantic Entropy, Fact Decomposition, Hallucination Detection) -> Cost (Complexity Router, Budget Enforcer) -> Identity (Certificates, RBAC) -> Observability (Tracing, Metrics, Structured Logging) -> Interaction (5 Modes, Checkpoints, Preference Learning) -> Orchestration (Multi-Agent Workflows) -> Prompts (Template Engine, Built-in Library) -> Gateway (Heartbeats, Crons, Webhooks, Policy Engine) -> ExecutionEngine (10-phase lifecycle with hooks)bun add reactive-agentsOr install individual packages for minimal bundle size. See installation guide →