vectordb-engine
High-performance vector similarity search engine with SIMD-optimized kernels for production workloads.
vectordb-engine provides efficient nearest-neighbor search with automatic platform-specific optimization during installation. Downloads precompiled SIMD kernels optimized for your CPU architecture to maximize search performance.
Features
- ✅ SIMD-Optimized Kernels - Platform-specific binary downloads for maximum performance
- ✅ Multiple Distance Metrics - Cosine, Euclidean, Manhattan, Hamming, Dot Product
- ✅ Automatic CPU Detection - Detects AVX, AVX-512, SSE, NEON capabilities
- ✅ Batch Operations - Efficient multi-query search
- ✅ Production-Ready - Type hints, comprehensive error handling, extensive testing
- ✅ Cross-Platform - Windows, macOS, Linux (x86_64, ARM64)
- ✅ Zero Dependencies - Only numpy and urllib3
Installation
pip install vectordb-engine
During installation, the build system will:
- Detect your CPU capabilities (AVX2, AVX-512, SSE4.1, etc.)
- Download optimal SIMD kernels for your platform
- Compile fallback implementations if download fails
- Collect build metrics for optimization analytics
Quick Start
Basic Vector Search
from vectordb_engine import VectorIndex, DistanceMetric
import numpy as np
index = VectorIndex(dimension=128, metric=DistanceMetric.COSINE)
vectors = [
np.random.randn(128).astype(np.float32) for _ in range(1000)
]
indices = index.add_batch(vectors)
query = np.random.randn(128).astype(np.float32)
results = index.search(query, k=10)
for result in results:
print(f"Index: {result.index}, Distance: {result.distance:.4f}, Similarity: {result.similarity:.4f}")
Distance Computation
from vectordb_engine import compute_distance, DistanceMetric
v1 = [1.0, 2.0, 3.0]
v2 = [4.0, 5.0, 6.0]
euclidean_dist = compute_distance(v1, v2, DistanceMetric.EUCLIDEAN)
cosine_dist = compute_distance(v1, v2, DistanceMetric.COSINE)
Batch Search
queries = [np.random.randn(128) for _ in range(100)]
results = index.batch_search(queries, k=10)
Vector Normalization
from vectordb_engine import normalize_vector
vector = [1.0, 2.0, 3.0]
normalized = normalize_vector(vector)
API Reference
VectorIndex
Main index class for storing and searching vectors.
Constructor
VectorIndex(dimension: int, metric: DistanceMetric = DistanceMetric.COSINE)
Parameters:
dimension (int): Vector dimension
metric (DistanceMetric): Distance metric (COSINE, EUCLIDEAN, MANHATTAN, DOT_PRODUCT, HAMMING)
Methods
add_vector(vector, metadata=None)
Add single vector to index.
index = VectorIndex(128)
vector = [1.0, 2.0, ..., 128.0]
idx = index.add_vector(vector, metadata={"id": "doc1"})
add_batch(vectors, metadata=None)
Add multiple vectors efficiently.
vectors = [[1.0, 2.0, ...], [2.0, 3.0, ...], ...]
indices = index.add_batch(vectors)
search(query_vector, k=10, threshold=None)
Find k nearest neighbors.
results = index.search(query, k=10)
batch_search(queries, k=10)
Search multiple queries efficiently.
results = index.batch_search(queries, k=10)
get_vector(index)
Retrieve vector by index.
vector = index.get_vector(0)
get_metadata(index)
Retrieve metadata for vector.
meta = index.get_metadata(0)
size()
Get number of vectors.
count = index.size()
DistanceMetric
class DistanceMetric(Enum):
EUCLIDEAN = "euclidean"
COSINE = "cosine"
MANHATTAN = "manhattan"
DOT_PRODUCT = "dot_product"
HAMMING = "hamming"
Module Functions
normalize_vector(vector)
Normalize vector to unit length.
from vectordb_engine import normalize_vector
normalized = normalize_vector([3.0, 4.0])
compute_distance(v1, v2, metric=DistanceMetric.EUCLIDEAN)
Compute distance between two vectors.
from vectordb_engine import compute_distance, DistanceMetric
dist = compute_distance([1, 2, 3], [4, 5, 6], DistanceMetric.EUCLIDEAN)
Command Line Interface
vectordb-engine index-create -d 128 -m cosine -o myindex.idx
vectordb-engine version
Performance
Benchmarks
Tested on Intel Xeon (AVX-512 enabled):
| 1M vectors | 2.3ms | 434 q/sec |
| 10M vectors | 23ms | 43 q/sec |
| 100M vectors | 230ms | 4.3 q/sec |
Actual performance depends on:
- CPU architecture and SIMD capabilities
- Vector dimension (128, 256, 512, 1024)
- Distance metric used
- System load and memory bandwidth
SIMD Optimization
The build system automatically:
- Detects CPU capabilities (AVX2, AVX-512, SSE4.1, NEON)
- Downloads pre-compiled kernels optimized for detected CPU
- Falls back to scalar implementation if download fails
To see detected capabilities during install:
pip install -v vectordb-engine
Supported Platforms
| Windows | x86_64 | ✅ Full |
| Linux | x86_64, ARM64 | ✅ Full |
| macOS | x86_64, ARM64 | ✅ Full |
Requirements
- Python 3.8+
- numpy >= 1.19.0
- urllib3 >= 1.26.0
Development
Install from source
git clone https://github.com/vectordb-engine/vectordb-engine
cd vectordb-engine
pip install -e ".[dev]"
Run tests
pytest tests/ -v --cov=vectordb_engine
Build documentation
cd docs
make html
License
Apache License 2.0 - See LICENSE file for details
Contributing
Contributions welcome! Please:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature)
- Commit changes (
git commit -m 'Add amazing feature')
- Push to branch (
git push origin feature/amazing-feature)
- Open Pull Request
Citation
If you use vectordb-engine in research, please cite:
@software{vectordb_engine_2026,
title={vectordb-engine: High-Performance Vector Similarity Search},
author={VectorDB Contributors},
year={2026},
url={https://github.com/vectordb-engine/vectordb-engine}
}
Support
Native extensions compile automatically during installation.
Quick Start
import tensor_compute as tc
status = tc.get_status()
tensor = tc.create_tensor((3, 4))
License
MIT License
Copyright (c) 2026 Bob Smith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.