Skip to content

Helix AgentsComposable AI Agents for TypeScript

Swap runtimes, state stores, and LLM providers without changing your agent code.

Quick Example

typescript
import { defineAgent, defineTool } from '@helix-agents/core';
import { JSAgentExecutor, InMemoryStateStore, InMemoryStreamManager } from '@helix-agents/sdk';
import { VercelAIAdapter } from '@helix-agents/llm-vercel';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';

// Define a tool
const searchTool = defineTool({
  name: 'search',
  description: 'Search the web for information',
  inputSchema: z.object({
    query: z.string().describe('Search query'),
  }),
  outputSchema: z.object({
    results: z.array(z.string()),
  }),
  execute: async ({ query }) => ({
    results: [`Results for: ${query}`],
  }),
});

// Define an agent
const ResearchAgent = defineAgent({
  name: 'researcher',
  systemPrompt: 'You are a helpful research assistant.',
  tools: [searchTool],
  outputSchema: z.object({
    summary: z.string(),
    sources: z.array(z.string()),
  }),
  llmConfig: {
    model: openai('gpt-4o'),
  },
});

// Create infrastructure and execute
const executor = new JSAgentExecutor(
  new InMemoryStateStore(),
  new InMemoryStreamManager(),
  new VercelAIAdapter()
);

const handle = await executor.execute(ResearchAgent, 'Research AI agents');

// Stream results
for await (const chunk of await handle.stream()) {
  if (chunk.type === 'text_delta') {
    process.stdout.write(chunk.delta);
  }
}

const result = await handle.result();
console.log(result.output);

Packages

PackageDescription
@helix-agents/coreTypes, interfaces, pure orchestration functions
@helix-agents/sdkQuick-start bundle (core + memory + JS runtime)
@helix-agents/runtime-jsIn-process JavaScript execution
@helix-agents/runtime-temporalDurable workflows via Temporal
@helix-agents/runtime-cloudflareEdge deployment on Cloudflare
@helix-agents/store-memoryIn-memory state (development)
@helix-agents/store-redisRedis state (production)
@helix-agents/llm-vercelVercel AI SDK adapter
@helix-agents/ai-sdkFrontend integration for AI SDK UI

Philosophy

Helix Agents is built around composability. Every major component is an interface:

  • Runtime: How agent loops execute (JS, Temporal, Cloudflare)
  • State Store: Where state persists (Memory, Redis, D1)
  • Stream Manager: How events flow (Memory, Redis pub/sub, Durable Objects)
  • LLM Adapter: Which model to use (Vercel AI SDK, custom)

You can use the pre-built implementations, or implement the interfaces yourself. The core package provides pure functions like planStepProcessing() and buildMessagesForLLM() that you can compose into your own execution loop.

Use pre-built or build your own - the choice is yours.

Released under the MIT License.