Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

vectordb-engine

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vectordb-engine

High-performance vector similarity search with SIMD-optimized kernels

pipPyPI
Version
1.0.0
Maintainers
0

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

from vectordb_engine import VectorIndex, DistanceMetric
import numpy as np

# Create index for 128-dimensional vectors
index = VectorIndex(dimension=128, metric=DistanceMetric.COSINE)

# Add vectors
vectors = [
    np.random.randn(128).astype(np.float32) for _ in range(1000)
]
indices = index.add_batch(vectors)

# Search
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)
queries = [np.random.randn(128) for _ in range(100)]
results = index.batch_search(queries, k=10)

# results is list of lists, each containing top-10 neighbors

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)
# Returns List[SearchResult]
# SearchResult.index: int (vector index)
# SearchResult.distance: float (raw distance)
# SearchResult.similarity: float (normalized 0-1)

batch_search(queries, k=10)

Search multiple queries efficiently.

results = index.batch_search(queries, k=10)
# Returns List[List[SearchResult]]

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"       # L2 distance
    COSINE = "cosine"             # Cosine distance (1 - similarity)
    MANHATTAN = "manhattan"       # L1 distance
    DOT_PRODUCT = "dot_product"   # Negative dot product
    HAMMING = "hamming"           # Hamming distance (binary vectors)

Module Functions

normalize_vector(vector)

Normalize vector to unit length.

from vectordb_engine import normalize_vector
normalized = normalize_vector([3.0, 4.0])  # Returns [0.6, 0.8]

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

# Create index
vectordb-engine index-create -d 128 -m cosine -o myindex.idx

# Show version
vectordb-engine version

Performance

Benchmarks

Tested on Intel Xeon (AVX-512 enabled):

Dataset SizeQuery TimeThroughput
1M vectors2.3ms434 q/sec
10M vectors23ms43 q/sec
100M vectors230ms4.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

PlatformArchitecturesSupport
Windowsx86_64✅ Full
Linuxx86_64, ARM64✅ Full
macOSx86_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

  • 📖 Documentation
  • 🐛 Issue Tracker
  • 💬 Discussions
  • 📧 support@vectordb-engine.io

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.

Keywords

vector

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts