Skip to main content

Crate git_vdb

Crate git_vdb 

Source
Expand description

A local vector database stored entirely in Git.

The common path opens one directory, selects a collection, writes points, and searches. A missing database and collection are created on first write, and vector dimensions are inferred from that write.

use git_vdb::{open, Point};

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");

Use Store and CollectionHandle for ordinary embedded use. Use Database and Collection for explicitly configured collections, filters, detailed query statistics, history, and compare-and-swap writes. Use SnapshotEngine when another system owns naming and persistence.

Equivalent configuration and points produce the same canonical Git root, independent of insertion order, repository path, history, or timestamps. The crate’s semantic version and persisted format version are separate compatibility boundaries; new roots use format version 2 and format-version-1 roots remain readable and mutable.

Re-exports§

pub use adapter::Collection;
pub use adapter::Database;
pub use model::CollectionConfig;
pub use model::CollectionInfo;
pub use model::Condition;
pub use model::CountResult;
pub use model::DeleteSelector;
pub use model::DiffResult;
pub use model::Distance;
pub use model::Filter;
pub use model::GetRequest;
pub use model::GetResult;
pub use model::HistoryEntry;
pub use model::IndexConfig;
pub use model::JsonObject;
pub use model::MatchValue;
pub use model::MutationResult;
pub use model::ObjectId;
pub use model::ObjectStats;
pub use model::Point;
pub use model::PointId;
pub use model::Query;
pub use model::QueryMode;
pub use model::QueryParams;
pub use model::QueryResult;
pub use model::QueryStats;
pub use model::Range;
pub use model::Record;
pub use model::ScoredPoint;
pub use model::SnapshotInfo;
pub use model::SnapshotMutation;
pub use model::ValidationReport;
pub use model::WriteResult;
pub use snapshot::Snapshot;
pub use snapshot::SnapshotEngine;
pub use text::Document;
pub use text::DocumentHit;
pub use text::Embedder;
pub use text::TextCollection;
pub use text::TextQuery;
pub use text::FastEmbedder;

Modules§

adapter
Named collections backed by Git commits and compare-and-swap refs.
format
The normative persisted format-version-2 specification.
format_v1
The legacy persisted format-version-1 specification.
guides
Task-oriented guides whose Rust examples are checked as doctests.
model
Public request, response, configuration, filtering, and mutation types.
snapshot
Ref-free immutable snapshot construction, mutation, query, and validation.
snapshots
Design notes for immutable root snapshots and named collection history.
text
Provider-independent document embedding and text search.

Structs§

CollectionHandle
A named collection that is created with an inferred dimension on first use.
Store
A persistent embedded vector database with lazy collection handles.

Enums§

Error
An error returned by a git-vdb operation.
FastEmbedModel

Functions§

open
Opens or creates a persistent embedded vector database.

Type Aliases§

FastEmbedInitOptions
Options for initializing the TextEmbedding model
Result
The result type returned by git-vdb operations.