Nico Albanese, a developer advocate at Vercel, leads a hands-on workshop at AI Engineer Europe 2026 demonstrating how to build a persistent, self-improving AI agent using Vercel's AI SDK v6 and named sandbox infrastructure. The workshop builds incrementally from a basic chat interface to a full agent with a dedicated computer, file-based memory, and the ability to generate and store reusable Python scripts.
The session begins with project setup using the Vercel CLI, OIDC-based authentication via AI Gateway, and a fresh Next.js application. Albanese walks through installing the AI SDK v6 alongside @ai-sdk/react and Zod, then introduces AI SDK v6's new object-oriented `ToolLoopAgent` API — a departure from the flat `generateText`/`streamText` paradigm of SDK v4. The agent definition in `agent.ts` becomes a single reusable object that encapsulates model selection (GPT-4o-mini by default, via the AI Gateway global provider), system instructions, and tools. The route handler in `app/api/chat/route.ts` uses `createAgentUIStreamResponse`, abstracting streaming concerns away from agent logic.
Albanese introduces three tool categories in AI SDK v6: custom tools (developer-defined with description, Zod schema, and execute function), provider-defined tools (where providers like Anthropic supply optimized descriptions, e.g., the bash tool or computer use), and provider-executed tools (server-side execution, e.g., OpenAI web search). He demonstrates the provider-executed web search tool from `@ai-sdk/openai`, showing how passing a `userLocation` object like `{ type: 'approximate', city: 'London' }` improves geographically relevant results with zero additional code.
A significant portion addresses end-to-end type safety: using `inferAgentUIMessage` to derive a typed message type from the agent definition, then passing it as a generic to `useChat` in the React client. This yields fully typed tool call inputs and outputs in the UI rendering switch/case, enabling proper component rendering for web search and bash tool states.
The workshop's centrepiece is Vercel's new persistent named sandboxes, currently in beta. Unlike ephemeral sandboxes (which expire after hours or days), named sandboxes persist state via filesystem snapshots: when a sandbox is idle, Vercel snapshots the filesystem and spins it down; on the next request, it restores from that snapshot, making it feel like a continuously running machine. Albanese contrasts this with his prior approach of manually tarring the entire filesystem after each request and storing in blob storage. The agent receives a `bash` tool that runs commands inside the sandbox, injected via AI SDK's runtime context system — analogous to React Context — rather than passing the sandbox instance directly to each tool.
Albanese introduces `callOptionSchema` (a Zod schema defining per-call structured inputs) and `prepareCall` (a one-time setup function that runs before each agent invocation to inject the sandbox into runtime context). This pattern supports multi-tenant use cases, e.g., routing different Vercel plan tiers to different models.
For memory, Albanese implements a `memories.md` file in the sandbox. `prepareCall` reads this file and injects its contents into the system prompt before each run. The agent is instructed to write important user facts — but not trivial interactions like greetings — to `memories.md` using the bash tool. Live demos show the memory persisting across sessions after a page refresh.
The final evolution is self-improvement: the agent is instructed to generate reusable Python scripts for repeatable tasks and record their descriptions in `memories.md`. A live demo shows the agent fetching London weather, writing a Python script to do so, and then reusing that script when asked for San Francisco weather in a subsequent message, all within a single assistant turn using only the bash tool.
Albanese closes by previewing a production-grade multi-agent coding system he built on these exact patterns, used by 23 engineers at Vercel. It has processed 3.8 billion tokens, maintains a 90–91% cache token read ratio, uses durable Vercel Workflows so each LLM step is retriable on failure, and has contributed to approximately 350 pull requests. One agent ran for 104 minutes, made 316 tool calls, changed 29 files, and used only 32% of GPT-4's million-token context window — without any compaction.
I now have my live deployment here and I can continue to dashboard and I've got my project. One out of five things for the production checklist. Is that all? Were you able to get that? Cool. So we're going to jump over to the repository on GitHub that clicking that big repo button. And then I'm going I'm going to quit out of Slack and all these things and I'm going to jump into a terminal. Head over to directory that I'm happy with. And I'm happy to pop this in and I'm going to get clone that oo...
Mario Zechner, creator of the LibGDX game framework, delivers a provocative three-act talk about building a minimal codi...