High-Performance In-Memory Vector Database Built in Rust
RedVector is an in-memory vector database that combines Redis compatibility with advanced vector search capabilities. Built on a Redis-compatible server (rsedis-style) and the Redisearch platform, it delivers predictable low-latency performance for AI applications, semantic search, RAG pipelines, and recommendation systems.
Built on:
- Redis-Compatible Server: Full Redis protocol implementation in Rust (150+ commands)
- Redisearch Platform: Vector search engine with HNSW indexing, GPU acceleration, and multi-vector support
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β RedVector = In-Memory Vector DB + Redis Protocol + REST/gRPC APIs β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Strings β β Vectors β β REST API β β gRPC API β β
β β Lists β β HNSW β β Port 8888 β β Port 50051 β β
β β Sets β β Cosine β β JSON β β Protobuf β β
β β Hashes β β Euclidean β β Qdrant- β β Qdrant- β β
β βββββββββββββββ βββββββββββββββ βββcompatibleββ βββcompatibleββ β
β β
β ONE SERVER β’ 50+ CLIENT LANGUAGES β’ THREE PROTOCOLS β’ IN-MEMORY β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- In-Memory Storage: All data and vectors stored in RAM for ultra-low latency
- HNSW Index: Hierarchical Navigable Small World graph for fast approximate nearest neighbor search
- Multiple Distance Metrics:
- Cosine Similarity
- Euclidean Distance
- Inner Product
- High-Dimensional Vectors: Support for vectors of any dimension
- Real-Time Updates: Add, update, and delete vectors with instant index updates
- Batch Operations: Efficient bulk insert and update operations
- 150+ Redis Commands: Full compatibility with Redis protocol (port 6379)
- Data Structures:
- Strings: GET, SET, MGET, MSET, INCR, DECR, APPEND, GETSET, STRLEN
- Lists: LPUSH, RPUSH, LPOP, RPOP, LRANGE, LINDEX, LLEN, LTRIM
- Sets: SADD, SREM, SMEMBERS, SINTER, SUNION, SDIFF, SCARD, SISMEMBER
- Hashes: HSET, HGET, HMSET, HGETALL, HDEL, HKEYS, HVALS, HLEN
- Sorted Sets: ZADD, ZRANGE, ZRANK, ZSCORE, ZREM, ZCARD, ZCOUNT
- Pub/Sub: SUBSCRIBE, PUBLISH, PSUBSCRIBE, UNSUBSCRIBE
- Transactions: MULTI, EXEC, DISCARD, WATCH for atomic operations
- Persistence: RDB snapshots and AOF (Append-Only File) for data durability
Built on Redisearch Platform Core with HNSW indexing:
- FT.CREATE: Create vector indexes with configurable HNSW parameters (m, ef_construction)
- FT.ADD: Add documents with vector embeddings to the index
- FT.SEARCH: K-nearest neighbor (KNN) similarity search with configurable ef_search
- FT.INFO: Get detailed index information and statistics
- FT.DROP: Delete indexes and collections
- FT.DEL: Delete individual documents from indexes
- HNSW Backend: Hierarchical Navigable Small World graph for fast approximate search
- Automatic Backend Selection: Linear scan for small datasets, HNSW for large datasets
- Multi-Vector Support: RVF2 format for ColPali/ColBERT-style multi-vector retrieval (optional)
- Collection Management:
POST /api/collections/:name- Create collectionGET /api/collections- List all collectionsGET /api/collections/:name- Get collection infoDELETE /api/collections/:name- Delete collection
- Vector Operations:
POST /api/collections/:name/points- Upsert vectorsGET /api/collections/:name/points/:id- Get vector by IDPOST /api/collections/:name/points/delete- Delete vectorsGET /api/collections/:name/search- Search vectors
- JSON Format: All requests and responses use JSON
- VectorService: High-performance gRPC interface (port 50051)
- Methods:
CreateCollection- Create new vector collectionUpsert- Insert or update vectorsSearch- Perform similarity searchGetCollectionInfo- Retrieve collection metadataDeleteCollection- Remove collection
- Protobuf: Efficient binary protocol for maximum throughput
- Zero GC Pauses: Pure Rust implementation eliminates garbage collection
- Predictable Latency: Consistent P99 performance under load
- Concurrent Operations: Multi-threaded architecture for parallel processing
- Memory Efficiency: Optimized data structures for minimal memory footprint
- Fast Index Updates: Real-time index modifications without blocking
- GPU Acceleration: Optional wgpu (Vulkan/Metal/DX12) and CUDA backends for vector operations
- SIMD Optimizations: CPU-optimized distance metrics for faster similarity calculations
- LRU Caching: Hot vector cache for frequently accessed embeddings
- RDB Snapshots: Point-in-time snapshots of the Redis-compatible database
- AOF (Append-Only File): Durable write-ahead logging for Redis data
- redb Vector Storage: Persistent storage for vectors and metadata using redb
- HNSW Snapshots: Periodic snapshots of HNSW index structure
- Background Persistence: Non-blocking save operations
- Data Recovery: Automatic recovery on server restart
- S3 Storage: Optional S3/GCS/MinIO integration for vector storage (feature flag)
- Multi-Protocol Support: Use Redis clients, REST, or gRPC
- Language Agnostic: Works with any language that has a Redis client
- Docker Support: Easy deployment with containerization
- Self-Hosted: Full control over your data and infrastructure
- Open Source: Apache 2.0 licensed
docker build -t redvector:latest .
docker run -d -p 6379:6379 -p 8888:8888 -p 50051:50051 redvector:latest# Clone
git clone https://github.com/rafaelescrich/redvector.git
cd redvector
# Build with all features (Redis + Vector Search + REST + gRPC)
cargo build --release --features full
# Run
./target/release/redvectorOutput:
π RedVector v0.1.0 - In-Memory Vector Database
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π΄ Redis Protocol: localhost:6379
π REST API: http://localhost:8888
π gRPC API: http://localhost:50051
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
import redis
r = redis.Redis()
# Standard Redis commands work
r.set("hello", "world")
print(r.get("hello")) # b'world'
# Vector search with FT.* commands
r.execute_command("FT.CREATE", "myindex", "SCHEMA", "embedding", "VECTOR(384)")
r.execute_command("FT.ADD", "myindex", "doc1", "1.0", "FIELDS", "vector", "0.1,0.2,...")
results = r.execute_command("FT.SEARCH", "myindex", "0.1,0.2,...")# Create a collection
curl -X POST http://localhost:8888/api/collections/my_vectors \
-H "Content-Type: application/json" \
-d '{"vector_size": 384, "distance": "Cosine"}'
# Add vectors
curl -X POST http://localhost:8888/api/collections/my_vectors/points \
-H "Content-Type: application/json" \
-d '{
"points": [
{"id": 1, "vector": [0.1, 0.2, 0.3, ...]}
]
}'
# Search
curl -X POST http://localhost:8888/api/collections/my_vectors/search \
-H "Content-Type: application/json" \
-d '{"vector": [0.1, 0.2, 0.3, ...], "limit": 10}'# Using grpcurl
grpcurl -plaintext localhost:50051 redvector.VectorService/CreateCollection \
-d '{"name": "my_vectors", "vector_size": 384, "distance": "Cosine"}'RedVector is built on two core components:
- Redis-Compatible Server (rsedis-style): Handles all Redis protocol commands, data structures, and persistence
- Redisearch Platform Core: Provides vector search capabilities with HNSW indexing, GPU acceleration, and advanced features
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RedVector In-Memory Architecture β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Redis Proto β β REST API β β gRPC API β β
β β Port 6379 β β Port 8888 β β Port 50051 β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β β
β ββββββββββββββββββββΌβββββββββββββββββββ β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Redisearch Platform Core β β
β β β’ HNSW Vector Index (CPU) β’ GPU Acceleration (wgpu/CUDA) β β
β β β’ RVF2 Multi-Vector Storage β’ Quantization (SQ8, PQ) β β
β β β’ Cosine/Euclidean/Inner Product β’ Persistent Index (redb) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Redis-Compatible Key-Value Store (In-Memory) β β
β β Strings β’ Lists β’ Sets β’ Hashes β’ Sorted Sets β’ Pub/Sub β β
β β β’ 150+ Redis Commands β’ Transactions β’ Persistence (RDB/AOF) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Persistence Layer β β
β β β’ RDB Snapshots β’ AOF Append-Only File β β
β β β’ redb Vector Storage β’ HNSW Snapshots β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Feature | RedVector | Qdrant | Milvus | Pinecone | pgvector |
|---|---|---|---|---|---|
| Type | In-Memory | Disk-based | Hybrid | Cloud | PostgreSQL Extension |
| Language | π¦ Rust | π¦ Rust | Go | ? | C |
| Redis Protocol | β | β | β | β | β |
| REST API | β | β | β | β | β |
| gRPC API | β | β | β | β | β |
| No GC Pauses | β | β | β | ? | β |
| Built-in Cache | β | β | β | β | β |
| Pub/Sub | β | β | β | β | β |
| Transactions | β | β | β | β | β |
| Self-Hosted | β | β | β | β | β |
| Open Source | β | β | β | β | β |
| In-Memory | β | β | Partial | β | β |
- Redis-compatible server (rsedis-style) with 150+ commands
- Redisearch Platform Core integration
- In-memory vector storage with HNSW indexing
- RediSearch FT.* commands (FT.CREATE, FT.ADD, FT.SEARCH, FT.INFO, FT.DROP, FT.DEL)
- Integrated REST API (Qdrant-compatible)
- Integrated gRPC API
- Persistence (RDB, AOF, redb for vectors)
- wgpu backend (Vulkan/Metal/DX12) via Redisearch Platform Core
- CUDA backend for NVIDIA GPUs
- Apple Silicon Metal optimization
- GPU-accelerated distance metrics
- Flat and IVF indexes on GPU
- IVF-SQ8 index (4x compression) via Redisearch Platform Core
- IVF-PQ index (32x compression) for maximum memory efficiency
- Memory-mapped vector storage with RVF2 format
- Full-text search integration (Redisearch rust-port)
- Production hardening and comprehensive benchmarks
- Distributed clustering
- Multi-node replication
- Cloud management console
| Document | Description |
|---|---|
| GPU Acceleration Plan | GPU implementation roadmap |
| Architecture Advantages | Why RedVector's design is unique |
| Docker Guide | Container deployment |
Contributions are welcome! See our Architecture Decision Records for design context.
# Run tests
cargo test --all-features
# Build with all features
cargo build --release --features full
# Run
./target/release/redvectorRedVector is inspired by and built upon the excellent work of the open-source community:
-
rsedis: Redis re-implemented in Rust by Sebastian Waisbrot. The rsedis project provided significant inspiration for the Redis-compatible server implementation.
-
RediSearch: A query and indexing engine for Redis, providing secondary indexing, full-text search, and vector similarity search. RediSearch's design and feature set inspired the vector search capabilities in RedVector.
We are grateful to the maintainers and contributors of these projects for their valuable work in the open-source ecosystem.
Copyright (c) 2025, Rafael Escrich
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Built with π¦ Rust β’ Powered by Redis-Compatible Server + Redisearch Platform β’ In-Memory Vector Database
Documentation β’ Issues β’ Discussions