velesdb-server 0.3.5

REST API server for VelesDB vector database
docs.rs failed to build velesdb-server-0.3.5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

VelesDB Server

Crates.io License

REST API server for VelesDB - a high-performance vector database.

Installation

From crates.io

cargo install velesdb-server

Docker

docker run -p 8080:8080 -v ./data:/data ghcr.io/cyberlife-coder/velesdb:latest

From source

git clone https://github.com/cyberlife-coder/VelesDB
cd VelesDB
cargo build --release -p velesdb-server

Usage

# Start server on default port 8080
velesdb-server

# Custom port and data directory
velesdb-server --port 9000 --data ./my_vectors

# With logging
RUST_LOG=info velesdb-server

API Reference

Collections

# Create collection
curl -X POST http://localhost:8080/collections \
  -H "Content-Type: application/json" \
  -d '{"name": "documents", "dimension": 768, "metric": "cosine"}'

# List collections
curl http://localhost:8080/collections

# Get collection info
curl http://localhost:8080/collections/documents

# Delete collection
curl -X DELETE http://localhost:8080/collections/documents

Points (Vectors)

# Upsert points
curl -X POST http://localhost:8080/collections/documents/points \
  -H "Content-Type: application/json" \
  -d '{
    "points": [
      {"id": 1, "vector": [0.1, 0.2, ...], "payload": {"title": "Hello"}}
    ]
  }'

# Get points by IDs
curl -X POST http://localhost:8080/collections/documents/points/get \
  -d '{"ids": [1, 2, 3]}'

# Delete points
curl -X DELETE http://localhost:8080/collections/documents/points \
  -d '{"ids": [1, 2, 3]}'

Search

# Vector similarity search
curl -X POST http://localhost:8080/collections/documents/search \
  -H "Content-Type: application/json" \
  -d '{
    "vector": [0.15, 0.25, ...],
    "top_k": 5,
    "filter": {"category": {"$eq": "tech"}}
  }'

# BM25 full-text search
curl -X POST http://localhost:8080/collections/documents/search/text \
  -H "Content-Type: application/json" \
  -d '{"query": "rust programming", "top_k": 10}'

# Hybrid search (vector + text)
curl -X POST http://localhost:8080/collections/documents/search/hybrid \
  -H "Content-Type: application/json" \
  -d '{
    "vector": [0.15, 0.25, ...],
    "query": "rust programming",
    "top_k": 10,
    "vector_weight": 0.7
  }'

# VelesQL query
curl -X POST http://localhost:8080/query \
  -H "Content-Type: application/json" \
  -d '{
    "query": "SELECT * FROM documents WHERE VECTOR NEAR $v LIMIT 5",
    "params": {"v": [0.15, 0.25, ...]}
  }'

# VelesQL with MATCH (full-text)
curl -X POST http://localhost:8080/query \
  -H "Content-Type: application/json" \
  -d '{
    "query": "SELECT * FROM documents WHERE content MATCH '\''rust'\'' LIMIT 10",
    "params": {}
  }'

Health & Info

# Health check
curl http://localhost:8080/health

# Server info
curl http://localhost:8080/info

# OpenAPI spec
curl http://localhost:8080/openapi.json

Distance Metrics

Metric API Value Use Case
Cosine cosine Text embeddings
Euclidean euclidean Spatial data
Dot Product dot Pre-normalized vectors
Hamming hamming Binary vectors
Jaccard jaccard Set similarity

Performance

  • Cosine similarity: ~76 ns per operation (768d)
  • Search latency: < 1ms for 100k vectors
  • Throughput: 13M+ distance calculations/sec

Configuration

Environment Variable Default Description
VELESDB_PORT 8080 Server port
VELESDB_HOST 0.0.0.0 Bind address
VELESDB_DATA_DIR ./data Data directory
RUST_LOG warn Log level

License

Business Source License 1.1 (BSL-1.1)

See LICENSE for details.