Installation
Last updated 1 day ago · 5ad31ba
Updated yesterday
"docs: first-timer onboarding fixes — broken first command, zero-key path, funnel order" · 5ad31ba · 2026-07-21
- # or OPENAI_API_KEY, GOOGLE_API_KEY, GROQ_API_KEY, XAI_API_KEY, LITELLM_API_KEY
- # No key? Run fully local with Ollama instead:
- ## TypeScript Configuration
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-agentsSet 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, GROQ_API_KEY, XAI_API_KEY, LITELLM_API_KEY# No key? Run fully local with Ollama instead:ollama pull qwen3:4bGoing local, swap the provider in step 3:
.withProvider("ollama").withModel("qwen3:4b")— no key required. See the Local Models guide.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-agentsnpm install reactive-agentspnpm add reactive-agentsyarn add 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, Groq, xAI, Ollama, LiteLLM (40+), Test |
Cognition (recommended)
| Package | Description |
|---|---|
@reactive-agents/reasoning | 7 strategies (ReAct, Blueprint, Plan-Execute, Reflexion, ToT, Adaptive, Code-Action) + 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 | Multi-factor 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/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/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-providernpm install @reactive-agents/core @reactive-agents/runtime @reactive-agents/llm-providerpnpm add @reactive-agents/core @reactive-agents/runtime @reactive-agents/llm-provideryarn add @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 GeminiGROQ_API_KEY=gsk_... # GroqXAI_API_KEY=xai-... # xAI GrokLITELLM_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. This is the minimum config:
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "strict": true }}Two stricter flags are recommended for new projects — but they tighten checks across your whole codebase, so enabling them in an existing project may require code changes beyond Reactive Agents:
{ "compilerOptions": { "exactOptionalPropertyTypes": true, "noUncheckedIndexedAccess": true }}