[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5435":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":14,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":44,"readmeContent":45,"aiSummary":46,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":47,"discoverSource":48},5435,"memvid","memvid\u002Fmemvid","Memory layer for AI Agents. Replace complex RAG pipelines with a serverless, single-file memory layer. Give your agents instant retrieval and long-term memory.","https:\u002F\u002Fwww.memvid.com",null,"Rust",15638,1350,115,10,0,2,21,224,93.89,"Apache License 2.0",false,"main",true,[25,26,27,28,29,30,31,32,33,5,34,35,36,37,38,39,40,41,42,43],"ai","context","embedded","faiss","knowledge-base","knowledge-graph","llm","machine-learning","memory","mv2","nlp","offline-first","opencv","python","rag","retrieval-augmented-generation","semantic-search","vector-database","video-processing","2026-06-12 04:00:25","\u003C!-- HEADER:START -->\n\u003Cimg width=\"2000\" height=\"524\" alt=\"Social Cover (9)\"\n     src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fcf66f045-c8be-494b-b696-b8d7e4fb709c\" \u002F>\n\u003C!-- HEADER:END -->\n\n\u003Cdiv style=\"height: 16px;\">\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F17293\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F17293\" alt=\"memvid%2Fmemvid | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\u003C!-- BADGES:END -->\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Memvid is a single-file memory layer for AI agents with instant retrieval and long-term memory.\u003C\u002Fstrong>\u003Cbr\u002F>\n  Persistent, versioned, and portable memory, without databases.\n\u003C\u002Fp>\n\n\u003C!-- NAV:START -->\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.memvid.com\">Website\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fsandbox.memvid.com\">Try Sandbox\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fdocs.memvid.com\">Docs\u003C\u002Fa>\n  ·\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmemvid\u002Fmemvid\u002Fdiscussions\">Discussions\u003C\u002Fa>\n\u003C\u002Fp>\n\u003C!-- NAV:END -->\n\n\u003C!-- BADGES:START -->\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmemvid-core\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fmemvid-core?style=flat-square&logo=rust\" alt=\"Crates.io\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdocs.rs\u002Fmemvid-core\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdocsrs\u002Fmemvid-core?style=flat-square&logo=docs.rs\" alt=\"docs.rs\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmemvid\u002Fmemvid\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue?style=flat-square\" alt=\"License\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmemvid\u002Fmemvid\u002Fstargazers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fmemvid\u002Fmemvid?style=flat-square&logo=github\" alt=\"Stars\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmemvid\u002Fmemvid\u002Fnetwork\u002Fmembers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fmemvid\u002Fmemvid?style=flat-square&logo=github\" alt=\"Forks\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmemvid\u002Fmemvid\u002Fissues\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fmemvid\u002Fmemvid?style=flat-square&logo=github\" alt=\"Issues\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002F2mynS7fcK7\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1442910055233224745?style=flat-square&logo=discord&label=discord\" alt=\"Discord\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n## Benchmark Highlights\n\n**🚀 Higher accuracy than any other memory system :** +35% SOTA on LoCoMo, best-in-class long-horizon conversational recall & reasoning\n\n**🧠 Superior multi-hop & temporal reasoning:**  +76% multi-hop, +56% temporal vs. the industry average\n\n**⚡ Ultra-low latency at scale** 0.025ms P50 and 0.075ms P99, with 1,372× higher throughput than standard\n\n**🔬 Fully reproducible benchmarks:** LoCoMo (10 × ~26K-token conversations), open-source eval, LLM-as-Judge\n\n\n## What is Memvid?\n\nMemvid is a portable AI memory system that packages your data, embeddings, search structure, and metadata into a single file.\n\nInstead of running complex RAG pipelines or server-based vector databases, Memvid enables fast retrieval directly from the file.\n\nThe result is a model-agnostic, infrastructure-free memory layer that gives AI agents persistent, long-term memory they can carry anywhere.\n\n    \n## What are Smart Frames?\n\nMemvid draws inspiration from video encoding, not to store video, but to **organize AI memory as an append-only, ultra-efficient sequence of Smart Frames.**\n\nA Smart Frame is an immutable unit that stores content along with timestamps, checksums and basic metadata.\nFrames are grouped in a way that allows efficient compression, indexing, and parallel reads.\n\nThis frame-based design enables:\n\n-   Append-only writes without modifying or corrupting existing data\n-   Queries over past memory states\n-   Timeline-style inspection of how knowledge evolves\n-   Crash safety through committed, immutable frames\n-   Efficient compression using techniques adapted from video encoding\n\nThe result is a single file that behaves like a rewindable memory timeline for AI systems.\n\n\n## Core Concepts\n\n-   **Living Memory Engine**\n    Continuously append, branch, and evolve memory across sessions.\n\n-   **Capsule Context (`.mv2`)**\n    Self-contained, shareable memory capsules with rules and expiry.\n\n-   **Time-Travel Debugging**\n    Rewind, replay, or branch any memory state.\n\n-   **Smart Recall**\n    Sub-5ms local memory access with predictive caching.\n\n-   **Codec Intelligence**\n    Auto-selects and upgrades compression over time.\n\n\n## Use Cases\n\nMemvid is a portable, serverless memory layer that gives AI agents persistent memory and fast recall. Because it's model-agnostic, multi-modal, and works fully offline, developers are using Memvid across a wide range of real-world applications.\n\n-   Long-Running AI Agents\n-   Enterprise Knowledge Bases\n-   Offline-First AI Systems\n-   Codebase Understanding\n-   Customer Support Agents\n-   Workflow Automation\n-   Sales and Marketing Copilots\n-   Personal Knowledge Assistants\n-   Medical, Legal, and Financial Agents\n-   Auditable and Debuggable AI Workflows\n-   Custom Applications\n\n\n## SDKs & CLI\n\nUse Memvid in your preferred language:\n\n| Package         | Install                     | Links                                                                                                               |\n| --------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| **CLI**         | `npm install -g memvid-cli` | [![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fmemvid-cli?style=flat-square)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmemvid-cli)       |\n| **Node.js SDK** | `npm install @memvid\u002Fsdk`   | [![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@memvid\u002Fsdk?style=flat-square)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@memvid\u002Fsdk)     |\n| **Python SDK**  | `pip install memvid-sdk`    | [![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fmemvid-sdk?style=flat-square)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fmemvid-sdk\u002F)         |\n| **Rust**        | `cargo add memvid-core`     | [![Crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fmemvid-core?style=flat-square)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmemvid-core) |\n\n---\n\n## Installation (Rust)\n\n### Requirements\n\n-   **Rust 1.85.0+** — Install from [rustup.rs](https:\u002F\u002Frustup.rs)\n\n### Add to Your Project\n\n```toml\n[dependencies]\nmemvid-core = \"2.0\"\n```\n\n### Feature Flags\n\n| Feature             | Description                                                      |\n| ------------------- | ---------------------------------------------------------------- |\n| `lex`               | Full-text search with BM25 ranking (Tantivy)                     |\n| `pdf_extract`       | Pure Rust PDF text extraction                                    |\n| `vec`               | Vector similarity search (HNSW + local text embeddings via ONNX) |\n| `clip`              | CLIP visual embeddings for image search                          |\n| `whisper`           | Audio transcription with Whisper                                 |\n| `api_embed`         | Cloud API embeddings (OpenAI)                                    |\n| `temporal_track`    | Natural language date parsing (\"last Tuesday\")                   |\n| `parallel_segments` | Multi-threaded ingestion                                         |\n| `encryption`        | Password-based encryption capsules (.mv2e)                       |\n| `symspell_cleanup`  | Robust PDF text repair (fixes \"emp lo yee\" -> \"employee\")        |\n\nEnable features as needed:\n\n```toml\n[dependencies]\nmemvid-core = { version = \"2.0\", features = [\"lex\", \"vec\", \"temporal_track\"] }\n```\n\n\n## Quick Start\n\n```rust\nuse memvid_core::{Memvid, PutOptions, SearchRequest};\n\nfn main() -> memvid_core::Result\u003C()> {\n    \u002F\u002F Create a new memory file\n    let mut mem = Memvid::create(\"knowledge.mv2\")?;\n\n    \u002F\u002F Add documents with metadata\n    let opts = PutOptions::builder()\n        .title(\"Meeting Notes\")\n        .uri(\"mv2:\u002F\u002Fmeetings\u002F2024-01-15\")\n        .tag(\"project\", \"alpha\")\n        .build();\n    mem.put_bytes_with_options(b\"Q4 planning discussion...\", opts)?;\n    mem.commit()?;\n\n    \u002F\u002F Search\n    let response = mem.search(SearchRequest {\n        query: \"planning\".into(),\n        top_k: 10,\n        snippet_chars: 200,\n        ..Default::default()\n    })?;\n\n    for hit in response.hits {\n        println!(\"{}: {}\", hit.title.unwrap_or_default(), hit.text);\n    }\n\n    Ok(())\n}\n```\n\n---\n\n## Build\n\nClone the repository:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmemvid\u002Fmemvid.git\ncd memvid\n```\n\nBuild in debug mode:\n\n```bash\ncargo build\n```\n\nBuild in release mode (optimized):\n\n```bash\ncargo build --release\n```\n\nBuild with specific features:\n\n```bash\ncargo build --release --features \"lex,vec,temporal_track\"\n```\n\n---\n\n## Run Tests\n\nRun all tests:\n\n```bash\ncargo test\n```\n\nRun tests with output:\n\n```bash\ncargo test -- --nocapture\n```\n\nRun a specific test:\n\n```bash\ncargo test test_name\n```\n\nRun integration tests only:\n\n```bash\ncargo test --test lifecycle\ncargo test --test search\ncargo test --test mutation\n```\n\n---\n\n## Examples\n\nThe `examples\u002F` directory contains working examples:\n\n### Basic Usage\n\nDemonstrates create, put, search, and timeline operations:\n\n```bash\ncargo run --example basic_usage\n```\n\n### PDF Ingestion\n\nIngest and search PDF documents (uses the \"Attention Is All You Need\" paper):\n\n```bash\ncargo run --example pdf_ingestion\n```\n\n### CLIP Visual Search\n\nImage search using CLIP embeddings (requires `clip` feature):\n\n```bash\ncargo run --example clip_visual_search --features clip\n```\n\n### Whisper Transcription\n\nAudio transcription (requires `whisper` feature):\n\n```bash\ncargo run --example test_whisper --features whisper -- \u002Fpath\u002Fto\u002Faudio.mp3\n```\n\n**Available Models:**\n\n| Model                 | Size   | Speed   | Use Case                            |\n| --------------------- | ------ | ------- | ----------------------------------- |\n| `whisper-small-en`    | 244 MB | Slowest | Best accuracy (default)             |\n| `whisper-tiny-en`     | 75 MB  | Fast    | Balanced                            |\n| `whisper-tiny-en-q8k` | 19 MB  | Fastest | Quick testing, resource-constrained |\n\n**Model Selection:**\n\n```bash\n# Default (FP32 small, highest accuracy)\ncargo run --example test_whisper --features whisper -- audio.mp3\n\n# Quantized tiny (75% smaller, faster)\nMEMVID_WHISPER_MODEL=whisper-tiny-en-q8k cargo run --example test_whisper --features whisper -- audio.mp3\n```\n\n**Programmatic Configuration:**\n\n```rust\nuse memvid_core::{WhisperConfig, WhisperTranscriber};\n\n\u002F\u002F Default FP32 small model\nlet config = WhisperConfig::default();\n\n\u002F\u002F Quantized tiny model (faster, smaller)\nlet config = WhisperConfig::with_quantization();\n\n\u002F\u002F Specific model\nlet config = WhisperConfig::with_model(\"whisper-tiny-en-q8k\");\n\nlet transcriber = WhisperTranscriber::new(&config)?;\nlet result = transcriber.transcribe_file(\"audio.mp3\")?;\nprintln!(\"{}\", result.text);\n```\n\n\n## Text Embedding Models\n\nThe `vec` feature includes local text embedding support using ONNX models. Before using local text embeddings, you need to download the model files manually.\n\n### Quick Start: BGE-small (Recommended)\n\nDownload the default BGE-small model (384 dimensions, fast and efficient):\n\n```bash\nmkdir -p ~\u002F.cache\u002Fmemvid\u002Ftext-models\n\n# Download ONNX model\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002FBAAI\u002Fbge-small-en-v1.5\u002Fresolve\u002Fmain\u002Fonnx\u002Fmodel.onnx' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fbge-small-en-v1.5.onnx\n\n# Download tokenizer\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002FBAAI\u002Fbge-small-en-v1.5\u002Fresolve\u002Fmain\u002Ftokenizer.json' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fbge-small-en-v1.5_tokenizer.json\n```\n\n### Available Models\n\n| Model                   | Dimensions | Size   | Best For        |\n| ----------------------- | ---------- | ------ | --------------- |\n| `bge-small-en-v1.5`     | 384        | ~120MB | Default, fast   |\n| `bge-base-en-v1.5`      | 768        | ~420MB | Better quality  |\n| `nomic-embed-text-v1.5` | 768        | ~530MB | Versatile tasks |\n| `gte-large`             | 1024       | ~1.3GB | Highest quality |\n\n### Other Models\n\n**BGE-base** (768 dimensions):\n```bash\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002FBAAI\u002Fbge-base-en-v1.5\u002Fresolve\u002Fmain\u002Fonnx\u002Fmodel.onnx' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fbge-base-en-v1.5.onnx\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002FBAAI\u002Fbge-base-en-v1.5\u002Fresolve\u002Fmain\u002Ftokenizer.json' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fbge-base-en-v1.5_tokenizer.json\n```\n\n**Nomic** (768 dimensions):\n```bash\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002Fnomic-ai\u002Fnomic-embed-text-v1.5\u002Fresolve\u002Fmain\u002Fonnx\u002Fmodel.onnx' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fnomic-embed-text-v1.5.onnx\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002Fnomic-ai\u002Fnomic-embed-text-v1.5\u002Fresolve\u002Fmain\u002Ftokenizer.json' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fnomic-embed-text-v1.5_tokenizer.json\n```\n\n**GTE-large** (1024 dimensions):\n```bash\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002Fthenlper\u002Fgte-large\u002Fresolve\u002Fmain\u002Fonnx\u002Fmodel.onnx' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fgte-large.onnx\ncurl -L 'https:\u002F\u002Fhuggingface.co\u002Fthenlper\u002Fgte-large\u002Fresolve\u002Fmain\u002Ftokenizer.json' \\\n  -o ~\u002F.cache\u002Fmemvid\u002Ftext-models\u002Fgte-large_tokenizer.json\n```\n\n### Usage in Code\n\n```rust\nuse memvid_core::text_embed::{LocalTextEmbedder, TextEmbedConfig};\nuse memvid_core::types::embedding::EmbeddingProvider;\n\n\u002F\u002F Use default model (BGE-small)\nlet config = TextEmbedConfig::default();\nlet embedder = LocalTextEmbedder::new(config)?;\n\nlet embedding = embedder.embed_text(\"hello world\")?;\nassert_eq!(embedding.len(), 384);\n\n\u002F\u002F Use different model\nlet config = TextEmbedConfig::bge_base();\nlet embedder = LocalTextEmbedder::new(config)?;\n```\n\nSee `examples\u002Ftext_embedding.rs` for a complete example with similarity computation and search ranking.\n\n### Model Consistency\n\nTo prevent accidental model mixing (e.g., querying a BGE-small index with OpenAI embeddings), you can explicitly bind your Memvid instance to a specific model name:\n\n```rust\n\u002F\u002F Bind the index to a specific model.\n\u002F\u002F If the index was previously created with a different model, this will return an error.\nmem.set_vec_model(\"bge-small-en-v1.5\")?;\n```\n\nThis binding is persistent. Once set, future attempts to use a different model name will fail fast with a `ModelMismatch` error.\n\n\n\n## API Embeddings (OpenAI)\n\nThe `api_embed` feature enables cloud-based embedding generation using OpenAI's API.\n\n### Setup\n\nSet your OpenAI API key:\n\n```bash\nexport OPENAI_API_KEY=\"sk-...\"\n```\n\n### Usage\n\n```rust\nuse memvid_core::api_embed::{OpenAIConfig, OpenAIEmbedder};\nuse memvid_core::types::embedding::EmbeddingProvider;\n\n\u002F\u002F Use default model (text-embedding-3-small)\nlet config = OpenAIConfig::default();\nlet embedder = OpenAIEmbedder::new(config)?;\n\nlet embedding = embedder.embed_text(\"hello world\")?;\nassert_eq!(embedding.len(), 1536);\n\n\u002F\u002F Use higher quality model\nlet config = OpenAIConfig::large();  \u002F\u002F text-embedding-3-large (3072 dims)\nlet embedder = OpenAIEmbedder::new(config)?;\n```\n\n### Available Models\n\n| Model                    | Dimensions | Best For                   |\n| ------------------------ | ---------- | -------------------------- |\n| `text-embedding-3-small` | 1536       | Default, fastest, cheapest |\n| `text-embedding-3-large` | 3072       | Highest quality            |\n| `text-embedding-ada-002` | 1536       | Legacy model               |\n\nSee `examples\u002Fopenai_embedding.rs` for a complete example.\n\n\n\n## File Format\n\nEverything lives in a single `.mv2` file:\n\n```\n┌────────────────────────────┐\n│ Header (4KB)               │  Magic, version, capacity\n├────────────────────────────┤\n│ Embedded WAL (1-64MB)      │  Crash recovery\n├────────────────────────────┤\n│ Data Segments              │  Compressed frames\n├────────────────────────────┤\n│ Lex Index                  │  Tantivy full-text\n├────────────────────────────┤\n│ Vec Index                  │  HNSW vectors\n├────────────────────────────┤\n│ Time Index                 │  Chronological ordering\n├────────────────────────────┤\n│ TOC (Footer)               │  Segment offsets\n└────────────────────────────┘\n```\n\nNo `.wal`, `.lock`, `.shm`, or sidecar files. Ever.\n\nSee [MV2_SPEC.md](MV2_SPEC.md) for the complete file format specification.\n\n\n\n## Support\n\nHave questions or feedback?\nEmail: contact@memvid.com\n\n**Drop a ⭐ to show support**\n\n---\n\n> **Memvid v1 (QR-based memory) is deprecated**\n>\n> If you are referencing QR codes, you are using outdated information.\n>\n> See: https:\u002F\u002Fdocs.memvid.com\u002Fmemvid-v1-deprecation\n\n---\n\n## License\n\nApache License 2.0 — see the [LICENSE](LICENSE) file for details.\n","Memvid 是一个为 AI 代理设计的单文件内存层，旨在提供即时检索和长期记忆功能。它采用 Rust 语言编写，具有持久化、版本控制和可移植性特点，无需依赖数据库即可实现高效的数据存储与检索。Memvid 通过将数据、嵌入、搜索结构和元数据打包到一个文件中，简化了复杂的 RAG（Retrieval-Augmented Generation）流水线，从而使得在离线环境下也能快速访问信息。此项目特别适用于需要高性能且低延迟的信息检索场景，如对话系统、知识库管理和视频处理等应用领域。","2026-06-11 03:03:18","top_language"]