> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memvid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Why Memvid?

> How Memvid compares to vector databases and why developers choose single-file AI memory

## The RAG infrastructure problem

Building AI applications with memory typically requires:

1. **A vector database** (Pinecone, Weaviate, Qdrant, Milvus)
2. **An embedding API** (OpenAI, Cohere, or self-hosted)
3. **A backend service** to coordinate queries
4. **Operational overhead** for backups, scaling, monitoring

For a simple "search my documents" feature, you're suddenly managing distributed infrastructure.

**Memvid takes a different approach**: Smart Frames in a single file. 11x faster search.

***

## The single-file advantage

### What's in an `.mv2` file?

```mermaid theme={null}
flowchart TB
    subgraph MV2["knowledge.mv2"]
        direction TB
        H["4KB Header<br/>Metadata, Version, Checksums"]
        W["Embedded WAL (1-64 MB)<br/>Crash Recovery, Transaction Log"]
        D["Frame Segments<br/>Documents, Text, Files"]
        L["Lexical Index<br/>Tantivy/BM25 Keyword Search"]
        V["Vector Index<br/>HNSW Semantic Embeddings"]
        T["Time Index<br/>Timeline & Time-Travel Queries"]
        C["Table of Contents<br/>Fast Navigation"]
        F["48B Footer<br/>Recovery Pointer"]

        H --> W --> D --> L --> V --> T --> C --> F
    end

    style H fill:#FF9900,color:#000
    style W fill:#FFB84D,color:#000
    style D fill:#3b82f6,color:#fff
    style L fill:#10b981,color:#fff
    style V fill:#8b5cf6,color:#fff
    style T fill:#ef4444,color:#fff
    style C fill:#64748b,color:#fff
    style F fill:#1e293b,color:#fff
```

<Info>
  **Everything is self-contained.** No sidecar files. No auxiliary databases. No cloud sync. Just one portable `.mv2` file.
</Info>

### What this enables

<CardGroup cols={2}>
  <Card title="True Portability" icon="suitcase">
    Copy your knowledge base to a USB drive. Email it. Deploy it anywhere. It just works.
  </Card>

  <Card title="Offline First" icon="wifi-slash">
    No internet required. No API keys for basic operations. Works on airplanes.
  </Card>

  <Card title="Zero Ops" icon="server">
    No databases to manage. No Docker containers. No cloud bills. Just a file.
  </Card>

  <Card title="Privacy by Default" icon="lock">
    Your data never leaves your machine unless you explicitly send it somewhere.
  </Card>
</CardGroup>

***

## Head-to-head comparison

### Memvid vs. Pinecone

**Benchmark results (1,000 documents):**

| Metric             | Memvid       | Pinecone | Winner       |
| ------------------ | ------------ | -------- | ------------ |
| **Setup**          | 145ms        | 7.4s     | Memvid (51x) |
| **Search latency** | 24ms         | 267ms    | Memvid (11x) |
| **Storage**        | 4.9 MB local | Cloud    | Memvid       |
| **API calls**      | 0            | 1,005    | Memvid       |

| Aspect                  | Memvid                                              | Pinecone                    |
| ----------------------- | --------------------------------------------------- | --------------------------- |
| **Deployment**          | Single file, runs anywhere                          | Cloud-only SaaS             |
| **Setup time**          | 145ms                                               | 7.4 seconds + account setup |
| **Offline support**     | Full functionality                                  | None                        |
| **Data location**       | Your machine                                        | Pinecone's cloud            |
| **Search modes**        | Smart Frames (Lexical + Vector + Temporal + Entity) | Vector only                 |
| **Cost (100K vectors)** | Free                                                | \$70+/month                 |
| **Scaling**             | Vertical (bigger machine)                           | Horizontal (managed)        |

<Info>
  **Why is Memvid search 11x faster?** No network round-trips. Pinecone requires: (1) API call to embed your query, (2) API call to search vectors. Memvid searches locally with Smart Frames.
</Info>

***

### Memvid vs. ChromaDB

| Aspect                   | Memvid                                              | ChromaDB                 |
| ------------------------ | --------------------------------------------------- | ------------------------ |
| **Storage**              | Single `.mv2` file                                  | SQLite + multiple files  |
| **Portability**          | Copy one file                                       | Copy directory structure |
| **Crash recovery**       | Embedded WAL, automatic                             | Manual recovery          |
| **Search modes**         | Smart Frames (Lexical + Vector + Temporal + Entity) | Vector only              |
| **Built-in RAG**         | `.ask()` method                                     | Build with LangChain     |
| **Time-travel queries**  | Yes                                                 | No                       |
| **Entity extraction**    | Built-in (auto-tagging, triplets)                   | No                       |
| **Visual search (CLIP)** | Yes                                                 | No                       |

***

### Memvid vs. Weaviate

| Aspect                  | Memvid                                              | Weaviate                      |
| ----------------------- | --------------------------------------------------- | ----------------------------- |
| **Deployment**          | Single file                                         | Docker/Kubernetes required    |
| **Setup**               | `pip install` (seconds)                             | Docker compose, configuration |
| **Search modes**        | Smart Frames (Lexical + Vector + Temporal + Entity) | Hybrid (BM25 + Vector)        |
| **Time-travel queries** | Yes                                                 | No                            |
| **Entity extraction**   | Built-in                                            | No                            |
| **GraphQL API**         | No (SDK only)                                       | Yes                           |
| **Multi-tenancy**       | Separate files                                      | Built-in                      |
| **Schema**              | Schema-free                                         | Schema required               |

***

### Memvid vs. pgvector

| Aspect                  | Memvid                                              | pgvector                     |
| ----------------------- | --------------------------------------------------- | ---------------------------- |
| **Database**            | None required                                       | PostgreSQL required          |
| **SQL queries**         | No                                                  | Yes                          |
| **Portability**         | Single file                                         | Database backup/restore      |
| **Search modes**        | Smart Frames (Lexical + Vector + Temporal + Entity) | Vector + manual full-text    |
| **Time-travel queries** | Yes                                                 | No                           |
| **Entity extraction**   | Built-in                                            | No                           |
| **Setup**               | `pip install` (seconds)                             | Postgres + extension install |

***

## Smart Frame capabilities

Features you won't find in typical vector databases:

### Time-travel queries

Search your memory as it existed at any point in time:

```python theme={null}
# What did we know about the budget last week?
results = mem.find("budget", as_of_timestamp=1704067200)

# What was in the knowledge base before we added the Q4 report?
results = mem.find("revenue", as_of_frame=100)
```

### Visual search with CLIP

Search images and PDF pages by visual content:

```python theme={null}
from memvid_sdk.clip import get_clip_provider

clip = get_clip_provider('local')  # No API keys needed
embedding = clip.embed_text("pie chart showing market share")

# Find visually similar content
results = mem.visual_search(embedding, k=10)
```

### Entity extraction (Logic Mesh)

Automatically extract and traverse relationships:

```python theme={null}
from memvid_sdk.entities import get_entity_extractor

ner = get_entity_extractor('openai', entity_types=['PERSON', 'COMPANY', 'PRODUCT'])
entities = ner.extract(document_text)

# Traverse the entity graph
related = mem.follow("Microsoft", link="acquired", hops=2)
```

### Built-in RAG with citations

Ask questions and get sourced answers without building chains:

```python theme={null}
answer = mem.ask("What was our Q4 revenue?")

print(answer["answer"])              # "Q4 revenue was $2.4M, up 15% YoY..."
print(answer.get("sources", [])[:1]) # [{"title": "...", "uri": "...", ...}]
```

### Embedded crash recovery

The Write-Ahead Log (WAL) ensures you never lose data:

```python theme={null}
# Even if power fails here...
mem.put(title="Important", text="Critical data...")

# ...the data is recoverable on next open
mem = use('basic', 'knowledge.mv2')  # Auto-recovers uncommitted writes
```

***

## Get started

<CardGroup cols={2}>
  <Card title="5-Minute Quickstart" icon="rocket" href="/quickstart/five-minute-guide">
    Build your first AI memory
  </Card>

  <Card title="Python SDK" icon="python" href="/python-sdk/overview">
    Complete reference
  </Card>
</CardGroup>
