Back to Workshops
Workshop Basic or above

Build and Deploy an FAQ Agent with Vercel AI SDK and Gateway

June 25, 2026

We take the FAQ agent from the earlier deployment workshops and ship it on Vercel. The same agent answers Data Engineering Zoomcamp questions. Now a Next.js app serves the UI and a serverless function runs the agent loop, with the chat model reached through the Vercel AI Gateway.

Last week we put the agent on Cloudflare Workers. This week we test whether Vercel is a better fit. Vercel is JavaScript-first, like Cloudflare, but it markets agentic infrastructure.

We use four parts of that stack:

  • The AI SDK for building the agent.
  • The AI Gateway as one keyless endpoint in front of every model provider.
  • Workflows for durable runs.
  • Eve, a convention-over-configuration agent framework where an agent is just a directory.

We build the same agent four ways, each in its own deployable folder, so we can compare the frameworks against one fixed problem:

  • The Vercel AI SDK, with a ToolLoopAgent and in-memory MiniSearch.
  • The same agent rebuilt on Eve, with durable sessions and a built-in HTTP API.
  • Eve again, but we move retrieval to Upstash Vector for semantic search.
  • A Python (FastAPI) backend with a hand-written agent loop, for teams that prefer Python.

Here's how a browser request flows through the app to the agent loop, the model, and retrieval:

flowchart LR USER["browser"] --> APP["Next.js app on Vercel"] APP -->|"POST /chat"| FN["serverless function: agent loop"] FN -->|"call search tool"| SEARCH["search"] FN -->|"chat completion"| GW["AI Gateway"] GW -->|"gpt-5.4-mini"| MODEL["model provider"] subgraph retrieval["retrieval (one per option)"] MS["MiniSearch (in-memory)"] UV[("Upstash Vector")] end SEARCH --> MS SEARCH --> UV

The first three build on each other, so we go through them in order. For the last one we rewrite the first version in Python. We swap the TypeScript backend for FastAPI while keeping the Next.js frontend. The same Python service then serves both the UI and the API as a single Vercel Function.

We start on the free tier, where Vercel's free plan covers the build and local testing. Its active-CPU billing only counts time the function is computing, not the time it waits on the model. You pay only while the agent runs, which suits a chat agent well.

The only thing you pay for is the model. That costs a few dollars of OpenAI usage, or the Vercel AI Gateway's free credits once a card is on file. We discuss the limits and pricing in Part 3: Deploy to Vercel.

Links

Resources used here:

Upgrade to Basic to access this workshop

The workshop overview and page list are visible now; membership unlocks the step-by-step tutorial.

Basic or above required

View Pricing