Skip to main content
Integrate Memvid with the Vercel AI SDK to build AI-powered web applications. The vercel-ai adapter provides tools formatted for use with generateText, streamText, and other AI SDK functions.

Installation

Quick Start

Available Tools

The Vercel AI adapter provides three tools:

Using with generateText

Using with streamText

Direct Tool Usage

You can also call tools directly without using an LLM:

Next.js API Route

Next.js with useChat

Tool Parameters

memvid_put

memvid_find

memvid_ask

Best Practices

  1. Set maxSteps to allow the model to make multiple tool calls when needed
  2. Use streaming for better user experience with streamText
  3. Handle tool results by checking result.steps for tool call history
  4. Close the memory when done with mem.seal()

Next Steps

OpenAI SDK

OpenAI function calling

LangChain

LangChain integration