Nico Albanese · 27:38 "Building an agent in 2026 is a composition of three building blocks — agent runtime, tools, and a computer or sandbox. The moment we handed D0 a file system, it became a different thing."
Nico Albanese is an engineer on the Vercel AI SDK An SDK developed by Vercel for building AI applications in JavaScript / TypeScript. v6 introduces an object-oriented agent abstraction (the tool loop agent), end-to-end type safety, and default AI gateway integration. Official site: ai-sdk.dev team, based in London. As a personal project, he created Kirimase A personal project by Nico Albanese — a CLI for the fastest scaffolding of Next.js applications. Later served as his career entry point into Vercel. (the fastest scaffolder CLI for Next.js apps). The session runs over an hour, but the core is a structural argument: "Building an agent in 2026 is a composition of three building blocks."
The three building blocks:
- Agent Runtime (harness) — loop management, between-step context management, hooks like prepare-step. AI SDK v6 provides this as the `ToolLoopAgent` class.
- Tools — three kinds: custom (built by you), provider-defined (Anthropic bash, computer use, etc. — post-trained by the model provider for use), provider-executed (OpenAI web search, etc. — executed on the provider's infrastructure).
- Computer / Sandbox — the environment where the agent persists state and executes code. The demo's centerpiece is Vercel Sandbox's persistent named sessions (beta).
1. Agents as the three building blocks — once you grasp this frame, which SDK or provider to use becomes a choice. AI SDK v6 is designed to provide the three pieces in type-safe JavaScript.
2. The file system = memory hypothesis. Vercel's internal agent "D0" leveled up the moment a file system was added. Just memories.md / plan.md as simple text files plus a bash tool turns the agent into a self-extending agent that lays out plans, checks progress, and writes its own scripts to reuse.
3. Compaction is not mandatory — sub-agent decomposition is the main thread. In the million-token-context era, Albanese's own coding agent completed a 104-minute continuous run with 316 tool calls and 29 file changes using only 32% of the GPT-5.4 context. Lossy auto-compaction generates accidents like the Meta AI exec's inbox-wipe; cleanly distributing with sub-agent + handoff tool is safer.
Key observations
"Three categories of tools — custom / provider-defined / provider-executed" (19:50 – 22:00)
The tool taxonomy Albanese organizes in AI SDK v6. What had been loosely called "tool calling" is split into three layers:
- Custom tool: you write the description, input schema, and execute function yourself. Lets you hand any arbitrary function to the agent. The most flexible.
- Provider-defined tool: the model provider has post-trained use of it (Anthropic's bash tool, computer use, etc.). You write the execute function, but the description and input schema come from the provider, and the model is tuned to call it well.
- Provider-executed tool: runs on the model provider's infrastructure (OpenAI web search, etc.). You don't write any code — just an opt-in flag. The tool result lands in the message state automatically. The downside is lock-in to a specific provider.
The taxonomy matters — once you recognize that "tools are not all the same concept; there are three kinds," you can design the agent's reasoning path, cost, and portability trade-offs precisely.
"The moment we handed D0 a file system, it became a different thing" (28:25 – 29:58)
The evolution episode of Vercel's internal agent D0 Vercel's internal Slack-bot-style agent. A chat-with-data feature with cross-cutting access to Vercel's backend, admin panel, Salesforce, and more. Created to solve a situation where the Head of Data was being tagged constantly. An example whose performance changed dramatically before and after adding a file system, placed at the heart of Nico Albanese's workshop. .
Before: "An agent with all the tools, using 5–10 tools in one shot and returning somewhat hallucinated answers."
After (file system + instructions added): "Each session has a scratch pad on the file system. It writes an initial plan there, follows the plan, and checks items off as it goes. As a result, the agent now follows the entire task through — as emergent behavior" (29:10).
The important insight: "Piling everything into the context window pushes the initial instructions out; writing them to a file and having the agent refer to them creates a structure where the agent reminds itself again and again." The result: a 90% reduction in customer support tickets (95% get a "thank you"), the internal GTM agent, D0 — all the same pattern.
"Bash is all you need" — radical simplification (51:30 – 53:30)
Albanese's claim in the session's second half: "These agents are really good at writing bash commands, so one bash tool handles a lot" (51:30).
In the workshop, with only a single bash tool:
- Use ls / find / grep / glob to explore files inside the sandbox
- Read and write memories.md / plan.md
- Have the agent write and run its own Python scripts (weather.py, etc.)
- Append the generated script to memories, then re-invoke it later
This is an extension of Karpathy's vibe-to-agentic argument — concretizing, at the production design level, the premise that "the agent is most adapted to the loop of generating, running, evaluating, and iterating on code."
"Compaction is not mandatory; sub-agent + handoff tool is the main thread" (40:40 – 43:50)
Albanese's hot take on context engineering. "In the million-token-context era, compaction isn't as necessary as people think. My own coding agent — 14 hours a day for 4 months, a 104-minute continuous run, 316 tool calls, 29 file changes, using only 32% of GPT-5.4's context" (39:55).
The danger of compaction: "The Meta AI exec asked OpenClaw to 'archive yesterday's emails' and it wiped the entire inbox. A lot of email got ingested → auto-compaction triggered → the initial instructions ('don't do this') dropped out of context → it deleted them" (42:40). The core of the accident: "loss of initial instructions" via lossy summarization.
Albanese's alternative approach:
- Sub-agent: pull a dedicated independent piece off the main thread; return only a 1,000-token summary
- Handoff tool (AMP's implementation): the agent generates "the context to pass to the next thread" at a point of its choosing, then starts a new main thread from there
A design choice: "don't compact, switch threads." A cache token read rate of 95% is achieved at the same time.
"Object-oriented agent + end-to-end type safety" — AI SDK v6's design principles
The old (v4) was function-centric, with `streamText` / `generateText` — the pattern where a single API route file balloons to 2,000 lines. v6 is object-oriented: define an agent once and call it from anywhere.
Type safety: "The agent definition is the source of truth — message UI part types, tool input/output types, everything is derived from the agent. In page.tsx, useChat<MyAgent>() types it all the way down to the client." This is the same philosophy as React components, ported into the agent runtime.
AI Gateway global provider: "Specify `gpt-5.4-mini` as a string to switch models — one env variable for auth." Minimizing the friction of model switching, so you can focus on architecture rather than prompt engineering.
Video outline (main sections)
- (00:00) Setup — clone the repo, Vercel CLI, retrieve env variables (OIDC token)
- (09:00) Basic Tool Loop Agent definition, running on GPT-5.4-mini
- (13:00) AI Gateway global provider; model switching with one env variable
- (17:00) Route handler, createAgentUIStreamResponse
- (19:50) The three categories of tools (custom / provider-defined / provider-executed)
- (22:00) Web search tool implementation; user location option
- (25:00) End-to-end type safety, inferAgentUIMessage,
useChat<MyAgent> - (27:38) "Next step = computer or sandbox"
- (28:25) D0 evolution episode — a different thing the moment a file system was added
- (30:45) Vercel Sandbox persistent named sessions (beta) introduction
- (33:00) AI SDK useChat, message state, send-message pattern
- (34:46) The role of prepareStep — parameters mutable per step
- (36:00) Context management decisions (mapping / slicing / sub-agent)
- (39:00) Albanese's coding agent — 104 minutes continuous, 316 tool calls, 32% context
- (40:40) The danger of compaction; the Meta AI inbox incident
- (41:30) Sub-agent / handoff tool pattern
- (45:18) pnpm add @vercel/sandbox@beta; sandbox.ts
- (46:00) Call options schema; injecting runtime context via prepare-call
- (51:30) Bash tool implementation; "bash is all you need"
- (55:00) Rendering tool execution in the UI
- (56:24) Behavior control via instructions
- (57:10) Memory pattern: memories.md to a file; system prompt injection via prepare-call
- (1:02:00) The agent writes its own scripts and appends to memories — self-extending
- (1:04:30) Weather script demo — "Get weather" auto-generates Python, then re-invokes
Sources
From the AI Engineer Europe 2026 official YouTube playlist. The video ID can be confirmed on the AI Engineer official channel.
- AI Engineer Europe 2026 official schedule
- AI SDK official documentation
- Workshop demo repository
- Workshop instructions site
Glossary
- Tool Loop Agent (AI SDK v6)
- The object-oriented agent abstraction introduced in AI SDK v6. Define model / instructions / tools / call options once, and call from anywhere. Designed to complement v4's function-centric APIs (streamText, etc.), keeping large applications maintainable.
- Three Tool Categories (Custom / Provider-defined / Provider-executed)
- The tool taxonomy Albanese organized. Custom = built by you (any function passed to the agent), Provider-defined = post-trained by the model provider (Anthropic bash, etc. — you write the execute), Provider-executed = run on the provider's infrastructure (OpenAI web search, etc. — opt-in flag only, results land in message state automatically).
- D0
- Vercel's internal Slack-bot-style agent. A chat-with-data feature with cross-cutting access to Vercel's backend, admin panel, Salesforce, and more. Created to solve a situation where the Head of Data was being tagged constantly. An example whose performance changed dramatically before and after adding a file system, placed at the heart of Nico Albanese's workshop.
- memories.md pattern
- Albanese's memory design proposal. Accumulate important facts into a single .md file on the file system, and inject them into the system prompt via the prepare-call hook. Structured layering — corememories.md (injected every turn) and conversations.jsonl (for search), etc. — is also possible. The hot take: "memory isn't a vector DB; it's a file."
- Handoff tool (AMP's implementation)
- A tool that lets the agent generate "the context to pass to the next thread" at a chosen moment, then start a new main thread from there. Recommended by Albanese as an alternative to compaction. Originally implemented by AMP (Sourcegraph's coding agent).
- Vercel Sandbox (named / persistent)
- A beta feature of Vercel's code execution sandbox. You name a sandbox; each time the session is called, it automatically restores a file system snapshot. A mechanism that solves "ephemeral sandboxes' state-persistence problem." Used as the core "agent computer" in Albanese's workshop.
- AI Gateway global provider
- A feature introduced in AI SDK v6. With one env variable (the AI gateway token), models can be specified as strings (e.g., `gpt-5.4-mini`). Intended to minimize the friction of model switching, so you can focus on architecture rather than prompt engineering.