vercel-labs/fx0

Developer Tools

A working example app showing how to build a durable, streaming AI agent on libfx and Vercel's infrastructure.

398
74
TypeScript
Apache-2.0
5 days old

fx0 is best read as a reference application, not a product to adopt wholesale: it shows how much of an agent loop can be delegated to libfx and how the remaining pieces fit on Vercel. If you are designing your own chat-plus-generation agent on that stack, its source is worth a few hours.

The problem

You have an idea for a design assistant: the user describes a page, and the agent returns one HTML file they can preview, copy and download. Building that from scratch means wiring chat, streaming, tool calls, retries, session persistence and billing before anyone sees a result. fx0 packages that whole flow — describe a page, pick a model, generate an HTML artifact, reopen any earlier version — so the remaining work is the part specific to your idea. The result is a deployed app that also doubles as a readable map of the libfx integration.

What's different

The central choice is delegation: one createFxAgent() call supplies the agent loop, streaming, tool calls, retries and durable sessions, and createFxEngine() runs subagents. According to the README, fx0 contains no recovery code of its own; durability comes from libfx's default wiring to Vercel's World store and Vercel Queues, so a turn continues if the executing function dies. That separation appeals if you are already on Vercel: application code stays focused on prompts, questions, cancellation and the transcript.

The trade-off is architectural lock-in and a real latency tail. A prompt runs its turn in the sending request, so the reply starts without a queue — but if that request crashes, the continuation arrives roughly 13 minutes later, because libfx cannot distinguish a crashed function from a slow one and holds the session until its 800-second limit. A turn that merely runs long is stopped 30 seconds before the limit and handed off immediately. fx0 also caps a turn at 64 model steps, subagents included, bounding loop-driven spend at the cost of truncating genuinely long tasks. Generated pages run in a sandboxed iframe on an opaque origin with connect-src 'none', though the README is explicit that browser enforcement, not a sealed VM, does the work.

Who should try it

Good fit: a developer building an agent product on Vercel who wants a concrete example of durable sessions, per-turn artifacts, model selection with reasoning effort, and AI Gateway billing. The demo at fx0.vercel.dev is the fastest way to judge the interaction model. Poor fit: anyone wanting a self-contained tool that runs without Vercel services, or a local-only design assistant — local runs still require a Sign in with Vercel app, Neon Postgres and Upstash Redis, per the project instructions. If you are comparing agent frameworks rather than Vercel's stack, the design will feel tied to one vendor.

Requirements and limitations

Local development needs Node.js 24 plus three external services: a Sign in with Vercel app with the openid profile email offline_access scopes and AI Gateway/team permissions, a Neon Postgres database, and an Upstash Redis database. Omitting offline_access breaks sign-in because no refresh token is issued — a detail that will bite anyone assembling credentials casually. The test suite splits into paths: some checks need local Redis binaries or Chrome, and the journal integration test needs remote KV credentials.

Ongoing upkeep centers on the Vercel-side dependencies. Deployment needs the same environment variables, the Neon and Upstash marketplace integrations, and APP_URL set correctly with a matching callback URL. The five free prompts per IP are optional and depend on BotID plus a server-only Gateway key. The code layout is documented in the repository, but the service requirements are the real gate.

HotRepo's take

HotRepo recorded 398 total stars, #12 on the NEW-REPOSITORY board for TypeScript, on 2026-10-25, with the project five days old. That is one dated snapshot across two recorded dates, with no comparable daily-board history, so persistence cannot yet be judged. Treat fx0 as a well-documented example to read before committing; confirm libfx covers your deployment target before assuming the durability story transfers.

Written by AI from the project's README, updated October 25, 2026. The project's own docs are the source of truth.