git-vdb 0.3.0

An embedded vector database backed by immutable Git trees
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use git_vdb::{open, Point};

fn main() -> git_vdb::Result<()> {
    let temporary = tempfile::TempDir::new()?;
    let db = open(temporary.path().join("vectors.git"))?;
    let docs = db.collection("docs");
    docs.upsert([
        Point::new("east", [1.0, 0.0]),
        Point::new("north", [0.0, 1.0]),
    ])?;
    let hits = docs.search([0.9, 0.1], 1)?;
    assert_eq!(hits[0].id.to_string(), "east");
    Ok(())
}