1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Recern Vector — a single-file, embedded, inspectable vector database.
//!
//! A database is one file holding any number of collections. Each collection
//! stores vectors of a fixed dimension, optional JSON metadata, and an HNSW
//! index whose internals can be inspected through [`Collection::stats`],
//! [`Collection::explain`] and [`Collection::estimate_recall`].
//!
//! ```no_run
//! use recern_vector::{CollectionConfig, Database, Metric, SearchOptions};
//!
//! let mut db = Database::open_or_create("docs.rvec")?;
//! let docs = db.create_collection("docs", CollectionConfig::new(3, Metric::Cosine))?;
//! docs.upsert("a", &[0.1, 0.9, 0.0], None)?;
//! docs.upsert("b", &[0.8, 0.1, 0.1], None)?;
//! let hits = docs.search(&[0.2, 0.8, 0.0], 1, &SearchOptions::default())?;
//! assert_eq!(hits[0].id, "a");
//! db.save()?;
//! # Ok::<(), recern_vector::Error>(())
//! ```
pub use ;
pub use Database;
pub use ;
pub use Filter;
pub use HnswParams;
pub use Metric;
pub use FORMAT_VERSION;