Skip to content

Examples

Complete, runnable examples demonstrating Helix Agents patterns and features.

Choosing an Example

Use this decision matrix to find the right starting point:

If you need...Start with
Learn the basicsResearch Assistant
Durable workflowsResearch Assistant (Temporal)
Edge deployment (simple)Research Assistant (Cloudflare)
Edge + unlimited streamingResearch Assistant (Cloudflare DO)
Full-stack with SSRResumable Streams (Next.js)
Production edge + Next.jsOpenNext + Cloudflare DO
Custom execution logicCustom Loop

Feature Comparison

ExampleRuntimeFrontendPersistenceResumableSSR
Research AssistantJSNoneMemoryNoNo
Research Assistant (Temporal)TemporalNoneExternalYesNo
Research Assistant (Cloudflare)WorkflowsNoneD1YesNo
Research Assistant (Cloudflare DO)DONoneSQLiteYesNo
Resumable Streams (Next.js)JSNext.jsRedisYesYes
OpenNext + Cloudflare DODONext.jsSQLiteYesYes
Custom LoopCustomNoneNoneCustomNo

When to Use Each Runtime

JS Runtime (runtime-js):

  • Local development and testing
  • Single-process applications
  • Serverless functions with short execution

Temporal Runtime (runtime-temporal):

  • Long-running workflows (hours/days)
  • Complex retry and compensation logic
  • Existing Temporal infrastructure

Cloudflare Workflows (runtime-cloudflare):

  • Edge deployment with durability
  • Executions under 15 minutes
  • D1 database integration

Cloudflare Durable Objects (store-cloudflare with AgentServer):

  • Unlimited execution time
  • Real-time streaming requirements
  • SSE-based resumable streams
  • Direct WebSocket-like patterns

Quick Start Examples

ExampleRuntimeDescription
Research AssistantJSBasic agent with tools, state, and streaming
Research Assistant (Temporal)TemporalSame agent with durable execution
Research Assistant (Cloudflare)CloudflareEdge deployment with D1 and Workflows
Research Assistant (Cloudflare DO)Cloudflare DOAgentServer extensibility, lifecycle hooks

Advanced Examples

ExampleDescription
Custom LoopBuild your own execution loop without runtime helpers
Resumable Streams (Next.js)SSR, stream resumption, crash recovery with React hooks
OpenNext + Cloudflare DOFull-stack Next.js on Cloudflare with DO streaming

By Feature

State Management

Sub-Agents

Streaming

Durable Execution

AgentServer Extensibility

Stream Resumption & Crash Recovery

Running Examples

All examples are in the examples/ directory of the monorepo:

bash
# Clone and setup
git clone https://github.com/your-org/helix-agents.git
cd helix-agents
npm install
npm run build

# Run JS example
cd examples/research-assistant
npm test                              # Run tests (no API key needed)
OPENAI_API_KEY=sk-xxx npm run demo    # Run with real LLM

See each example's README for specific setup instructions.

Released under the MIT License.