6 releases (3 breaking)

new 0.4.1 May 9, 2024
0.4.0 May 3, 2024
0.3.1 Mar 10, 2024
0.3.0 Feb 20, 2024
0.1.0 Feb 19, 2024

#266 in Database implementations

Download history 274/week @ 2024-02-16 153/week @ 2024-02-23 69/week @ 2024-03-01 219/week @ 2024-03-08 26/week @ 2024-03-15 3/week @ 2024-03-22 16/week @ 2024-03-29 16/week @ 2024-04-05 144/week @ 2024-04-12 18/week @ 2024-04-19 5/week @ 2024-04-26 252/week @ 2024-05-03

424 downloads per month

Apache-2.0/MIT

12KB
240 lines

Vector Package Documentation Build

The package provides a vector database allowing for efficient search of nearest neighbors.

Example

use vector::Index;

let vectors = vec![
    [4.0, 2.0],
    [5.0, 7.0],
    [2.0, 9.0],
    [7.0, 8.0],
];
let index = Index::build(&vectors, 1, 1, 42);

let query = [5.0, 5.0];
let (indices, distances): (Vec<_>, Vec<_>) = index
    .search(&vectors, &query, 2)
    .into_iter()
    .unzip();
assert_eq!(indices, &[1, 0]);

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.

Dependencies

~7KB