# "Build the next Billion Agent" <!-- ref: @content/youtube/ai-jason/2025-06-10-build-the-next-billion-agent triggers: [need to generate product requirements, looking for vertical agent patterns, want to enhance knowledge work, seeking efficient AI integration] trigger_prompt: When a developer wants to create a specialized application that leverages AI for generating product requirements and enhancing user collaboration. version: 4 updated_at: 2026-10-31T19:29:38.811Z --> From AI Jason, 2025-06-10: Vertical agentic software — "Cursor for X" — is where AI value will be captured over the next 24 months, following AI coding as the first agent pattern to hit real product-market fit. AI Jason walks through the thesis behind "Cursor for X" vertical agents and builds a working PRD-generation app end-to-end using the Vercel AI SDK. ## Core Thesis Vertical agentic software — "Cursor for X" — is where AI value will be captured over the next 24 months, following AI coding as the first agent pattern to hit real product-market fit. The winning architecture pairs a tool-using agent (left-side chat) with a domain-specific canvas (right-side playground) that auto-feeds its visible state back into agent context, creating a co-working loop rather than a one-shot generator. ## Key Insights - **The "Cursor for X" pattern has two halves**: a tool-equipped agent that completes valuable tasks, and a specialized review canvas where users co-work with output. Context on the canvas auto-pipes into the chat — the bidirectional link is the product. - **Open verticals are wide**: Cursor for Slides, Spreadsheets, Design, Video, Writing, PRD planning all lack a dedicated agent UX today. Existing plays: Cursor, Windsurf, Google Stitch (UI), Clava (video). - **Vercel AI SDK collapses the stack**: Core abstracts model providers (swap Anthropic ↔ OpenAI via one import), UI streams results to React. `streamText`, `streamObject`, and `tool` are the primary primitives. - **Agents without a runtime**: Adding `maxSteps: N` to a tool-enabled call transforms it into a full agent loop (tool call → execute → respond) — no custom orchestration needed. - **Structured streaming output** is trivially easy with `streamObject` + Zod schemas (Pydantic-for-TS), where `.describe()` hints guide the model. This is notably harder in Python. - **Tool invocations are a state machine**: `partial-call` (args still generating) → `call` (finished, executing) → `result` (completed). Each state should render differently for progress visibility. - **Streaming sub-agent output is not native** to Vercel AI SDK. To stream a child LLM's tokens back through the parent, wrap with `createDataStreamResponse`, iterate the child's `fullStream`, forward `text-delta` events via `dataStreamWriter.writeData`, then `mergeIntoDataStream`. Tag chunks with metadata (e.g. `type: "prd-content"`) so the frontend can filter them. - **Dual persistence is required**: ephemeral React state for streaming speed + durable DB writes for reload. State bridges the chat panel and the canvas panel — `setData` passed down from parent into chat triggers the artifact view to re-render. - **Versioning emerges naturally** from timestamped regenerations (V1, V2) tied to shared state, without explicit versioning logic. ## Actionable Takeaways 1. **Pick a knowledge-work vertical** without a dedicated agent UX. Design the review canvas as carefully as the chat — auto-pipe its visible state into agent context. 2. **Scaffold**: `pnpm install ai @ai-sdk/openai` (or `@ai-sdk/anthropic`), then `npx shadcn@latest init` with Next.js for a styled starter. 3. **Backend pattern**: `app/api/chat/route.ts` — import `openai`, `zod`, `streamText`; `POST` destructures `messages` and returns `result.toDataStreamResponse()`. 4. **Frontend pattern**: `"use client"` page, `useChat` from `ai/react` pointed at `/api/chat`, `maxSteps: 5` for autonomous multi-step runs. 5. **For structured output**: use `streamObject` + Zod schemas; annotate fields with `.describe()` to steer the model. Validate tool args with `z.number()` etc. 6. **For streaming sub-agent results** through a parent agent: wrap the response with `createDataStreamResponse`, forward `text-delta` events with metadata, and merge streams. 7. **For the split-panel UX**: define `[data, setData]` at the route level (`/project/[id]`), pass `setData` into the chat panel, use `useEffect` on `messages`/`data`/`isLoading` to sync streamed chunks into project state, join chunks in the content panel. 8. **Refactor early** — split `page.tsx` into components before it becomes monolithic. ## Notable Quotes > "Vertical agentic software is going to be where the value gets captured." > "AI coding is the first agent use case that hit real product-market fit." > "You actually don't need to build your own agent runtime. All you need to do is pass maxSteps." > "Zod is basically Pydantic in TypeScript." > "State is a short-term database or short-term memory — every time the state changes it triggers the UI to re-render." > "This is how you create an agentic system that has both a chat experience and a playground using Vercel AI." --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*