Skip to main content
Use Memvid in v0 projects by calling Memvid from Next.js route handlers or server actions.
API-based integration. This guide uses https://api.memvid.com directly (no SDK and no local .mv2 file).

Prerequisites

  • A Memvid API key (mv2_...)
  • A v0-generated Next.js app

Environment Variables

Add these to your environment:

Shared Server Helper (lib/memvid.ts)

Route Handler Example (app/api/memvid/ask/route.ts)

Route Handler Example (app/api/memvid/find/route.ts)

When to Use find vs ask

  • Use find to show matching chunks/snippets in UI.
  • Use ask when you need a synthesized answer grounded in retrieved context.
  • Browser UI calls your Next.js API route.
  • Route calls Memvid with server-side credentials.
  • Response is rendered with answer + sources.

Smoke Test

  1. POST /api/memvid/find:
  1. POST /api/memvid/ask:
  1. Verify both routes return JSON with non-empty content.