Skip to main content
Build AI applications, agents, and data pipelines with the Memvid Python SDK. Native Rust bindings deliver high performance with a Pythonic API.

Installation

Requirements: Python 3.8+, macOS/Linux/Windows. Native bindings included - no extra dependencies needed.

create() will OVERWRITE existing files without warning!Always check if the file exists before choosing — see example below.

Quick Start


API Reference


Context Manager


Core Functions

File Operations

Context Manager Support


Auto-Embedding

The SDK automatically enables vector embeddings when OPENAI_API_KEY is set in your environment:
How it works:
  • If OPENAI_API_KEY is set and enable_embedding is not specified, embeddings are auto-enabled
  • Uses OpenAI’s text-embedding-3-small model (1536 dimensions)
  • If no API key is present and no model specified, falls back to local bge-small (384 dimensions)
Set OPENAI_API_KEY once in your environment and the SDK handles the rest. No need to pass enable_embedding=True or specify models.

Data Ingestion

put() - Add Single Document

put_many() - Batch Ingestion

put_file() - Document Parsing

Ingest documents directly from files. Supports PDF, DOCX, XLSX, PPTX, and more. The SDK automatically extracts text content and creates searchable frames.

put_files() - 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)
Required for document parsing: Install dependencies before using put_file():
Without these, you’ll see errors like [memvid] pypdf/PyPDF2 not installed, PDF parsing unavailable.
For XLSX files with formulas, the SDK extracts the calculated values, not the formula text. This ensures searchable, meaningful content.

Search & Retrieval

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 acl_context + acl_enforcement_mode="enforce" to find() / ask()

ask() - LLM Q&A

Grounding & Hallucination Detection

The ask() response includes a grounding object that measures how well the answer is supported by context:
Grounding Fields: Follow-up Fields:

correct() - Ground Truth Corrections

Store authoritative corrections that take priority in future retrievals:
Use correct() to fix hallucinations or add verified facts. Corrections receive boosted retrieval scores and are labeled [Correction] in results.

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

Project Response Fields:

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


Utility Functions


Environment Variables


Next Steps

Quickstart

Build your first AI memory in 5 minutes

Embedding Providers

Compare local and external embedding options

Framework Integrations

LangChain, LlamaIndex, and more

Memory Cards

O(1) entity lookups and fact extraction