#221·memvid

[BUG] The Readme file is outdated i believe

Author: durationextenderCreated Apr 9, 2026Updated Apr 9, 2026
Labelsbug

Bug Description

The Quick Start example in the README fails to compile. The example uses the record update syntax ..Default::default() for the SearchRequest struct, but SearchRequest does not implement the Default trait in memvid-core v2.0.83 that am using, but this may be a stupid mistake from me, so i may be wrong! i am still new to this project.

Steps to Reproduce

  1. Create a new Rust project (cargo new memvid-test). 2.Add memvid-core = "2.0" to Cargo.toml. 3.Copy the Quick Start code from the README into src/main.rs.

Run cargo check.

Expected Behavior

The project should compile successfully as the SearchRequest struct should have a Default implementation.

Actual Behavior

The compiler throws error E0277: the trait bound SearchRequest: Default is not satisfied.

Environment

  • OS: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
  • Rust Version: rustc 1.93.1
  • Memvid Version: "2.0.139"
  • Features Enabled: ["lex", "vec", "temporal_track"] but also tried with no features enabled.

Minimal Reproducible Example

rust
use memvid_core::{Memvid, PutOptions, SearchRequest};

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

    // Add documents with metadata
    let opts = PutOptions::builder()
        .title("Meeting Notes")
        .uri("mv2://meetings/2024-01-15")
        .tag("project", "alpha")
        .build();
    mem.put_bytes_with_options(b"Q4 planning discussion...", opts)?;
    mem.commit()?;

    // Search
    let response = mem.search(SearchRequest {
        query: "planning".into(),
        top_k: 10,
        snippet_chars: 200,
        ..Default::default()
    })?;

    for hit in response.hits {
        println!("{}: {}", hit.title.unwrap_or_default(), hit.text);
    }

    Ok(())
}

Error Output

error[E0277]: the trait bound `SearchRequest: Default` is not satisfied                                                                            
  --> src\main.rs:21:11
   |
21 |         ..Default::default()
   |           ^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `SearchRequest`

For more information about this error, try `rustc --explain E0277`.                                                                                

Additional Context

Any other context about the problem (screenshots, logs, etc.)

Checklist

  • I have searched existing issues for duplicates
  • I have tested with the latest version
  • I can reproduce this consistently