Raza Rizwan

Build your agent

What this room is for: after the counting method gives you a plan, these pages guide your coding agent to understand the work, choose the shape, design the experience, write the spec, govern it, build a basic text-only worker on the OpenAI Agents SDK, grade it, wrap it in FastAPI, ship it in a container to Vercel, test it end to end, and know where the record and the book continue. Every page is taken from The AI Agent Factory; only the Vercel steps come from Vercel's own docs.

Status
stable
Trust
human-reviewedHuman: Raza Rizwan ·
7 min read
Owner
Human: Raza Rizwan
Approved
Human: Raza Rizwan ·

The method ends with a step table: which steps of your work are AI, which are decisions, which are typing, and two numbers. This room is what comes after the table. It takes one row of it and turns it into a worker you can call from anywhere: a basic agent, built by your coding agent, one page at a time. It is written for any workflow in any business, because the pages teach how to read the work, not one example of it.

What you get

A text-only agent on the OpenAI Agents SDK, in Python, wrapped in a FastAPI harness with two endpoints, built into a container image, deployed to Vercel, and proven at each of those three places with the book's own done-when checks. Text in, text out. It has one agent, typed function tools, a session so it remembers the conversation, a guardrail that can stop a turn, a human approval gate on any tool that changes something, streaming so a person never watches a blank screen, and a trace of every run from day one. It runs on the SDK's default model with the key you give it.

Around the code, the room gives you the decisions the code depends on: a delegation map that says who owns each step and why, the shape the worker should have, the surface a person trusts, a one-page governance record, a spec, an eval suite that grades the rate rather than the run, and a way to diagnose the worker when it disappoints you.

What it is not, on purpose: no voice, no calling, no realtime channel, and no code execution. The book's crash course goes further, into handoffs to specialist agents, model routing and sandboxes, 1 and its deployment course adds a database, file storage and an isolated place to run generated code. 2 The room now says where each of those begins: the shape page names the patterns beyond a single agent, and the record page describes the tables and the wire a worker grows into. The book's own design makes this possible: the harness boots with only the model key set, and every other backend is off until its key exists. 2

Who it is for

Someone with a working plan from the method, a coding agent (the book's companion names Claude Code, OpenCode or similar), a Python toolchain, and an model key of their own: OpenAI's by default, or Gemini, Claude or Grok as use another model shows. You paste each page to your coding agent in order and read what comes back; the coding agent writes and runs the code. One thing to budget for, in the book's words: a durable worker runs on the API, where every model call is metered and paid for. 3 The build page says how to scope and cap the key.

The twenty-two pages, in order

#PageWhat it settles
1This pageWhat the room builds and what it leaves out
2Is this an agent problem?The three gates: AI or tool, agent or chatbot, ready or not
3Understand the workFive components, the window test, the delegation map: who owns each step and why
4From plan to workerThe four promotions from a proven by-hand run to a worker
5Choose the shapeFive questions, five patterns, and when a single agent is right
6Design the experienceTrust, the autonomy dial, recovery, the machine surface, and what makes a worker natural
7Write the specThe constitution and the four artifacts, research, spec, plan and tasks, in specs/; behaviour only, tightened by interview
8Govern itFour questions, a defined gate, data tiers, the one-page record
9Tests firstRed, green, refactor on one slice; deep modules
10Build the text agentAgent, runner, tools, sessions, guardrails, approval, streaming, tracing
11Loop and harnessThree stops, five verbs, allow / ask / deny, the progress file
12Evals before shippingThe golden set, the calibrated judge, the baseline, the unscripted set
13Diagnose misbehaviourFour causes by timing, the cheapest fix first, where the fix lives
14FastAPI, Docker, VercelThe harness, the image, the deployment
15Test end to endDone-when at the laptop, the container and the live URL
16Give it a recordThe tables a worker runs against, the audit trail, the MCP wire
17Worked exampleThe book's support agent taken through all of it
18Write a skillThe description is the trigger, the body is the instructions
19The skillThe room as a downloadable skill for your coding agent
20Use another modelGemini, Claude, Grok, DeepSeek or a local model in the same harness
21Demo or productionThe opening round, two depths of the same steps, and the upgrade path
22The worker's pagePassword, upload, Run and a chat in the person's own language, for every worker

Start at page 2 even if you are sure. Not every job is an AI job, and not every AI job needs an agent; and a mistake in your plan costs nothing to fix, while a mistake you only notice after the agent has spent an hour doing the wrong thing costs you that whole hour. 4

Pages 3, 5, 6, 8, 13, 16 and 18 are the ones that make the room portable to any niche: they are methods for reading a workflow, choosing a shape, earning trust, staying safe, diagnosing a failure, growing into a record and writing a skill, and none of them assumes a particular business.

Where every word comes from

Every page in this room is taken from The AI Agent Factory, the Panaversity book, and cites the chapter it came from at the foot of the page; the code is the book's, trimmed to what a basic agent needs. The only exception is the deployment target: the book deploys to a different cloud, so the Vercel steps on page 14 are taken from Vercel's official documentation and cite each page with its date. Two pages also carry an owner's attestation: what a test build made from this record showed, recorded as an attestation in the page's sources and marked as a test on fictional data, not client work. Nothing here is invented to fill a gap; where the book and this room differ, the difference is named on the page.

The SDK moves faster than any book. Every page that names a version or a default was checked against the installed SDK, openai-agents 0.22.0, on 2026-09-03 and again on 2026-09-09, and the build page carries the rule and the probe that re-checks it: install the current release, run the probe, and let the installed SDK and its live documentation win over any page here. The pages that pin versions carry a review date in the record; after it, the record stops serving them until they have been re-verified and re-stamped.

The words an agent is given are prompts. Its instructions, its constitution, its spec and every brief pasted to a coding agent are written under the AI prompting guide, which this record carries in full.

When the basic worker is not enough

The worker this room builds is a starting point. When it needs memory that survives a restart, a second agent, a file it must keep, or code it must run, you have reached the book's next chapters, and the pages here say which: give it a record for the memory and the tables, choose the shape for the second agent. If you would rather talk it through first, the 15-minute call on the audit page is the place to bring your step table and your deployment URL.

Begin with is this an agent problem?.

Footnotes

  1. Build AI Agents with the OpenAI Agents SDK: A 90-Minute Crash Course, course map and the concepts beyond the basic agent. The AI Agent Factory, Panaversity, 2026. ↩

  2. Deploy Your Agent Harness to the Cloud: A Crash Course, the stack primer's "What you don't need" note and Decision 1. The AI Agent Factory, Panaversity, 2026. ↩ ↩2

  3. From One-Off to Worker, "A running cost appears when you cross". The AI Agent Factory, Panaversity, 2026. ↩

  4. Is This an Agent Problem?, the reminder box and the note on where a mistake costs the most. The AI Agent Factory, Panaversity, 2026. ↩

On this page