Quickstart
Prerequisites
Section titled “Prerequisites”The fastest path through this guide is the rax workflow (Rax = Reactive Agents Executable).
1. Create a Project
Section titled “1. Create a Project”Using the CLI:
bunx rax init my-agent-app --template standardcd my-agent-appbun installOr manually:
mkdir my-agent-app && cd my-agent-appbun init -ybun add reactive-agents2. Set Up Environment
Section titled “2. Set Up Environment”echo 'ANTHROPIC_API_KEY=sk-ant-...' > .envecho 'GOOGLE_API_KEY=...' >> .envecho 'TAVILY_API_KEY=tvly-...' >> .envecho 'LITELLM_API_KEY=...' >> .envecho 'OPENAI_API_KEY=...' >> .env3. Build an Agent
Section titled “3. Build an Agent”Create src/agent.ts:
import { ReactiveAgents } from "reactive-agents";
const agent = await ReactiveAgents.create() .withProvider("anthropic") .build();
const result = await agent.run("What are the three laws of thermodynamics?");console.log(result.output);That’s the minimum. .withProvider() picks the default model for the provider automatically (claude-sonnet-4-20250514 for Anthropic). Set ANTHROPIC_API_KEY in your environment before running.
To pin a specific model or add a name:
const agent = await ReactiveAgents.create() .withName("my-first-agent") .withProvider("anthropic") .withModel("claude-sonnet-4-20250514") .build();
const result = await agent.run("What are the three laws of thermodynamics?");console.log("Output:", result.output);console.log("Duration:", result.metadata.duration, "ms");console.log("Steps:", result.metadata.stepsCount);4. Run It
Section titled “4. Run It”bun run src/agent.ts5. Add Capabilities
Section titled “5. Add Capabilities”Enable memory, reasoning, and safety:
const agent = await ReactiveAgents.create() .withName("research-agent") .withProvider("anthropic") .withModel("claude-sonnet-4-20250514") .withMemory() // Default memory tier (see [Memory](../memory/); use `{ tier: "enhanced" }` for embeddings) .withReasoning() // ReAct reasoning loop .withGuardrails() // Input safety checks .withCostTracking() // Budget enforcement .build();What’s Next?
Section titled “What’s Next?”- Common builder stacks — Copy-paste chains (tools, memory, streaming, Agent as Data) with links to the full API reference
- Your First Agent — A deeper walkthrough
- Choosing a Stack — Pick provider/model/memory defaults quickly
- Agent Skills — Publish reusable implementation skills for coding agents
- Memory — How agent memory works
- Reasoning — Understanding reasoning strategies
- Troubleshooting — Diagnose common failures fast
- Architecture — The full layer system