Installation
Requirements: Node.js 18+, macOS/Linux/Windows. Native bindings included - no extra dependencies needed.
Quick Start
API Reference
Core Functions
File Operations
Framework Adapters
Choose an adapter for your framework:Auto-Embedding
The SDK automatically enables vector embeddings whenOPENAI_API_KEY is set in your environment:
- If
OPENAI_API_KEYis set andenableEmbeddingis not specified, embeddings are auto-enabled - Uses OpenAI’s
text-embedding-3-smallmodel (1536 dimensions) - If no API key is present and no model specified, falls back to local
bge-small(384 dimensions)
Data Ingestion
put() - Add Single Document
putMany() - Batch Ingestion
putFile() - Document Parsing
Ingest documents directly from files. Supports PDF, DOCX, XLSX, PPTX, and more. The SDK automatically extracts text content and creates searchable frames.putFiles() - Batch Document Ingestion
Ingest multiple documents at once:Supported Formats:
- PDF - Text extraction with page-aware chunking
- DOCX - Microsoft Word documents
- XLSX - Excel spreadsheets (all sheets, formulas evaluated)
- PPTX - PowerPoint presentations (slide text and notes)
For XLSX files with formulas, the SDK extracts the calculated values, not the formula text. This ensures searchable, meaningful content.
Search & Retrieval
find() - Hybrid Search
Query Syntax: Multi-word queries use OR logic by default for better recall. Use
AND for intersection: "machine AND learning". Use quotes for exact phrases: '"machine learning"'.Permission-Aware Retrieval (ACL)
See Permission-Aware Retrieval (ACL) for the full model. At a high level:- Write per-frame ACL metadata during ingestion (
metadata.acl_*) - Pass
aclContext+aclEnforcementMode: 'enforce'tofind()/ask()
ask() - LLM Q&A
vecSearch() - Pure Vector Search
Grounding & Hallucination Detection
Theask() response includes a grounding object that measures how well the answer is supported by context:
Follow-up Fields:
correct() - Ground Truth Corrections
Store authoritative corrections that take priority in future retrievals:Memory Cards (Entity Extraction)
Automatic Enrichment
Manual Memory Cards
Export Facts
Table Extraction
Time-Travel & Sessions
Timeline Queries
Session Recording
Encryption & Security
Tickets & Capacity
Cloud Project & Memory Management
Programmatically create projects and memories on the Memvid dashboard, then bind local.mv2 files to them.
Configure SDK
Create and List Projects
Create and List Memories
Bind Local File to Cloud Memory
Complete Example
Embedding Providers
External Providers
Local Embeddings (No API Required)
Error Handling
Asset Extraction
Environment Variables
Deploying to Vercel
The Memvid Node.js SDK uses native bindings (N-API) for optimal performance. When deploying to Vercel’s serverless environment, you need to configure Next.js to bundle the native binary correctly.next.config.ts Configuration
AddoutputFileTracingIncludes to ensure the native .node files are bundled with your serverless functions:
Explicit Platform Package (Optional)
For more reliable deployments, explicitly add the Linux platform package to your dependencies:Vercel’s serverless runtime uses Amazon Linux 2 (x64). The SDK automatically selects the correct platform binary, but explicit inclusion ensures bundling works correctly.
Serverless /tmp Storage
Vercel’s serverless functions have ephemeral/tmp storage that doesn’t persist between invocations. For production apps:
- Use cloud storage (S3, R2, etc.) to persist
.mv2files - Download on-demand when the function cold starts
- Pass files as buffers between API routes instead of file paths
Troubleshooting
TypeScript Types
Next Steps
Quickstart
Build your first AI memory in 5 minutes
Embedding Providers
Compare local and external embedding options
Framework Integrations
LangChain, LlamaIndex, Vercel AI, and more
Memory Cards
O(1) entity lookups and fact extraction