index_new: Create a New Vector Index

View source: R/index.R

index_newR Documentation

Create a New Vector Index

Description

Creates or loads a vector index at the specified path.

Usage

index_new(dim, path)

Arguments

dim

Integer. The dimensionality of vectors to be stored.

path

Character. Directory path where the index will be stored. Will create index.usearch and meta.rds files in this directory.

Value

An object of class usearchlite_index containing the index state.

Examples

tmp <- tempfile()
dir.create(tmp)
idx <- index_new(3L, tmp)
unlink(tmp, recursive = TRUE)

usearchlite documentation built on Feb. 13, 2026, 1:06 a.m.