# The Demo I Wish I'd Had: OpenAI's Agents SDK... serverless!

Brook Riggio, thrive.com | AI Engineer World's Fair 2025 | 17:51

Source: https://www.youtube.com/watch?v=UcW_s4BmuD0
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/the-demo-i-wish-id-had-openais-agents-sdk-serverless
Published: 2025-06-03
Tags: agents, deployment, observability, workflows

## TL;DR
- Brook Riggio combines Next.js, OpenAI's Agents SDK, Inngest, and Vercel to run long AI workflows on serverless infrastructure.
- Inngest breaks the newsletter workflow into retryable steps, so each agent task can fit within a serverless function's time limit while preserving state between steps.
- The demo shows a practical project structure, local development setup, deployment process, and observability path for a production AI app on Vercel.

## Summary
Brook Riggio presents a serverless architecture for applications that use OpenAI's Agents SDK. His preferred stack uses Next.js for the client, Python functions for the Agents SDK, Inngest for event-driven orchestration, and Vercel for hosting. The central problem is that sizeable agent jobs do not fit cleanly into one serverless request. Inngest breaks the work into steps, retries failed steps, and records progress so the frontend can read completed results from storage. Riggio demonstrates the approach with a newsletter generator that researches topics, formats the result, and saves it to Vercel Blob. He also walks through the repository structure, three-terminal local setup, automatic Python function deployment, environment variables, and build logs. The talk is especially useful because it covers a subtle execution issue: code outside an Inngest step may run again when the workflow resumes, while code inside step.run is sequenced and tracked.

## Key ideas
### A useful serverless AI stack needs separate client, agent, orchestration, and hosting layers
[00:17](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=17s)
Riggio frames the deployment problem as combining a client application, an agent framework, an orchestration layer, and a serverless cloud environment. He lists many choices across each layer, including Next.js, OpenAI's Agents SDK, Temporal, AWS Step Functions, Inngest, Lambda, Vertex, and Vercel. His concern is that there is little reference code showing how a particular combination works in production. After trying several combinations, he chooses Next.js with Vercel hosting, OpenAI's Agents SDK for agents, Inngest for orchestration, and Vercel for serverless deployment.

### OpenAI's Agents SDK provides the agent features Riggio wants while allowing model changes
[03:04](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=184s)
Riggio says he adopted OpenAI's Agents SDK when it was announced. He points to native tool calling, one-shot and multi-agent calls, built-in tracing, and evaluation hooks. Those features give the application visibility into agent behavior. He also values OpenAI's support for the SDK and the ability to interchange models, so using the framework does not force the entire application into one model ecosystem.

### Inngest turns a long agent job into observable, event-triggered steps
[03:50](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=230s)
Inngest is Riggio's orchestration choice because workflows start from events rather than manually managed state-machine documents. It runs work on demand, includes automatic retries, and exposes step-level observability. In the demo, the frontend triggers an event, Inngest coordinates Python functions that run the agents, and the completed result is written to storage. The frontend can then check the database or cache and display the result after the workflow finishes.

### The demo uses Python functions for agents and Next.js for the surrounding application
[05:58](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=358s)
The OpenAI Agents SDK is Python-only in the setup Riggio presents. Vercel detects Python functions and hosts them automatically. The Next.js app handles the user interface and checks whether work is already complete. The Python functions perform inference through OpenAI and return results to Inngest. In the newsletter example, one agent researches the requested topics and another formats the newsletter before the final content is saved for the frontend.

### Breaking the newsletter workflow into steps keeps individual tasks inside serverless limits
[09:27](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=567s)
Riggio demonstrates a newsletter generator that accepts a comma-separated list of topics. The example asks about AI engineering in Seattle, then starts a workflow that checks storage while the agent calls run. Inngest breaks the job into individual steps, allowing each step to use the available cloud-function runtime rather than forcing the whole job into one request. The result is saved to Vercel Blob and appears in the Next.js page as a formatted newsletter.

### The repository structure makes the orchestration and deployment boundaries visible
[11:14](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=674s)
The project places the Inngest endpoint and workflow definitions inside the Next.js repository. Newsletter API endpoints connect Inngest to the Python agents, which live in a top-level API directory. Vercel treats each file in that directory as an independent function. The agents use FastAPI, and a single line at the bottom of the app is enough for Vercel to start the function. Riggio notes that the repository does not need a vercel.json file for this arrangement.

### Step boundaries matter because workflow code outside a step can run more than once
[14:11](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=851s)
Riggio structures the workflow with each step declared clearly at the top and each step calling a function defined below. The example has three steps: call the research agent, format the newsletter with another agent, and save the output to Blob storage. He warns that code outside step.run can execute multiple times when Inngest returns to the workflow to determine which step should run. Code inside the steps runs in order and passes results to the next step.

### Deployment needs only the project environment, an OpenAI key, and Vercel Blob storage credentials
[15:30](https://www.youtube.com/watch?v=UcW_s4BmuD0&t=930s)
Vercel displays the Python agent as a Python 3.12 function and provides build logs for troubleshooting. Riggio deploys from the terminal with the Vercel CLI, which can sign in, connect the project, and pull production environment variables for local use. For this example, the required secrets are an OpenAI API key and a Vercel Blob storage token. The repository is open source and intended to be adapted with other agent workflows.

## Notable quotes
- "The question of 2025 is how do we deploy zero ops resilient agent-powered user ready apps today?" (00:17)
- "The LLMs still don't know how to piece this all together, but that's what I'm here to tell you." (05:38)
- "One thing to remember is that every step.run will be invoked in order, but code that's outside of step.run may well be executed multiple times." (14:11)
- "For this project, you need an OpenAI API key. Of course, you need a Vercel Blob storage token to use for storing your data." (16:16)

## Tools & references mentioned
- OpenAI Agents SDK
- Next.js
- Vercel
- Inngest
- FastAPI
- Vercel Blob
- LangChain
- Vercel AI SDK
- Flowise Agents
- Temporal
- AWS Step Functions
- LangSmith
- AWS Lambda
- Amazon API Gateway
- Amazon Bedrock
- Google Vertex AI
- Azure AI Studio
- Next Forge
- Pydantic

## Who should watch
- You are building an agent workflow on Vercel and need a way to handle jobs that exceed a single serverless request.
- Your application needs retries, step-by-step visibility, and persistent results without running a dedicated always-on server.
- You want a concrete repository structure for connecting a Next.js frontend, Python-based OpenAI agents, Inngest workflows, and Vercel deployment.

## Related talks

- [Conquering Agent Chaos](https://aietalks.com/talks/conquering-agent-chaos) (Rick Blalock, Agentuity, 14:40)
- [Vercel AI SDK Masterclass: From Fundamentals to Deep Research](https://aietalks.com/talks/vercel-ai-sdk-masterclass-from-fundamentals-to-deep-research) (Nico Albanese, Vercel, 59:52)
- [Everything Is a Rollout](https://aietalks.com/talks/everything-is-a-rollout) (Alex Shaw & Ryan Marten, Laude Institute, 21:11)
- [Your Coding Agent Just Got Cloned And Your Brain Isn't Ready](https://aietalks.com/talks/your-coding-agent-just-got-cloned-and-your-brain-isnt-ready) (Rustin Banks, Google Labs, 13:40)
- [Fighting AI with AI](https://aietalks.com/talks/fighting-ai-with-ai) (Lawrence Jones, Incident.io, 17:29)
