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)
- Create or select a memory ID
- Ingest documents (JSON text, file, or URL)
- Use
findfor retrieval UX - Use
askfor grounded synthesis - 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: trueexplicitly
jobId and pollUrl:
Polling for completion
Handling both sync and async responses
Reliability Checklist
- Keep API keys server-side only.
- Use memory-scoped keys for least privilege.
- Retry
429and5xxwith 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:POST /v1/memories-> getmemory.idPOST /v1/memories/:id/documents-> ingest sample textPOST /v1/memories/:id/find-> expect at least one hitPOST /v1/memories/:id/ask-> expectanswer/textand optionalsources