Tailrace
Integrations

Cloudflare Agents

Compose Tailrace with Cloudflare Agents via @tailrace/ai-sdk wraps, DO identity, and KV vault.

Best UX for Cloudflare Agents / AIChatAgent: one package wires identity, vault, and AI SDK wraps.

Quickstart

import { createCloudflareTailrace, withCloudflareAgents } from "@tailrace/cloudflare-agents";
import { streamText, convertToModelMessages } from "ai";

const tr = createCloudflareTailrace(env, {
  agent: this.name,
  workflowId: this.name,
  kv: env.TAILRACE_VAULT,
});

const { model, tools } = withCloudflareAgents(tr, {
  agent: this.name,
  workflowId: this.name,
}).forChat({ model: baseModel, tools: { crm: crmTool } });

Compose: depends on @tailrace/ai-sdk (no streaming reimplementation). Peer: ai@^5.

Guides

Reference

On this page