Channel
Interviewed Person
Nico Albanese
You can now build type-safe AI applications using agents with the Vercel AI SDK. Nico Albanese from Vercel’s AI SDK team walks through practical patterns for turning AI agents into production-ready apps. Using a real example - automating social media threads from GitHub pull requests - he shows how to set up web apps with AI SDK UI components, create API routes, and build chat interfaces. Nico tackles a core challenge in AI development: keeping tool schemas in sync. The SDK solves this by making the agent the single source of truth for types. Nico also discusses streaming tool execution updates and preliminary results to improve the user experience. Nico Albanese works on the AI SDK at Vercel, focusing on developer experience and tools for TypeScript AI developers. The Vercel AI SDK is a free, open-source TypeScript toolkit for building AI-powered products. Created by the team behind Next.js, it offers unified APIs for multiple AI providers and framework-agnostic support (React, Next, Vue, Nuxt, Svelte). 🔗 CONNECT WITH NICO ALBANESE LinkedIn: https://www.linkedin.com/in/nicoalbanese Twitter/X: https://x.com/nicoalbanese10 GitHub: https://github.com/nicoalbanese Website: https://www.nicoalbanese.com Vercel AI SDK: https://sdk.vercel.ai 📚 MASTRA RESOURCES Mastra: https://mastra.ai Learn Mastra in the world's first MCP-Based Course: https://mastra.ai/course Principles of Building AI Agents (Book): https://mastra.ai/book Patterns for Building AI Agents (New Book): https://mastra.ai/blog/patterns-book https://docs.google.com/forms/d/e/1FAIpQLSduJjc515f6RZJqtkR2ByqJZrB0iP8B7SUKnjjZE9IajH_I8w/viewform The TypeScript AI conference is the first conference for TypeScript AI developers. The inaugural event took place on November 6, 2025, in San Francisco and online. MASTRA? Mastra is an open-source TypeScript framework designed for building and shipping AI-powered applications and agents with minimal friction. It supports the full lifecycle of agent development—from prototype to production. You can integrate it with frontend and backend stacks (e.g., React, Next.js, Node) or run agents as standalone services. If you’re a JavaScript or TypeScript developer looking to build an agentic or AI-powered product without starting from first principles, Mastra provides the scaffolding, tools, and integrations to accelerate that process. 00:00 Intro 00:54 Your Agent is Ready: Application Deployment 02:00 Demo: Social Launch Agent 02:58 AI SDK UI Components 03:35 Creating the API Route Handler 03:53 Building the Frontend with useChat Hook 05:40 Tool Calls and Customizing Tool Rendering 07:23 Tool Name Changes and Schema Maintenance 08:13 Type-Safe Tool Schemas 09:00 Creating Custom UI Message Types 10:32 Integrating Type-Safe Messages into the Frontend 11:21 Streaming Updates 12:20 Preliminary Tool Results 13:03 Real-Time Tool Status Streaming 14:03 Refactoring Tool UI into Maintainable Components 15:15 Further AI SDK Capabilities
So, I was trying to compete with Paul on the longest slide title, and I think I may have edged him out on that. But I'm really excited to be talking you to you today about how to build end-to-end type- safe applications on top of your agents. Um, I'm also very excited about this talk because this is something we haven't talked about a lot. We're usually focused on agent land. Um, so I'm hoping this is this is some new material for all of you guys. Um, so
before we start, can I get a show of hands for who's heard of the AI SDK? Yeah. Amazing. So, I guess I don't really have to give you guys the intro. Um, but I can say like the way that we call the AI SDK is a TypeScript toolkit for building AI agents and applications. And I'm really going to be focusing on the application side of things. So, back to the title of the talk. So, you've built an agent. Now what what happens once your agent is ready and it's behaving
exactly how you want it to? Let's say we've been iterating on this agent via simple TypeScript file um and we've probably run this command or some extension of it a million times but now it feels ready enough to share with others. But how do we package it up so other people can use it? Do we push the code to GitHub and just expect others to clone and run it? Probably not. I think the best way to share it is via the web and using the trusted chat interface we know and love
this application today three-phased approach and I forgot who said this but first we're going to make it work then we're going to make it right and then we're going to make it fast agent I would even if I may slightly alter these to be first we're going to make it work then we're going to make it maintainable and then we're going to make it delightful agent
demo because I've done those and I think everybody is really sick of the weather and travel agent uh demos. Uh so this is something that I've got running in production for me right now. Uh which helps solve a problem I have every day which is uh our team ships a lot and what good is a feature if nobody knows about it. So, uh, I need to have a way of or I spend a lot of time going from pull request to writing an X thread. Sounds kind of silly, but like it's important, I promise. Um, the agent will
take a pull request from GitHub and it will eventually spit out an X thread that follows our our brand voice and general format. I present to you social agent. Um, this is built with the new agent abstraction in AI SDK 6 and it's pretty simple. It basically just different human tools emphasis on working on top of it. As we're building this out for the web, I'm
using a framework that I know really well. But I do want to call out that AI SDK UI package has been designed to be extensible by default. So we ship first party support for React, Vue, Spelt, and Angular. And the community's even already built a solid JS package as well if that's your thing. But anyway, back to our application. We've got a standard next app here, and I've pulled in my social agent into an agent directory. I've also separated all of my tools into their own files in a tool directory. So,
our application, how do we call it? To do that, we're going to set up a route handler. This file will create a post request at API/Chat. We'll pull off the messages from the request body, call our agent, and then return a streaming response. Now, we need to actually build out our front end so we can actually send messages and receive responses from our use chat hook from the AI SDK. I think a