Skip to content

Reactive Agents

The open-source agent framework built for control, not magic. Every decision is controllable, observable, and auditable. Agent intelligence through engineering, not just bigger models.
20Packages
1,773+Tests
40+LLM Providers via LiteLLM
5Reasoning Strategies
10Execution Phases
rax demo
$
 
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 avg

Terminal window
bun add reactive-agents # or: npm install reactive-agents

That’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 AsyncGenerator
for 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 endpoint
Bun.serve({ fetch: (req) => AgentStream.toSSE(agent.runStream("Hello")) });

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)
Terminal window
bun add reactive-agents

Or install individual packages for minimal bundle size. See installation guide →