Open-source agent runtime

Durable agents,
inside your app.

Flary stores the thread, streams events, runs tools, and resumes work after a disconnect or Worker restart.

Read the quickstart

Apache-2.0 · TypeScript · deploys to your Cloudflare account

Included with Flary

Use the runtime directly or start with a working interface.

The agent backend, React console, Web Component, and mail starter use the same thread and event model.

Runtime

Agent runtime

Durable threads, streaming events, tools, Code Mode, subagents, approvals, memory, workspaces, and recovery.

Use the API from any product UI

Interfaces

Chat interfaces

Ship the React console, use the durable thread hooks, or embed the Web Component and keep your own design system.

React · hooks · /widget.js

Flary Mail

Team email

Deploy a self-hosted team inbox with inbound mail, replies, drafts, attachments, search, and live updates.

D1 · R2 · Queues · Email Routing

Runtime

Flary handles the agent loop.

Your code supplies identity, tools, data, and policy. Flary stores the thread, runs the model and tools, and emits durable events.

01

Persistent threads

Runs survive disconnects and resume from an exact event cursor.

02

Long-running work

A turn can pause for input, approval, or a child agent and continue after a restart.

03

Realtime streaming

WebSocket, SSE, and HTTP clients receive one normalized durable event stream.

04

Small tool surface

Search and describe application, MCP, and OpenAPI tools only when the model needs them.

05

Parallel execution

Run independent reads together while policy keeps sensitive actions controlled.

06

Provider freedom

Use OpenAI, Anthropic, Google, or Kimi without replacing the thread runtime.

Examples

See how products use Flary.

These examples cover a SaaS product agent, an embedded storefront assistant, and the package APIs beneath them.

src/flary.ts
import { flary } from "flary";

export const app = flary({
  model: "openai/gpt-5",
});

Tracked and Fairway Florist are verified Flary integrations.

Deployment

Deploy to your Cloudflare account.

Flary provisions serverless resources and deploys the runtime. You do not maintain a VPS, container cluster, queue consumer, or separate WebSocket service.

Available nowguided CLI

One command, then browser sign-in.

Choose the dashboard, backend, or mail starter. Wrangler opens Cloudflare OAuth, then Flary provisions, deploys, and checks the result.

Coming nexthosted installer

No terminal required.

Connect Cloudflare on flary.dev, choose a starter, and deploy from the browser. The installed Worker and data will still belong to your Cloudflare account.

Read the deployment model
Durable production coreWorker · Durable Objects · D1 · R2 · Queues
Enabled only when neededBrowser Rendering · Sandbox · Email Routing

Tool discovery

Keep large tool catalogs out of every prompt.

Application tools stay in a private catalog until the agent needs them. Credentials and large schemas do not fill every model request.

Explore tools and Code Mode
model
  ├─ request_user_input
  ├─ request_secret
  └─ execute
       ├─ tools.search
       ├─ tools.describe
       ├─ tools.call
       └─ tools.batch
            ↓
local · mcp · openapi · workspace
            ↓
policy · approval · replay · audit

Get started

Run your first Flary agent
on Cloudflare.