Skip to content

Python library · 0.7.0

Vector search, without the infrastructure.

Exact, in-process vector search powered by NumPy.

Keep embeddings and metadata in your Python process. Bring your own model; search by cosine similarity, dot product, or Euclidean distance.

Made for small-to-medium collections in memory. Every search scores every selected row, with no approximate index or background service.

Install

uv add numpy-vector-store
python -m pip install numpy-vector-store

Python 3.11+ · NumPy 1.23.2+ · Installation details

Use small vectors to see the complete workflow. Replace them with embeddings from your model when you integrate the library.

from numpy_vector_store import VectorStore

store = VectorStore[str](dimensions=3)
store.add(
    [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]],
    ["x-axis", "y-axis", "z-axis"],
)

for hit in store.cosine_search([0.9, 0.1, 0.0], top_k=2):
    print(f"{hit.metadata}: {hit.value:.3f}")
x-axis: 0.994
y-axis: 0.110

Each result is a VectorHit with the original row index, the metric value, and your metadata payload. Vectors are stored as float32 and normalized by default. Choose normalize=False when magnitude matters.

Keep going

Task Where to go
Work with embeddings and typed metadata Getting started
Choose a metric or restrict the candidate rows Search and filtering
Save, open, or refresh a local archive Persistence
Look up a signature API reference
Size a collection for your workload Performance and practical limits

The package is pre-1.0. Version 0.7 publishes the contract intended for 1.0; it does not yet make a 1.x stability commitment. Read the compatibility policy before adopting it.