memvid-core 2.0.1

Core library for Memvid v2, a crash-safe, deterministic, single-file AI memory.
Documentation

memvid-core

Core library for Memvid v2 - a crash-safe, deterministic, single-file AI memory system.

Features

  • Single-file format - Everything in one portable .mv2 file with embedded WAL
  • Hybrid search - BM25 lexical + HNSW vector search
  • Crash-safe - Automatic recovery from failures
  • Deterministic - Same inputs produce identical outputs
  • Time-indexed - Chronological document navigation

Installation

[dependencies]
memvid-core = "2.0.1"

Quick Start

use memvid_core::{Memvid, MemvidResult};

fn main() -> MemvidResult<()> {
    // Create a new memory file
    let mut mem = Memvid::create("knowledge.mv2")?;

    // Add content
    mem.put_text("Hello, Memvid!")?;

    // Search
    let results = mem.find("hello", 5)?;
    for result in results {
        println!("{}: {}", result.score, result.snippet);
    }

    // Seal when done
    mem.seal()?;

    Ok(())
}

Feature Flags

Feature Default Description
lex Yes Tantivy-based lexical search (BM25)
vec No HNSW vector search with ONNX embeddings
temporal_track No Natural language time queries
parallel_segments No Multi-threaded ingestion
pdfium No PDF rendering with Pdfium

Enable features in your Cargo.toml:

[dependencies]
memvid-core = { version = "2.0.1", features = ["lex", "vec", "parallel_segments"] }

Logging

memvid-core uses the log and tracing crates. Set up a subscriber in your application:

// Using env_logger
env_logger::Builder::from_env(
    env_logger::Env::default().default_filter_or("warn")
).init();

// Or using tracing
tracing_subscriber::fmt()
    .with_env_filter("memvid_core=warn")
    .init();

Recommended log levels:

  • error - Production (critical failures only)
  • warn - Production with warnings
  • info - Development
  • debug/trace - Debugging

Documentation

License

Licensed under either of:

at your option.