denselinkage.indexing.NumpySearchableIndex¶
- class denselinkage.indexing.NumpySearchableIndex(vectors: Any, ids: Sequence[str])[source]¶
Bases:
SearchableIndexImmutable 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.
- 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).idsalign positionally withvectorsand must be disjoint from the ids already indexed;vectorsmust match the indexed width orDimensionMismatchis raised.Incremental indexing is out of scope for v1, so the v1 reference artifacts raise
NotImplementedErrorrather than returningNone; the signature is fixed pre-freeze so the capability can land later without a breaking change.