High-performance vector database with auto-tuning capabilities
Project description
VecminDB
A high-performance vector database with multiple index algorithms, optimizers, and auto-tuning capabilities.
Features
- Multiple Index Algorithms: HNSW, IVF, PQ, LSH, VPTree, ANNOY, NGT, and more
- Multi-Objective Optimization: NSGA-II, MOEAD, MOPSO for index tuning
- Auto-Tuning: Automatic parameter optimization for best performance
- Parallel Processing: Built-in support for parallel vector operations
- Flexible Storage: Sled-based persistent storage with transaction support
- Caching System: Multi-tier caching with Redis support
- Resource Management: Intelligent memory and CPU resource allocation
- Monitoring: Built-in performance metrics and query statistics
- Multi-Language Support: First-class support for Rust and Python, plus HTTP API
Quick Start
As a Library
use vecmindb::{VectorDB, IndexType, SimilarityMetric};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new vector database
let db = VectorDB::new("./data")?;
// Create a collection with 128-dimensional vectors using HNSW index
let collection = db.create_collection("my_vectors", 128, IndexType::HNSW)?;
// Add vectors (collection is Arc<RwLock<VectorCollection>>)
// Note: RwLock is from tokio::sync, so we use .await for lock acquisition
{
let mut coll = collection.write().await;
coll.add_vector("vec1", &vec![0.1; 128], None).await?;
coll.add_vector("vec2", &vec![0.2; 128], None).await?;
}
// Search for similar vectors
let results = {
let coll = collection.read().await;
coll.search(
&vec![0.15; 128],
10,
SimilarityMetric::Cosine
).await?
};
for result in results {
println!("ID: {}, Score: {}", result.id, result.score);
}
Ok(())
}
As an HTTP Server
# Start the server
cargo run --bin vecmindb-server --features http-server
# Create a collection
curl -X POST http://localhost:8080/api/v1/collections \
-H "Content-Type: application/json" \
-d '{"name": "my_vectors", "dimension": 128, "index_type": "HNSW"}'
# Add a vector
curl -X POST http://localhost:8080/api/v1/collections/my_vectors/vectors \
-H "Content-Type: application/json" \
-d '{"id": "vec1", "values": [0.1, 0.2, ...], "metadata": {}}'
# Search vectors
curl -X POST http://localhost:8080/api/v1/collections/my_vectors/search \
-H "Content-Type: application/json" \
-d '{"query": [0.15, 0.25, ...], "top_k": 10, "metric": "cosine"}'
🐳 Docker Deployment
Run VecminDB in seconds with Docker:
# Using Docker Compose (Recommended)
docker-compose up -d
# Using Docker CLI
docker build -t vecmindb .
docker run -p 8080:8080 -v ./data:/data vecmindb
Installation
Add this to your Cargo.toml:
[dependencies]
vecmindb = "0.1"
# Optional features
vecmindb = { version = "0.1", features = ["http-server", "distributed"] }
Python Bindings 🐍
To use VecminDB in Python, please install from source (until v0.1.0 is on PyPI):
pip install maturin
cd bindings/python
maturin develop --release
See INSTALL_PYTHON.md for details.
Supported Index Types
- HNSW: Hierarchical Navigable Small World graphs
- IVF: Inverted File Index
- PQ: Product Quantization
- LSH: Locality-Sensitive Hashing
- VPTree: Vantage-Point Tree
- ANNOY: Approximate Nearest Neighbors Oh Yeah
- NGT: Neighborhood Graph and Tree
- Flat: Brute-force exact search
Performance
VecminDB is designed for high performance:
- Parallel vector operations using Rayon
- SIMD optimizations (optional)
- Efficient memory management
- Smart caching strategies
- Auto-tuning for optimal parameters
Documentation
For detailed documentation, see:
🐍 Python Bindings
VecminDB is available on PyPI!
pip install vecmindb
👉 Quick Start Guide - Get started in 5 minutes. 📚 Build from Source - Instructions for development.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vecmindb-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: vecmindb-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebdc38e3c1c20eb2d8da62468991d2f0b6d76f20058f890fa17db753189c53e9
|
|
| MD5 |
e7a5442190a1ba808858d03e554c2f6b
|
|
| BLAKE2b-256 |
4b9795c822bc08e21a34b6d804d7cb180e034aca1b8cc3df1361d27b6d9dd3b8
|