Skip to main content

VantaEmbedded

Struct VantaEmbedded 

Source
pub struct VantaEmbedded { /* private fields */ }
Expand description

Stable embedded database handle used by SDKs and bindings.

Implementations§

Source§

impl VantaEmbedded

Source

pub fn from_engine(engine: Arc<StorageEngine>) -> Self

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn open_with_config(config: VantaConfig) -> Result<Self>

Source

pub fn insert_node(&self, input: VantaNodeInput) -> Result<()>

Source

pub fn get_node(&self, id: u64) -> Result<Option<VantaNodeRecord>>

Source

pub fn delete_node(&self, id: u64, reason: &str) -> Result<()>

Source

pub fn put_batch( &self, inputs: Vec<VantaMemoryInput>, ) -> Result<Vec<VantaMemoryRecord>>

Insert or update multiple namespace-scoped persistent memory records in parallel.

Validates all inputs upfront (fail-fast on invalid namespaces/keys/metadata), then processes the batch in parallel using Rayon for up to 5x throughput improvement over sequential put() calls.

Source

pub fn put(&self, input: VantaMemoryInput) -> Result<VantaMemoryRecord>

Source

pub fn get( &self, namespace: &str, key: &str, ) -> Result<Option<VantaMemoryRecord>>

Source

pub fn delete(&self, namespace: &str, key: &str) -> Result<bool>

Source

pub fn list_namespaces(&self) -> Result<Vec<String>>

Source

pub fn list( &self, namespace: &str, options: VantaMemoryListOptions, ) -> Result<VantaMemoryListPage>

Source

pub fn search( &self, request: VantaMemorySearchRequest, ) -> Result<Vec<VantaMemorySearchHit>>

Source

pub fn rebuild_index(&self) -> Result<VantaIndexRebuildReport>

Source

pub fn compact_layout(&self) -> Result<u64>

Compacta físicamente el archivo de vectores (vector_store.vanta) reescribiendo los nodos en orden BFS desde el entry point del grafo HNSW.

Esta operación reduce drásticamente los page-faults en accesos MMap durante búsquedas semánticas, ya que agrupa los nodos más conectados (hubs y capas superiores del HNSW) en las primeras páginas virtuales del archivo.

Retorna el número de nodos compactados.

Source

pub fn export_namespace( &self, path: impl AsRef<Path>, namespace: &str, ) -> Result<VantaExportReport>

Source

pub fn export_all(&self, path: impl AsRef<Path>) -> Result<VantaExportReport>

Source

pub fn import_records( &self, records: Vec<VantaMemoryRecord>, ) -> Result<VantaImportReport>

Source

pub fn import_file(&self, path: impl AsRef<Path>) -> Result<VantaImportReport>

Source

pub fn audit_text_index( &self, namespace: Option<&str>, ) -> Result<VantaTextIndexAuditReport>

Run a read-only structural audit of the derived persistent text index.

The audit compares postings, BM25 stats, phrase positions, and the state marker against canonical memory records. It never repairs state; callers should use rebuild_index when the report returns passed = false.

Source

pub fn audit_text_index_deep( &self, namespace: Option<&str>, ) -> Result<VantaTextIndexAuditReport>

Run a deep structural audit of the derived persistent text index.

The audit decodes and compares individual fields (TF, positions, DF, doc lengths) across all postings against the canonical memory records.

Source

pub fn repair_text_index(&self) -> Result<VantaTextIndexRepairReport>

Public repair primitive for the text index. Rebuilds all postings, doc stats, term stats, and namespace stats from canonical memory records.

Source

pub fn operational_metrics(&self) -> VantaOperationalMetrics

Source

pub fn search_vector( &self, vector: &[f32], top_k: usize, ) -> Result<Vec<VantaSearchHit>>

K-NN vector search across all nodes via HNSW index.

Complejidad: O(log N) en promedio. Anteriormente era O(N) brute-force.

Source

pub fn flush(&self) -> Result<()>

Flush WAL y archivos memory-mapped a disco para garantizar durabilidad.

Delega al StorageEngine::flush() que sincroniza el backend KV y el archivo de vectores MMap. Antes era un no-op silencioso.

Source

pub fn compact_wal(&self) -> Result<()>

Compact the WAL: flush, archive the current WAL file as vanta.wal.<timestamp>, and start a fresh WAL.

Safe to call at any time. Archived WALs can be removed once no longer needed for crash recovery.

Source

pub fn purge_expired(&self) -> Result<u64>

Scan all memory records and physically delete those whose expires_at_ms deadline has passed. Returns the number of records purged.

Source

pub fn capabilities(&self) -> VantaCapabilities

Return stable runtime capabilities.

Source

pub fn add_edge( &self, source_id: u64, target_id: u64, label: &str, weight: Option<f32>, ) -> Result<()>

Add a directed edge between two nodes.

Source

pub fn close(&self) -> Result<()>

Flush and close the embedded engine handle.

Source

pub fn query(&self, query: &str) -> Result<VantaQueryResult>

Execute an IQL query.

Source

pub fn generate_snippet( &self, payload: &str, text_query: &str, with_highlighting: bool, ) -> Option<String>

Generate a text snippet with optional highlighting of matched terms.

§Arguments
  • payload - The original text content
  • text_query - The search query used to find matches
  • with_highlighting - Whether to add HTML highlighting to matched terms
§Returns
  • Option<String> - The snippet with optional highlighting, or None if no match found
Source

pub fn graph_bfs(&self, roots: &[u64], max_depth: usize) -> Result<Vec<u64>>

Source

pub fn graph_dfs(&self, roots: &[u64], max_depth: usize) -> Result<Vec<u64>>

Source

pub fn graph_topological_sort(&self, roots: &[u64]) -> Result<Vec<u64>>

Source

pub fn graph_is_dag(&self, roots: &[u64]) -> Result<bool>

Trait Implementations§

Source§

impl Clone for VantaEmbedded

Source§

fn clone(&self) -> VantaEmbedded

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more