VelesDB Server

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
velesdb-server
velesdb-server --port 9000 --data ./my_vectors
RUST_LOG=info velesdb-server
API Reference
Collections
curl -X POST http://localhost:8080/collections \
-H "Content-Type: application/json" \
-d '{"name": "documents", "dimension": 768, "metric": "cosine"}'
curl -X POST http://localhost:8080/collections \
-H "Content-Type: application/json" \
-d '{"name": "compressed", "dimension": 768, "metric": "cosine", "storage_mode": "sq8"}'
curl -X POST http://localhost:8080/collections \
-H "Content-Type: application/json" \
-d '{"name": "fingerprints", "dimension": 256, "metric": "hamming", "storage_mode": "binary"}'
curl http://localhost:8080/collections
curl http://localhost:8080/collections/documents
curl -X DELETE http://localhost:8080/collections/documents
Points (Vectors)
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"}}
]
}'
curl http://localhost:8080/collections/documents/points/1
curl -X DELETE http://localhost:8080/collections/documents/points/1
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"}}
}'
curl -X POST http://localhost:8080/collections/documents/search/text \
-H "Content-Type: application/json" \
-d '{"query": "rust programming", "top_k": 10}'
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
}'
curl -X POST http://localhost:8080/collections/documents/search/batch \
-H "Content-Type: application/json" \
-d '{
"searches": [
{"vector": [0.1, 0.2, ...], "top_k": 5},
{"vector": [0.3, 0.4, ...], "top_k": 5}
]
}'
-H "Content-Type: application/json" \
-d '{
"vectors": [[0.1, 0.2, ...], [0.3, 0.4, ...], [0.5, 0.6, ...]],
"top_k": 10,
"fusion": "rrf",
"fusion_params": {"k": 60}
}'
curl -X POST http://localhost:8080/collections/documents/search/multi \
-H "Content-Type: application/json" \
-d '{
"vectors": [[...], [...], [...]],
"top_k": 10,
"fusion": "weighted",
"fusion_params": {"avgWeight": 0.6, "maxWeight": 0.3, "hitWeight": 0.1}
}'
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, ...]}
}'
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{
"query": "SELECT * FROM documents WHERE content MATCH '\''rust'\'' LIMIT 10",
"params": {}
}'
curl -X POST http://localhost:8080/aggregate \
-H "Content-Type: application/json" \
-d '{
"query": "SELECT category, COUNT(*) FROM documents GROUP BY category",
"params": {}
}'
curl -X POST http://localhost:8080/query/explain \
-H "Content-Type: application/json" \
-d '{
"query": "SELECT * FROM documents WHERE VECTOR NEAR $v LIMIT 5",
"params": {"v": [0.15, 0.25, 0.35, 0.45]}
}'
Graph API
curl http://localhost:8080/collections/documents/graph/edges?label=related
curl -X POST http://localhost:8080/collections/documents/graph/edges \
-H "Content-Type: application/json" \
-d '{"id": 1, "source": 1, "target": 2, "label": "related"}'
curl -X POST http://localhost:8080/collections/documents/graph/traverse \
-H "Content-Type: application/json" \
-d '{"source": 1, "max_depth": 3}'
curl "http://localhost:8080/collections/documents/graph/traverse/stream?start_node=1"
curl http://localhost:8080/collections/documents/graph/nodes/1/degree
Index API
curl http://localhost:8080/collections/documents/indexes
curl -X POST http://localhost:8080/collections/documents/indexes \
-H "Content-Type: application/json" \
-d '{"label": "category", "property": "name"}'
curl -X DELETE http://localhost:8080/collections/documents/indexes/category/name
Health & OpenAPI
curl http://localhost:8080/health
curl http://localhost:8080/api-docs/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: ~93 ns per operation (768d)
- Dot product: ~36 ns per operation (768d)
- Search latency: < 1ms for 100k vectors
- Throughput: 28M+ 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
Elastic License 2.0 (ELv2)
See LICENSE for details.