Expand description
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.
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()?;Structs§
- Collection
- Collection
Config - Collection
Stats - Database
- A database file and the collections it holds.
- Hnsw
Params - HNSW index parameters.
- Recall
Options - Recall
Point - Recall
Report - Record
- A stored record. For cosine collections
vectoris the normalized vector. - Search
Hit - Search
Options - Search
Report - Search results together with the work it took to produce them.
Enums§
- Error
- Filter
- Metadata predicate applied during search.
- Metric
- Distance function of a collection. For every metric, smaller is closer.
- Strategy
- How a query was answered.