ai-sdk

Explain AI SDK functions, agents, chatbots, and Vercel AI Gateway integration.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/matiacone/dotfiles --skill ai-sdk-matiacone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/matiacone/dotfiles/tree/main/agents/.agents/skills/ai-sdk
Command: npx skills add https://github.com/matiacone/dotfiles --skill ai-sdk-matiacone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The AI SDK guide helps developers understand, use, and implement the AI SDK to build AI-powered features, answer questions, and plan integrations.

Core Features & Use Cases

  • Guided learning: Clarifies AI SDK functions like generateText, streamText, ToolLoopAgent, embed, and tools; answers provider questions (OpenAI, Anthropic, Google) and covers streaming, tool calling, and embeddings.
  • Agent and UI patterns: Helps design ToolLoopAgent-based agents, chatbots, RAG systems, and React hook integrations (useChat, useCompletion).
  • Practical applications: Supports building AI-powered features in apps and APIs, ensures up-to-date guidance via the AI Gateway and avoids outdated patterns.

Quick Start

Explain how to use the AI SDK to build an agent or integrate tools in your app.

Frequently Asked Questions about ai-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an AI agent with tool calling using the AI SDK?

Build AI agents with the AI SDK by implementing the ToolLoopAgent function to manage tool calling loops. This pattern handles multi-step reasoning and automated tool execution for conversational interfaces.

What is the best way to integrate useChat for streaming chatbot responses?

Integrate useChat by connecting React hooks to streamText outputs for real-time chatbot responses. This pattern ensures safe, correct coding practices for streaming text directly to your UI components.

Can I use the AI Gateway for model selection across different providers?

Use the Vercel AI Gateway for model selection across providers like OpenAI, Anthropic, and Google. It enforces up-to-date API references and ensures you avoid outdated patterns during integration.

How do embeddings work when building RAG systems with the AI SDK?

Embeddings work by using the embed function to generate vector representations of text for RAG systems. This allows your AI agents to retrieve and ground responses in external knowledge bases.

When should I use generateText instead of streamText in my application?

Use generateText when you need complete responses for background tasks, and use streamText for interactive UI integrations. Both AI SDK functions apply to different AI-powered feature workflows depending on latency requirements.