Skip to main content
Memvid supports multiple embedding models for semantic (vector) search. You can use the built-in BGE-small model for local, offline operation, or connect to external providers like OpenAI, Cohere, or Voyage for higher-quality embeddings.

Overview

Embeddings convert text into dense numerical vectors that capture semantic meaning. Similar concepts produce similar vectors, enabling semantic search (finding documents by meaning rather than exact keywords).

Built-in Model (Default)

By default, Memvid uses BGE-small-en-v1.5, a lightweight embedding model that runs locally without any API keys.

Characteristics

  • Dimensions: 384
  • Size: ~75 MB (downloaded on first use)
  • Inference: CPU-based, no GPU required
  • Privacy: All processing happens locally
  • Offline: Works without internet after initial download

Usage


Ollama Embeddings (Local)

Ollama provides high-quality embeddings that run entirely locally on your machine. No API keys, no data leaving your infrastructure, and no usage costs.

Setup

  1. Install Ollama: ollama.com/download
  2. Pull an embedding model:

Python SDK

Node.js SDK

Supported Models

Custom Server

Environment Variables


OpenAI Embeddings

OpenAI’s embedding models offer excellent quality for general-purpose semantic search.

Setup

CLI Usage

Python SDK


NVIDIA Embeddings

NVIDIA Integrate provides a fast hosted embedding API with OpenAI-compatible shapes.

Setup

Python SDK

Node.js SDK

Node.js SDK

Model Comparison


Cohere Embeddings

Cohere offers specialized models for English and multilingual content.

Setup

Python SDK

Node.js SDK

Model Options


Voyage Embeddings

Voyage AI specializes in embeddings for code and technical documentation.

Setup

Python SDK

Node.js SDK

Model Options


HuggingFace Embeddings (Python)

Use any HuggingFace sentence-transformer model locally.

Setup

Usage


Using External Embeddings with Memvid

The key workflow for external embeddings:
  1. Pick an embedder (OpenAI/Cohere/Voyage/NVIDIA/etc.)
  2. Ingest with put_many(..., embedder=...) (stores embedding identity metadata)
  3. Query with find/ask(..., embedder=...) (keeps dimensions consistent)

Batch Ingestion Example


Vector Compression

For large collections, enable vector compression to reduce storage by ~16x:
This uses Product Quantization (PQ) to compress vectors while maintaining search quality.

Environment Variables


Choosing an Embedding Model

Decision Matrix

Performance Considerations

  • Dimension count affects storage and search speed
  • API latency for external providers (batch when possible)
  • Rate limits vary by provider plan
  • Consistency - use same model for ingestion and search

Reranking

Memvid can rerank retrieved candidates using a cross-encoder model (auto-downloaded on first use). In the CLI this is applied during ask and can be disabled:
For find, reranking is handled internally; there is no --rerank flag.

Next Steps

Indices and Tracks

Learn about lexical, vector, and time indices

Search & Ask

Master semantic search queries