Skip to main content
Integrate Memvid with the OpenAI SDK to use function calling with your knowledge base. The openai adapter provides function schemas formatted for OpenAI’s chat completions API.

Installation

Quick Start

Available Functions

The OpenAI adapter provides three functions:

Function Calling Example

Complete Conversation Loop

Function Schemas

memvid_put

memvid_find

memvid_ask

Best Practices

  1. Use tool_choice=“auto” to let the model decide when to use tools
  2. Handle multiple tool calls - the model may call multiple functions
  3. Complete the loop - continue until no more tool_calls are returned
  4. Close the memory when done

Next Steps

Vercel AI SDK

Vercel AI SDK integration

AutoGen

AutoGen multi-agent