Quickstart
Prerequisites
Section titled “Prerequisites”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-agents effect2. 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";
async function main() { // await using disposes the agent automatically when the block exits await using 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);}
main();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("1") // Tier 1: FTS5 search .withReasoning() // ReAct reasoning loop .withGuardrails() // Input safety checks .withCostTracking() // Budget enforcement .build();What’s Next?
Section titled “What’s Next?”- Your First Agent — A deeper walkthrough
- Memory — How agent memory works
- Reasoning — Understanding reasoning strategies
- Architecture — The full layer system