Skip to main content

High-performance AI memory library with full-text and semantic search (Rust bindings for memvid v2)

Project description

memvid-rs (Python Bindings)

🇰🇷 한국어 (Korean) PyPI version

Memvid-rs provides high-performance Python bindings for memvid-core v2, the engine behind the memvid ecosystem. It is a crash-safe, single-file AI memory designed for RAG and long-term agent memory.

Attribution: This project wraps memvid-core with PyO3 bindings. API is designed to be compatible with memvid-sdk.

🚀 Key Features

  • Single-File Memory: All data (text, index, metadata) stored in portable .mv2 format.
  • Full-Text & RAG: BM25 ranking via embedded Tantivy index with built-in RAG (ask) support.
  • Extreme Performance: Rust-core ensures sub-millisecond lookups and efficient batch ingestion.
  • Crash-Safe: WAL-based append-only architecture protects your data.
  • Compatibility: Drop-in replacement for memvid-sdk Python users needing more speed.

📦 Installation

pip install memvid-rs

💻 Quick Start

from memvid_rs import use

# Use 'auto' mode to create or open memory
with use("ai_agent", "data.mv2", mode="auto") as mv:
    # Add document with metadata and auto-indexing
    mv.put(
        text="Memvid-RS is a ultra-fast Rust implementation.",
        title="Performance Note",
        label="tech",
        tags=["rust", "fast"]
    )
    
    # Batch ingestion (100x faster than individual put)
    mv.put_many([
        {"text": "Sample doc 1", "title": "Doc 1"},
        {"text": "Sample doc 2", "title": "Doc 2"},
    ])
    
    mv.commit()
    
    # Full-text search
    results = mv.find("rust implementation", k=5)
    print(f"Search results: {results['hits']}")
    
    # RAG Question Answering
    answer = mv.ask("What is Memvid-RS?")
    print(f"AI Answer: {answer['answer']}")

🔧 API Reference

Top-level Functions

  • use(profile, path, mode="auto", read_only=False): Flexible entry point.
  • create(path, capacity_gb=1): Create new memory.
  • open(path): Open existing memory.

Memory / MemvidMemory Methods

Method Description
put(text, title, ...) Insert document with metadata
put_many([docs]) Batch insert multiple documents
find(query, k) Full-text search (BM25)
ask(question, k) RAG-based question answering
append(text) Low-level text append
commit() / seal() Flush writes to disk
stats() Get frame count and size in bytes
timeline(limit) Retrieve recent documents

⚠️ Breaking Changes from v1

  • QR video encoding removed - v2 uses binary .mv2 format for 1000x better density.
  • API redesigned - Now follows the memvid-sdk v2 patterns.

📄 License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memvid_rs-2.1.0.tar.gz (263.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memvid_rs-2.1.0-cp38-abi3-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file memvid_rs-2.1.0.tar.gz.

File metadata

  • Download URL: memvid_rs-2.1.0.tar.gz
  • Upload date:
  • Size: 263.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.4

File hashes

Hashes for memvid_rs-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f59d1c4ea881d3e877f79af7ac05658c45107e8c5dc57b83920e073c4730e3ea
MD5 2e1f61a779a1f7c4e60abbdbe9eb518a
BLAKE2b-256 78ca8069e8979a99150f49678df85bb55864e6e0e43274c9651f5f85159a878d

See more details on using hashes here.

File details

Details for the file memvid_rs-2.1.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for memvid_rs-2.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39e55179e368de365dbb24ff20c6a1319b44f63e7e7a32a34a00b15a27a08a00
MD5 38a936eb012154572b0ff2ebaa7e8c33
BLAKE2b-256 3395bbe306b63189f8813ae438a9a5f5632f50d1d94d5bad04ad7c15e9f5efba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page