Installation
From zero to running agent
Section titled “From zero to running agent”-
Install the meta-package.
Terminal window # Bun (recommended)bun add reactive-agents# Node.js 22.5+npm install reactive-agents -
Set at least one provider key in
.env(or skip if you’re going local).Terminal window echo 'ANTHROPIC_API_KEY=sk-ant-...' > .env# or OPENAI_API_KEY, GOOGLE_API_KEY, LITELLM_API_KEY -
Build your first agent — three lines is enough.
import { ReactiveAgents } from "reactive-agents";const agent = await ReactiveAgents.create().withProvider("anthropic").build();console.log((await agent.run("Hello")).output); -
Run it.
Terminal window # Bunbun run src/agent.ts# Node.js (requires tsx)npx tsx src/agent.ts
Simple Install
Section titled “Simple Install”The easiest way to get started is with the reactive-agents meta-package, which bundles everything:
bun add reactive-agents# or with npm (Node.js 22.5+)npm install reactive-agentsThen import from a single entry point:
import { ReactiveAgents } from "reactive-agents";Modular Install
Section titled “Modular Install”The framework is modular — install only the packages you need:
Foundation (required)
| Package | Description |
|---|---|
@reactive-agents/core | EventBus, AgentService, TaskService, canonical types |
@reactive-agents/runtime | 12-phase ExecutionEngine, ReactiveAgentBuilder, createRuntime() |
@reactive-agents/llm-provider | LLM adapters: Anthropic, OpenAI, Gemini, Ollama, LiteLLM (40+), Test |
Cognition (recommended)
| Package | Description |
|---|---|
@reactive-agents/reasoning | 6 strategies (ReAct, Plan-Execute, Reflexion, ToT, Adaptive) + composable kernel |
@reactive-agents/memory | 4-layer memory (working, semantic, episodic, procedural) on bun:sqlite |
@reactive-agents/tools | Tool registry, sandbox, MCP client, healing pipeline |
@reactive-agents/prompts | Template engine, version-controlled prompt library |
@reactive-agents/reactive-intelligence | Entropy sensor, reactive controller, learning engine, telemetry |
Production safety
| Package | Description |
|---|---|
@reactive-agents/guardrails | Injection, PII, toxicity detection, kill switch |
@reactive-agents/verification | Semantic entropy, fact decomposition, NLI hallucination detection |
@reactive-agents/cost | 27-signal complexity routing, budget enforcement, semantic cache |
@reactive-agents/identity | Ed25519 agent certificates, RBAC, delegation, audit |
@reactive-agents/diagnose | Output-leak detection (system-prompt, api-key, credential, internal) |
@reactive-agents/health | Health checks and readiness probes |
Observability
| Package | Description |
|---|---|
@reactive-agents/observability | OTLP tracing, MetricsCollector, structured logging |
@reactive-agents/trace | Trace event types and OTLP exporters |
New in v0.11
| Package | Description |
|---|---|
@reactive-agents/runtime-shim | Cross-runtime primitives (Bun + Node.js 22.5+) — Database, spawn, serve |
@reactive-agents/compose | Harness composition + 6 killswitches (maxIterations, budgetLimit, etc.) |
@reactive-agents/replay | Deterministic trace replay: record runs, replay without LLM calls |
@reactive-agents/observe | Zero-config OpenTelemetry/OpenInference tracing to any OTLP backend |
Composition & multi-agent
| Package | Description |
|---|---|
@reactive-agents/orchestration | Sequential, parallel, pipeline, map-reduce workflows |
@reactive-agents/a2a | Agent-to-Agent protocol: Agent Cards, JSON-RPC 2.0, SSE streaming |
@reactive-agents/gateway | Persistent autonomous harness: heartbeats, crons, webhooks, policy engine |
@reactive-agents/channels | Per-sender access control + chat-mode session storage for the gateway |
@reactive-agents/interaction | 5 autonomy modes, checkpoints, preference learning |
Evaluation & testing
| Package | Description |
|---|---|
@reactive-agents/eval | Evaluation suites, LLM-as-judge scoring, EvalStore (SQLite) |
@reactive-agents/scenarios | Pre-built test scenarios + scenario builder |
@reactive-agents/testing | Mock LLMService / ToolService / EventBus, assertion helpers (dev) |
Frontend integration
| Package | Description |
|---|---|
@reactive-agents/react | React 18+ hooks: useAgentStream, useAgent |
@reactive-agents/vue | Vue 3 composables: useAgentStream, useAgent with reactive refs |
@reactive-agents/svelte | Svelte 4/5 stores: createAgentStream, createAgent |
Developer tooling
| Package | Description |
|---|---|
@reactive-agents/cortex | Cortex Studio (Beacon, Thalamus, Lab, living skills) — bunx @reactive-agents/cortex |
bun add @reactive-agents/core @reactive-agents/runtime @reactive-agents/llm-provider# or with npmnpm install @reactive-agents/core @reactive-agents/runtime @reactive-agents/llm-providerEnvironment Variables
Section titled “Environment Variables”Create a .env file:
# LLM Provider — set at least oneANTHROPIC_API_KEY=sk-ant-... # Anthropic ClaudeOPENAI_API_KEY=sk-... # OpenAI GPT-4oGOOGLE_API_KEY=... # Google GeminiLITELLM_API_KEY=... # Optional — LiteLLM proxy auth when required
# Tools (optional)TAVILY_API_KEY=tvly-... # Enables built-in web search tool
# Embeddings (for enhanced / `"2"` memory tier — vector semantic search)EMBEDDING_PROVIDER=openai # "openai" | "ollama"EMBEDDING_MODEL=text-embedding-3-small
# Tuning (optional)LLM_DEFAULT_MODEL=claude-sonnet-4-6LLM_DEFAULT_TEMPERATURE=0.7LLM_MAX_RETRIES=3LLM_TIMEOUT_MS=30000TypeScript Configuration
Section titled “TypeScript Configuration”Reactive Agents requires TypeScript 5.5+ with strict mode:
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "strict": true, "exactOptionalPropertyTypes": true, "noUncheckedIndexedAccess": true }}Where to next
Section titled “Where to next” Quickstart — first agent in 5 minutes Provider key + 3 lines of code. The shortest path to a working agent.
Your First Agent (full walkthrough) Step-by-step: memory, reasoning, guardrails, hooks. Build out the minimum into a real one.
Choosing a Stack Pick provider · model tier · memory · reasoning strategy with a decision tree.
API Cheatsheet One-page reference of every important builder method, runtime call, and event.