Skip to main content
Use this guide when you are integrating Memvid through HTTP in platforms like n8n, Replit, Lovable, or v0.
This page is the shared contract for API-first integrations. Platform pages should reuse these request shapes and reliability patterns.

Base Setup

  • Base URL: https://api.memvid.com
  • Auth header (recommended): Authorization: Bearer mv2_YOUR_API_KEY
  • Alternative auth header: X-API-Key: mv2_YOUR_API_KEY

Golden Path (Minimal Production Flow)

  1. Create or select a memory ID
  2. Ingest documents (JSON text, file, or URL)
  3. Use find for retrieval UX
  4. Use ask for grounded synthesis
  5. Return answer with sources in your app UI

Canonical Request Shapes

Create Memory

Add Documents (JSON)

Find

Ask

Typed Client Wrapper (TypeScript)

Async Ingestion and Job Polling

Some uploads are processed asynchronously via a background worker. This happens automatically when:
  • The file is larger than 2 MB
  • A PDF has more than 5 scanned/image-only pages (triggers OCR in the background)
  • You set options.async: true explicitly
When async processing kicks in, the response returns HTTP 202 instead of 200, with a jobId and pollUrl:

Polling for completion

Scanned PDFs with many pages can take 2–8 minutes to process via OCR. Use a generous timeout (5–10 minutes) and poll every 5–10 seconds.

Handling both sync and async responses

Reliability Checklist

  • Keep API keys server-side only.
  • Use memory-scoped keys for least privilege.
  • Retry 429 and 5xx with backoff.
  • Enforce request timeouts to prevent hanging workers.
  • Log method, path, status, and request IDs for debugging.
  • Show source snippets in UI for grounded trust.

5-Minute Smoke Test

Run these calls in order and verify non-empty responses:
  1. POST /v1/memories -> get memory.id
  2. POST /v1/memories/:id/documents -> ingest sample text
  3. POST /v1/memories/:id/find -> expect at least one hit
  4. POST /v1/memories/:id/ask -> expect answer/text and optional sources

Next Pages