WhoBuilt

Vercel AI SDK Masterclass: From Fundamentals to Deep Research

Apr 20, 2025· 1 h 0 min· 40K views·Watch on YouTube

Speaker

Nico, who works on the AI SDK at Vercel, explains how to build agents and a deep research workflow in a session for AI Engineer; he also identifies himself as Niko Albanese near the end and thanks Svix for the session.

Generate text across model providers

Nico introduces the AI SDK’s text generation functions and shows how to switch providers by changing the model configuration. He compares GPT-4o mini, which cannot answer a current-events question without web access, with Perplexity Sonar Pro and Gemini search grounding, which return answers with sources.

Build multi-step agents with tools

Nico explains how tools give a model named actions, descriptions, parameters, and JavaScript execute functions. With `maxSteps`, the model can use tool results in later steps: his example fetches weather for San Francisco and New York in parallel, adds the temperatures, then explains the result.

Return structured outputs

Nico shows how Zod schemas and `generateObject` produce typed data, such as a numeric sum or an array of ten AI agent definitions. He uses `.describe()` to guide the definitions toward jargon, demonstrating how schema descriptions can shape generated values.

Design a recursive research workflow

Nico builds a Node.js deep research clone around a prompt about becoming a Division I shot put athlete. It generates search queries, searches with Exa, evaluates source relevance, extracts learnings and follow-up questions, and recursively researches them with depth and breadth limits while tracking accumulated results.

Synthesize and write the report

The workflow passes its collected research to o3-mini to generate a report, then writes the result as a Markdown file. Nico adds a system prompt with formatting and research analyst guidance; the demo produces a report after about a minute and uses 218 lines of code.

Takeaways

  • Use the AI SDK’s provider interface to compare models while keeping the surrounding application code consistent.
  • Give tools clear descriptions and typed parameters, and use a step limit to control model-led tool loops.
  • Validate generated data with schemas, and use field descriptions to guide the content of structured outputs.
  • Keep research state across recursive passes, cap depth and breadth, and filter duplicate sources to manage cost and context.
  • Give report models explicit structure and formatting instructions instead of leaving those choices implicit.

Mentioned in this talk

Search inside this talk

What was claimed 6

Related talks