Skip to content
Playground

Examples Catalog

Last updated 1 day ago · 6180eff

↑ Updated yesterday

"docs: align v0.17 release notes with shipped changesets and credit contributors" · 6180eff · 2026-10-10

  • # Run or list a standalone demo through Rax
  • ## Demos
  • # List or launch a standalone demo

The repo includes a complete, tested example suite at apps/examples/. Every example exports a run() function, can be executed standalone with bun run, and runs in CI. The fastest way to learn this framework is to copy one of these and tweak it.

  • Directoryapps/examples/
    • Directoryfoundations/ the minimum builder chain → memory → composition
      • …
    • Directorytools/ built-in tools, MCP servers, dynamic registration
      • …
    • Directoryreasoning/ strategies + model-adaptive context profiles
      • …
    • Directorytrust/ identity, guardrails, verification
      • …
    • Directorymulti-agent/ A2A protocol, orchestration, dynamic spawning
      • …
    • Directorystreaming/ token streaming + SSE endpoints
      • …
    • Directoryintegrations/ Next.js · Hono · Express adapters
      • …
    • Directorygateway/ persistent autonomous agents
      • …
    • Directorymessaging/ Signal + Telegram via MCP
      • …
    • Directoryinteraction/ 5 autonomy modes
      • …
    • Directoryadvanced/ cost · observability · self-improvement · eval
      • …
    • Directorydemos/ standalone showcase apps (not part of the numbered/CI catalog)
      • …
    • index.ts CLI runner — bun run index.ts --filter <category>
    • README.md
Terminal window
git clone https://github.com/tylerjrbuell/reactive-agents-ts
cd reactive-agents-ts/apps/examples
# Run all offline examples (no API key needed)
bun run index.ts --offline
# Run a specific example
bun run src/foundations/01-simple-agent.ts
# Run or list a standalone demo through Rax
rax examples list
rax examples demo island-sim --provider ollama --model cogito:14b --port 3007
# Run all examples that match a category
bun run index.ts --filter foundations

The shortest path from bun add reactive-agents to a working agent.

#ExampleWhat it shows
01simple-agentThe minimum builder chain — provider, build, run
02lifecycle-hooksIntercept any of the 12 phases with before / after / on-error
03multi-turn-memoryagent.session() for conversational memory
04agent-compositionCompose specialized agents into pipelines
05agent-configAgent-as-data: serialize → JSON → reconstruct
06compositionpipe(), parallel(), race() functional combinators

Built-in tools, MCP servers, and runtime tool registration.

#ExampleWhat it shows
05builtin-toolsweb-search, file-read, code-execute, etc.
06mcp-filesystemMCP filesystem server via .withMCP()
07mcp-githubMCP GitHub server
—mcp-oauthOAuth 2.1 client_credentials against a remote MCP server via .withMCP({auth})
—dynamic-registrationagent.registerTool() / unregisterTool() at runtime

The reasoning strategies and model-adaptive context profiles.

#ExampleWhat it shows
19reasoning-strategiesReAct, Reflexion, Plan-Execute, Tree-of-Thought, Adaptive
20context-profilesLocal / mid / large / frontier tier tuning

Identity, guardrails, and verification.

#ExampleWhat it shows
11identityEd25519 certificates, RBAC, delegation
12guardrailsPre-LLM injection, PII, toxicity blocking
13verificationSemantic entropy, fact decomposition, NLI

A2A protocol, orchestration, and dynamic sub-agent spawning.

#ExampleWhat it shows
08a2a-protocolAgent Cards, JSON-RPC server/client, SSE
10dynamic-spawning.withDynamicSubAgents() — model-driven delegation

Token streaming, SSE endpoints, and abort signals.

#ExampleWhat it shows
23token-streamingagent.runStream() AsyncGenerator with IterationProgress events
24streaming-sse-serverOne-line AgentStream.toSSE() HTTP endpoint

Drop-in adapters for popular Node/Bun servers.

#ExampleWhat it shows
25nextjs-streamingNext.js Route Handler with useAgentStream
26hono-agent-apiHono on Bun with SSE streaming
27express-middlewareExpress middleware pattern

Persistent autonomous agents with heartbeats, crons, and webhooks.

#ExampleWhat it shows
22persistent-gatewayAdaptive heartbeat + cron scheduling + webhook ingestion
25hn-gateway-monitorReal-world monitor: 24/7 Hacker News watcher with policy budgets
26gateway-chat-modePer-sender SQLite session history + episodic context injection

Connect agents to Signal and Telegram via MCP.

ExampleWhat it shows
signal-telegram-hubMulti-channel message hub bridging Signal + Telegram + the agent

Autonomy modes and approval gates.

#ExampleWhat it shows
21interaction-modesAutonomous · Supervised · Collaborative · Consultative · Interrogative

Cost tracking, observability, self-improvement, evaluation.

#ExampleWhat it shows
14cost-trackingComplexity routing + budget enforcement + dynamic pricing
15prompt-experimentsA/B testing prompts via the prompt library
16eval-frameworkLLM-as-judge scoring with frozen-judge isolation
17observabilityDistributed tracing + metrics dashboard + structured logging
18self-improvementCross-task strategy outcome learning
20compose-harnessComposable harness pipeline
22durable-hitlDurable approval gates — run() pause → approveRun/denyRun + onApproval

Standalone showcase apps under apps/examples/src/demos/ are not part of the numbered index.ts catalog above (they have no run() export). Each has its own usage notes and focused tests where provided.

ExampleWhat it shows
halopedia-agentFull-featured interactive research agent: 7 custom domain tools (search, page/section/table fetch, cross-entity compare, link-graph explore), persistent cross-session memory (.withMemory() + find/recall/relate meta-tools), .withToolIntent() for domain-tuned chat routing, agent.session({ onOverflow }) for summarize-on-overflow history compaction, and verifyCitations: true to catch uncited/fabricated sources — run bun run apps/examples/src/demos/halopedia-agent.ts for a live Halo-lore REPL (requires Ollama)
local-vs-frontierSame builder chain run twice — a local 4B model and a frontier model complete the same tool-using task, only the provider/model line changes (see demos/README.md for GIF recording)
canonical-chat-sessionReference agent.session() conversational loop
durable-resumeCrash-resume via .withDurableRuns() outside the eval-scoped 22-durable-hitl example
island-survivalDeterministic survival simulation with optional local world generation and camp-batched System One decisions; provider failures fall back to scripted moves

Terminal window
# Offline only (test provider — no API keys needed)
bun run index.ts --offline
# Filter by category
bun run index.ts --filter reasoning
# Single file, standalone
bun run src/foundations/01-simple-agent.ts
# List or launch a standalone demo
rax examples list
rax examples demo island-sim --provider ollama --model cogito:14b --port 3007
# All examples (requires ANTHROPIC_API_KEY etc. in .env)
bun run index.ts

Every example is exercised by the test runner on every PR — if it’s listed here, it works.