Skip to content

Quickstart

Using the CLI:

Terminal window
bunx rax init my-agent-app --template standard
cd my-agent-app
bun install

Or manually:

Terminal window
mkdir my-agent-app && cd my-agent-app
bun init -y
bun add reactive-agents effect
Terminal window
echo 'ANTHROPIC_API_KEY=sk-ant-...' > .env
echo 'GOOGLE_API_KEY=...' >> .env
echo 'TAVILY_API_KEY=tvly-...' >> .env
echo 'LITELLM_API_KEY=...' >> .env
echo 'OPENAI_API_KEY=...' >> .env

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();
Terminal window
bun run src/agent.ts

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();