denselinkage.indexing.NumpySearchableIndex

class denselinkage.indexing.NumpySearchableIndex(vectors: Any, ids: Sequence[str])[source]

Bases: SearchableIndex

Immutable artifact built by NumpyFlatIndex — exhaustive (flat) nearest-neighbour search by inner product (which equals cosine for the L2-normalized vectors the reference embedder produces).

property vectors: Any

The indexed vectors (float32, n_records x embedding_dim), as a read-only view — this artifact is immutable.

property ids: Sequence[str]

Record ids aligned positionally with vectors (read-only).

extended(vectors: Any, ids: Sequence[str]) NumpySearchableIndex[source]

Return a NEW artifact holding this index’s vectors plus vectors; this instance is left unchanged (the immutable-artifact guarantee). ids align positionally with vectors and must be disjoint from the ids already indexed; vectors must match the indexed width or DimensionMismatch is raised.

Incremental indexing is out of scope for v1, so the v1 reference artifacts raise NotImplementedError rather than returning None; the signature is fixed pre-freeze so the capability can land later without a breaking change.