AI SDK v6 ワークショップ — 2026 年のエージェント構築 3 ブロック (Nico Albanese / Vercel)

AI Engineer Europe 2026 (London) ワークショップ / 2026/05/12

Nico Albanese · 27:38 「2026 年のエージェント構築は 3 つの building block の組み合わせ — agent runtime、 tools、 そして computer or sandbox。 ファイルシステムを agent に渡した瞬間、 D0 は別物になった」

AI Engineer Europe 2026 (Queen Elizabeth II Centre、 London、 2026/04/08 - 10 開催、 2026/05/12 公開) Day 1 ワークショップトラック、 Wordsworth room、 4/8 9:00 - 10:20 (収録分は約 1 時間 9 分)。 ニコ・アルバネーゼ (Nico Albanese、 Vercel AI SDK チーム) によるハンズオンセッション。 デモリポジトリ: nicoalbanese/aie-london-demo

Nico Albanese は Vercel AI SDK Vercel が開発する JavaScript / TypeScript で AI アプリケーションを構築するための SDK。 v6 で object-oriented な agent abstraction (tool loop agent) と end-to-end の型安全性、 AI gateway デフォルト統合を導入。 公式: ai-sdk.dev チームのエンジニア、 ロンドン拠点。 個人プロジェクトとして Kirimase Nico Albanese 個人プロジェクト、 Next.js アプリケーションの最速スキャフォルダ CLI。 後に Vercel 入社の経歴的入口にもなった (Next.js アプリの最速スキャフォルダ CLI) を創造。 本セッションは 1 時間以上の長尺ワークショップだが、 核心は 「2026 年のエージェント構築 = 3 つの building block の組み合わせ」 という構造論。

3 つの building block:

  1. Agent Runtime (harness) — ループ管理、 ステップ間 context 管理、 prepare-step などの hook。 AI SDK v6 では `ToolLoopAgent` クラスで提供。
  2. Tools — custom (自作)、 provider-defined (Anthropic bash、 computer use 等、 モデル提供者が post-train で最適化済)、 provider-executed (OpenAI web search 等、 モデル提供者のインフラで実行) の 3 種。
  3. Computer / Sandbox — agent が state を永続させ、 コードを実行する環境。 Vercel Sandbox の persistent named sessions (beta) が demo の中心。

1、 3 building blocks としてのエージェント — このフレームを掴めば、 どの SDK / プロバイダを使うかは選択肢。 AI SDK v6 はこの 3 つを type-safe な JavaScript で提供する設計

2、 ファイルシステム = メモリ仮説 — Vercel 社内 agent 「D0」 が大化けしたのは file system を加えた瞬間。 memories.md / plan.md という単純なテキストファイル + bash tool だけで、 agent が plan を立て、 進捗を check し、 自分用スクリプトを作って再利用する self-extending agent になる

3、 Compaction は必須ではない、 sub-agent 化が本筋 — 100 万トークン文脈時代、 Albanese の自作 coding agent は 104 分連続実行 / 316 tool call / 29 ファイル変更を GPT-5.4 文脈 32% のみで完遂。 lossy な auto-compaction は Meta AI 幹部の受信箱全消事件のような事故を生む、 sub-agent + handoff tool でクリーンに分散する方が安全

着眼点

「Tool の 3 分類 — custom / provider-defined / provider-executed」 (19:50 - 22:00)

Albanese が AI SDK v6 で整理した tool taxonomy。 これまで漠然と 「tool calling」 と呼ばれていたものを 3 層に分ける:

  • Custom tool: description + input schema + execute 関数を自分で書く。 任意の任意関数を agent に渡せる。 最も自由度が高い。
  • Provider-defined tool: モデル提供者が post-train で使い方を最適化済 (Anthropic の bash tool、 computer use 等)。 execute 関数は自分で書くが、 description / input schema は提供者由来で、 モデルが上手く呼び出すよう調整されている。
  • Provider-executed tool: モデル提供者のインフラで実行される (OpenAI web search 等)。 自分でコードを書かない、 「opt-in flag」 のみ。 tool result が message state に勝手に乗ってくる。 デメリットは特定プロバイダに lock される。

この taxonomy は重要 — 「tool は同じ概念ではない、 3 種類ある」 という認識を持つと、 agent の reasoning 経路 / コスト / 移植性のトレードオフを正確に設計できる。

「ファイルシステムを D0 に渡した瞬間、 別物になった」 (28:25 - 29:58)

Vercel 社内 agent D0 Vercel 社内の Slack bot 形式 agent。 chat with data の機能で、 Vercel backend + admin panel + Salesforce 等への横断アクセス権を持つ。 Head of Data がタグされまくっていた状況を解決するために生まれた。 ファイルシステムを加える前後で性能が劇的に変わった事例として、 Nico Albanese のワークショップで核心エピソードに位置付けられる の進化エピソード。

Before: 「全 tool を持った agent が、 5 - 10 個の tool を 1 回で使って somewhat 幻覚的な回答を返す」。

After (ファイルシステム + 指示を追加): 「各 session で scratch pad を file system に持つ、 そこに初期 plan を書く、 plan に従って check off しながら進める。 結果、 agent は task 全体を follow through するようになった、 emergent behavior として」 (29:10)。

重要な洞察: 「context window に全部積み上げると初期指示が押し流される、 ファイルに書いて参照させると agent が自分自身に何度も思い出させる構造 ができる」。 結果、 customer support ticket を 90% 削減 (95% で 「ありがとう」 と言われる)、 内部 GTM agent、 D0 — 全部この pattern。

「Bash is all you need」 — シンプル化の徹底 (51:30 - 53:30)

Albanese のセッション後半の主張。 「これらの agent は bash command を書くのが本当に上手い、 だから bash tool ひとつで多くのことが済む」 (51:30)。

ワークショップでは bash tool 1 個だけで:

  • ls / find / grep / glob で sandbox 内のファイル探索
  • memories.md / plan.md を読み書き
  • Python script を agent が自分で書いて実行 (weather.py 等)
  • 生成したスクリプトを memories に追記、 再呼び出し

これは Karpathy の vibe-to-agentic 議論の延長線上 — 「agent は code を生成・実行・評価・iterate する loop に最も適応した」 という前提を、 production 設計レベルで具体化している。

「Compaction は必須じゃない、 sub-agent + handoff tool が本筋」 (40:40 - 43:50)

Albanese の context engineering についての hot take。 「100 万トークン文脈時代に、 compaction は思ったほど必要じゃない。 自分の coding agent は 1 日 14 時間 4 ヶ月使用、 104 分連続実行 / 316 tool call / 29 ファイル変更 / GPT-5.4 文脈 32% のみ使用」 (39:55)。

compaction の危険性: 「Meta AI の幹部が OpenClaw に 『昨日のメールをアーカイブして』 と頼んだら受信箱を全消した事件。 メールを大量に取り込んだ → auto-compaction が triggered → 初期指示 (『これはしない』) が context から消えた → 削除実行」 (42:40)。 lossy な要約による 「初期指示の消失」 が事故の core。

Albanese の代替アプローチ:

  • Sub-agent: 独立した dedicated piece を main thread から外す、 1000 token の要約だけ戻す
  • Handoff tool (AMP の実装): agent が任意のタイミングで「次の thread に渡したい context」 を生成、 そこから新 main thread を開始

「compaction はやらない、 thread を切り替える」 という設計判断。 cache token read 率 95% も同時に達成。

「Object-oriented agent + end-to-end type safety」 — AI SDK v6 の設計原則

旧 (v4) は `streamText` / `generateText` などの関数中心、 1 つの API route ファイルに 2000 行のコードが膨らむパターン。 v6 は agent を 1 度定義 → どこからでも呼ぶ object-oriented 設計。

型安全性: 「agent 定義が source of truth、 message UI part の型、 tool input / output の型、 すべて agent から derive される。 page.tsx の useChat<MyAgent>() で client 側まで全部型付き」。 これは React の component と同じ哲学を agent runtime に持ち込んだもの。

AI Gateway global provider: 「`gpt-5.4-mini` を文字列で指定するだけでモデル切替可、 認証は env 変数 1 個」。 model switching の摩擦を最小化、 prompt エンジニアリングではなく architecture に集中できる構造。

動画の構成 (主要セクション)

  • (00:00) セットアップ — repo clone、 Vercel CLI、 env 変数取得 (OIDC token)
  • (09:00) Tool Loop Agent の基本定義、 GPT-5.4-mini で動作
  • (13:00) AI Gateway global provider、 環境変数 1 個でモデル切替
  • (17:00) Route handler、 createAgentUIStreamResponse
  • (19:50) Tool の 3 分類 (custom / provider-defined / provider-executed)
  • (22:00) Web search tool 実装、 user location オプション
  • (25:00) End-to-end type safety、 inferAgentUIMessage、 useChat<MyAgent>
  • (27:38) 「次のステップ = computer or sandbox」
  • (28:25) D0 進化エピソード、 ファイルシステムを加えた瞬間に別物に
  • (30:45) Vercel Sandbox の persistent named sessions (beta) 紹介
  • (33:00) AI SDK の use chat、 message state、 send message pattern
  • (34:46) prepareStep の役割、 step ごとに parameters 改変可能
  • (36:00) Context management の判断 (mapping / slicing / sub-agent)
  • (39:00) Albanese の coding agent、 104 分連続 / 316 tool call / 32% context
  • (40:40) compaction の危険性、 Meta AI 受信箱事件
  • (41:30) sub-agent / handoff tool パターン
  • (45:18) PMPM add @vercel/sandbox@beta、 sandbox.ts
  • (46:00) Call options schema、 prepare call で runtime context 注入
  • (51:30) Bash tool 実装、 「bash is all you need」
  • (55:00) UI で tool 実行を描画
  • (56:24) Instructions による behavior 制御
  • (57:10) Memory pattern: memories.md をファイルに、 prepare-call で system prompt 注入
  • (1:02:00) Agent が自分用 script を作って memories に追加、 self-extending
  • (1:04:30) Weather script の demo、 「Get weather」 で Python 自動生成 → 再呼び出し

出典

AI Engineer Europe 2026 公式 YouTube プレイリストより。 動画 ID は AI Engineer 公式チャネルで確認可能。

用語集

Tool Loop Agent (AI SDK v6)
AI SDK v6 で導入された object-oriented agent abstraction。 model / instructions / tools / call options を 1 度定義すれば、 どこからでも呼べる。 旧 v4 の関数中心 API (streamText 等) を補完する形で、 大規模アプリケーションでも見通しが効く設計。
Tool 3 分類 (Custom / Provider-defined / Provider-executed)
Albanese が整理した tool taxonomy。 Custom = 自作 (任意関数を agent に渡す)、 Provider-defined = モデル提供者が post-train で最適化 (Anthropic bash 等、 execute は自分で書く)、 Provider-executed = モデル提供者インフラで実行 (OpenAI web search 等、 opt-in flag のみ、 結果が勝手に message state に乗る)。
D0
Vercel 社内の Slack bot 形式 agent。 chat with data の機能で、 Vercel backend + admin panel + Salesforce 等への横断アクセス権を持つ。 Head of Data がタグされまくっていた状況を解決するために生まれた。 ファイルシステムを加える前後で性能が劇的に変わった事例として、 Nico Albanese のワークショップで核心エピソードに位置付けられる。
memories.md パターン
Albanese 提唱の memory 設計。 ファイルシステム上の .md ファイル 1 個に重要事実を蓄積、 prepare-call hook で system prompt に injection する。 corememories.md (毎ターン injection) と conversations.jsonl (検索用) 等、 structured な階層化も可。 「memory はベクトル DB ではなく、 ファイル」 という hot take。
Handoff tool (AMP の実装)
agent が任意のタイミングで 「次の thread に渡したい context」 を生成して、 そこから新 main thread を開始する tool。 compaction の代替として Albanese が推奨。 AMP (= Sourcegraph の coding agent) が初期実装。
Vercel Sandbox (named / persistent)
Vercel が提供する code execution sandbox の beta 機能。 sandbox に名前を付け、 session を呼び出すたびに自動でファイルシステム snapshot を復元する。 「ephemeral sandbox の状態保存問題」 を解決する仕組み。 Albanese のワークショップではこれが agent computer の中核として使われる。
AI Gateway global provider
AI SDK v6 で導入された機能。 環境変数 1 個 (AI gateway token) で、 model 指定を文字列 `gpt-5.4-mini` 等で書ける。 model switching の摩擦を最小化、 prompt engineering ではなく architecture に集中できる構造を意図。