EdgeVectorDB is an AI-native database MVP built in Rust, optimized for edge computing use cases. It leverages SQLite as its base and provides capabilities for local vector search, low-latency inference data caching, and offline semantic retrieval.
- Language: Rust
- Base: SQLite (via
rusqlite
) - Vector Storage: Supports vector data column type with distance metrics (cosine, Euclidean, dot-product).
- Hybrid Query Engine: Designed for hybrid SQL + semantic queries.
- API: gRPC and REST API for basic operations (insert, search, delete).
- Edge Optimizations:
- Offline embedding with ONNX inference.
- SQLite WAL + async batching for edge write durability.
- Optimized binary size with
strip
,lto
,musl
compile. - Static binaries for ARM64, x86_64.
- Flat file export/import (
.edgevec
format).
- CLI Tool: Command-line interface for interacting with the database.
core/
: Contains the core logic for storage, vector indexing, embedding, and query parsing.api/
: Implements the gRPC and HTTP API layers.bindings/
: (Future) Optional Python bindings.cli/
: Provides a local CLI tool for interacting with EdgeVectorDB.
- Rust (latest stable version)
build-essential
(for SQLite compilation)protobuf-compiler
(for gRPC)cmake
andclang
(for ONNX runtime)libssl-dev
(for ONNX runtime)gcc-aarch64-linux-gnu
andg++-aarch64-linux-gnu
(for ARM64 cross-compilation)
To build the project, navigate to the EdgeVectorDB
directory and run:
cargo build --release
This will build the api
and cli
binaries in target/release/
.
To run the gRPC and REST API server:
./target/release/api
The gRPC server will listen on [::1]:50051
and the REST server on 127.0.0.1:3000
.
Insert Data:
./target/release/cli insert --file <path_to_data_file> --db <database_file>
Example data file (sample_data.txt
):
1.0,2.0,3.0
4.0,5.0,6.0
7.0,8.0,9.0
Query Data:
./target/release/cli query "<comma_separated_vector>" --k <num_results> --db <database_file>
Export Data:
./target/release/cli export --output <output_file.edgevec> --db <database_file>
Import Data:
./target/release/cli import --input <input_file.edgevec> --db <database_file>
A simple demo script demo.sh
is provided to showcase the CLI tool's functionality:
./demo.sh
This script will:
- Build the CLI tool.
- Insert sample data from
sample_data.txt
intodemo.db
. - Query for similar vectors.
- Export the database to
demo.edgevec
.
A Dockerfile
is provided for building multi-architecture Docker images:
docker build -t edgevectordb .
(To be added)