Skip to content

Installation

  1. Install the meta-package.

    Terminal window
    # Bun (recommended)
    bun add reactive-agents
    # Node.js 22.5+
    npm install reactive-agents
  2. 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
  3. 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);
  4. Run it.

    Terminal window
    # Bun
    bun run src/agent.ts
    # Node.js (requires tsx)
    npx tsx src/agent.ts

The easiest way to get started is with the reactive-agents meta-package, which bundles everything:

Terminal window
bun add reactive-agents
Terminal window
# or with npm (Node.js 22.5+)
npm install reactive-agents

Then import from a single entry point:

import { ReactiveAgents } from "reactive-agents";

The framework is modular — install only the packages you need:

Foundation (required)

PackageDescription
@reactive-agents/coreEventBus, AgentService, TaskService, canonical types
@reactive-agents/runtime12-phase ExecutionEngine, ReactiveAgentBuilder, createRuntime()
@reactive-agents/llm-providerLLM adapters: Anthropic, OpenAI, Gemini, Ollama, LiteLLM (40+), Test

Cognition (recommended)

PackageDescription
@reactive-agents/reasoning6 strategies (ReAct, Plan-Execute, Reflexion, ToT, Adaptive) + composable kernel
@reactive-agents/memory4-layer memory (working, semantic, episodic, procedural) on bun:sqlite
@reactive-agents/toolsTool registry, sandbox, MCP client, healing pipeline
@reactive-agents/promptsTemplate engine, version-controlled prompt library
@reactive-agents/reactive-intelligenceEntropy sensor, reactive controller, learning engine, telemetry

Production safety

PackageDescription
@reactive-agents/guardrailsInjection, PII, toxicity detection, kill switch
@reactive-agents/verificationSemantic entropy, fact decomposition, NLI hallucination detection
@reactive-agents/cost27-signal complexity routing, budget enforcement, semantic cache
@reactive-agents/identityEd25519 agent certificates, RBAC, delegation, audit
@reactive-agents/diagnoseOutput-leak detection (system-prompt, api-key, credential, internal)
@reactive-agents/healthHealth checks and readiness probes

Observability

PackageDescription
@reactive-agents/observabilityOTLP tracing, MetricsCollector, structured logging
@reactive-agents/traceTrace event types and OTLP exporters

New in v0.11

PackageDescription
@reactive-agents/runtime-shimCross-runtime primitives (Bun + Node.js 22.5+) — Database, spawn, serve
@reactive-agents/composeHarness composition + 6 killswitches (maxIterations, budgetLimit, etc.)
@reactive-agents/replayDeterministic trace replay: record runs, replay without LLM calls
@reactive-agents/observeZero-config OpenTelemetry/OpenInference tracing to any OTLP backend

Composition & multi-agent

PackageDescription
@reactive-agents/orchestrationSequential, parallel, pipeline, map-reduce workflows
@reactive-agents/a2aAgent-to-Agent protocol: Agent Cards, JSON-RPC 2.0, SSE streaming
@reactive-agents/gatewayPersistent autonomous harness: heartbeats, crons, webhooks, policy engine
@reactive-agents/channelsPer-sender access control + chat-mode session storage for the gateway
@reactive-agents/interaction5 autonomy modes, checkpoints, preference learning

Evaluation & testing

PackageDescription
@reactive-agents/evalEvaluation suites, LLM-as-judge scoring, EvalStore (SQLite)
@reactive-agents/scenariosPre-built test scenarios + scenario builder
@reactive-agents/testingMock LLMService / ToolService / EventBus, assertion helpers (dev)

Frontend integration

PackageDescription
@reactive-agents/reactReact 18+ hooks: useAgentStream, useAgent
@reactive-agents/vueVue 3 composables: useAgentStream, useAgent with reactive refs
@reactive-agents/svelteSvelte 4/5 stores: createAgentStream, createAgent

Developer tooling

PackageDescription
@reactive-agents/cortexCortex Studio (Beacon, Thalamus, Lab, living skills) — bunx @reactive-agents/cortex
Terminal window
bun add @reactive-agents/core @reactive-agents/runtime @reactive-agents/llm-provider
Terminal window
# or with npm
npm install @reactive-agents/core @reactive-agents/runtime @reactive-agents/llm-provider

Create a .env file:

Terminal window
# LLM Provider — set at least one
ANTHROPIC_API_KEY=sk-ant-... # Anthropic Claude
OPENAI_API_KEY=sk-... # OpenAI GPT-4o
GOOGLE_API_KEY=... # Google Gemini
LITELLM_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-6
LLM_DEFAULT_TEMPERATURE=0.7
LLM_MAX_RETRIES=3
LLM_TIMEOUT_MS=30000

Reactive Agents requires TypeScript 5.5+ with strict mode:

tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true
}
}