KiviDB as a Vector Database
Vector search for AI apps: 59,300 searches a second at recall 0.943 on glove-25-angular, the highest recall at every setting, 1.4 to 1.9x Redis's query engine.
Vector search · HNSW and FLAT · Redis Stack commands
KiviDB as a vector database
Vector, full-text and hybrid search in the engine that already holds your cache. FT.CREATE and FT.SEARCH work as they do in Redis Stack, and HNSW graphs are saved in snapshots, so a restart reloads the index instead of rebuilding it.
- Retrieval for RAG
- Semantic search
- Hybrid text and vector
- Recommendations
- LLM response caching
FT.SEARCH idx "*=>[KNN 5 @vec $q]" PARAMS 2 q <embedding>Every point is an embedding. Things that mean the same thing sit close together, so the nearest points to a query are its best matches, even when they share no words.
59,300 Searches a second ef 64, recall 0.943, 100 clients 1.9x Against Redis 8.10 (query engine) ef 64, at higher recall 0.998 Highest recall measured ef 512, recall@10 31 s 1.18M vectors loaded and indexed 38 s on Redis, 13 s on DragonflyWhat teams build
The memory behind an AI application
An embedding is a list of numbers that stands for meaning. Store them, and a search can find what is alike rather than what matches word for word.
RAG
Retrieval for generation
Find the passages closest to a question and hand them to the model, with tag and number filters to keep the answer to what the reader may see.
SEARCH
Semantic and hybrid search
Rank by meaning, by keyword, or by both in one query with FT.HYBRID.
RECOMMEND
Recommendations
Start from an item and ask for the ones nearest to it. New items are searchable the moment they are written.
CACHE
Answers you have already paid for
Keep a model's reply under the embedding of its question, and serve the next question that means the same from memory.
What you get
An index that keeps up with writes
01
Searchable when the write returns
A vector is indexed as part of the write. There is no background indexing phase to wait out before a new record can be found.
02
Recall you choose per query
HNSW with M, EF_CONSTRUCTION and a per-query EF_RUNTIME, or FLAT for exact search over small sets. L2, cosine and inner product.
03
Filters and vectors in one query
Tag, numeric and text filters run before the nearest-neighbour step, and FT.HYBRID combines text and vector scores.
04
The commands you already use
FT.CREATE, FT.SEARCH and FT.AGGREGATE over hashes and JSON, from any Redis client. No new SDK and no second service.
05
Next to the rest of your data
Sessions, caches, counters and embeddings in one database, behind one connection and one set of credentials.
06
Anywhere KiviDB runs
The same binary on your laptop, in Docker, on Kubernetes or as a managed database on KiviDB Cloud.
In practice
An index, a write, a filtered search
Create the index once. Writes to matching keys are indexed as they land, and a search can narrow by tag or number before it looks for neighbours.
The full syntax is in the command reference.
Vector searchFT.CREATE docs ON HASH PREFIX 1 doc: SCHEMA category TAG embedding VECTOR HNSW 6 TYPE FLOAT32 DIM 768 DISTANCE_METRIC COSINE HSET doc:1 category guide embedding <768 float32 bytes> FT.SEARCH docs "(@category:{guide})=>[KNN 10 @embedding $vec AS score]" PARAMS 2 vec <query bytes> DIALECT 2 Measured
The highest recall at every setting
Raising ef trades speed for recall in every engine. KiviDB returned the most accurate results at each setting and the most searches a second at ef 64 and 128; at ef 256 and 512 Dragonfly answered more.
| Setting | Engine | Recall@10 | Searches a second |
|---|---|---|---|
| ef 64 | KiviDB 1.1.0 | 0.943 | 59,300 |
| Dragonfly 2.0.2 | 0.912 | 41,300 | |
| Redis 8.10 (query engine) | 0.912 | 31,800 | |
| ef 128 | KiviDB 1.1.0 | 0.961 | 50,700 |
| Dragonfly 2.0.2 | 0.937 | 40,300 | |
| Redis 8.10 (query engine) | 0.937 | 28,900 | |
| ef 256 | KiviDB 1.1.0 | 0.989 | 31,500 |
| Dragonfly 2.0.2 | 0.979 | 36,200 | |
| Redis 8.10 (query engine) | 0.979 | 21,100 | |
| ef 512 | KiviDB 1.1.0 | 0.998 | 18,700 |
| Dragonfly 2.0.2 | 0.995 | 29,800 | |
| Redis 8.10 (query engine) | 0.995 | 13,700 |
Recall is the share of the true ten nearest neighbours returned. 100 parallel clients.
Loading
1.18 million vectors, searchable as they land
Indexing happens in the write, so the load is finished when the last write returns. KiviDB loaded and indexed the dataset in 31 seconds, Redis in 38; Dragonfly was fastest, at 13. Afterwards KiviDB held 1.66 GB, against 1.13 GB and 1.07 GB.
KiviDB 1.1.0 31 s Dragonfly 2.0.2 13 s Redis 8.10 (query engine) 38 sTime to load and index the dataset. Shorter is better.
Method
How it was run
One engine at a time on the same server, driven from a second machine, with a public tool and a public dataset. The numbers are in the KiviDB repository.
The numbers on GitHub- Tool
- redis/vector-db-benchmark, the harness Redis maintains
- Dataset
- glove-25-angular: 1.18 million vectors, 25 dimensions, cosine distance
- Index
- HNSW, M=16, EF_CONSTRUCTION=256
- Load
- 100 clients, batches of 64
- Search
- 100 parallel clients at ef 64, 128, 256 and 512
- Compared with
- Dragonfly 2.0.2 and Redis 8.10 (query engine)
- Machines
- AWS Graviton3 bare metal: the server on a c7gn.metal confined to 32 cores, the load generator on a second c7gn.metal in the same placement group, one engine at a time.
- Date
- October 2026
Try it on your own embeddings
Start a free database on KiviDB Cloud, or download the binary and run it yourself. Key-value throughput and latency are on the benchmarks page.
Start freeDownload KiviDB