Skip to content

Introducing Vector Semantic Search To Valkey #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

yairgott
Copy link

Introducing Vector Semantic Search To Valkey

Signed-off-by: yairgott <[email protected]>
@yairgott yairgott marked this pull request as draft June 13, 2025 21:18
yairgott added 2 commits June 13, 2025 15:02
Signed-off-by: Yair Gottdenker <[email protected]>
Signed-off-by: yairgott <[email protected]>
Signed-off-by: Yair Gottdenker <[email protected]>
Copy link
Member

@madolson madolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any major issues outside of the lack of benchmarking.

@@ -0,0 +1,173 @@
The Valkey project is introducing vector similarity search capabilities through [valkey-search](https://github.com/valkey-io/valkey-search) (BSD-3-Clause licensed), an official Valkey module compatible with Valkey versions 8.1.1 and above.

With valkey-search you can search through billions of vectors with single-digit millisecond latencies and greater than 99% recall. Whether you're building semantic search, fraud detection systems, or conversational AI experiences, valkey-search offers a performant and flexible foundation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a real benchmark to back this up, I don't feel great saying this basically as our tagline.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second this. Especially given that performance is the key competitive advantage.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summarizing a meeting discussion with Allen and Madelyn:
Ideally, the benchmarks would include comparative results against leading vector databases. However, due to publishing constraints from both GCP and AWS, a more practical path forward may be to have these numbers shared by an external blogger. As a result, this blog post will focus primarily on the functionality.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid being specific because the numbers aren't backed up by a benchmark, but you can definitely say something looser but accurate "you can search through billions of vectors with the kind of performance you expect out of Valkey"

@yairgott yairgott marked this pull request as ready for review June 13, 2025 22:22
yairgott and others added 8 commits June 13, 2025 15:23
Signed-off-by: Yair Gottdenker <[email protected]>
Signed-off-by: Yair Gottdenker <[email protected]>
Signed-off-by: Yair Gottdenker <[email protected]>
Signed-off-by: Yair Gottdenker <[email protected]>
Signed-off-by: yairgott <[email protected]>
Signed-off-by: Yair Gottdenker <[email protected]>
Signed-off-by: Yair Gottdenker <[email protected]>
@@ -0,0 +1,152 @@
+++
title= "Introducing Vector Search To Valkey"
description = "Learn how to use valkey-search to search through billions of vectors with single-digit millisecond latencies and greater than 99% recall."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Learn how to use valkey-search to search through billions of vectors with single-digit millisecond latencies and greater than 99% recall."
description = "Learn how to use valkey-search to implement highly reliable vector similarity search."

Based on another thread, I think we should split the performance from the use case. We can have a followup that details the performance characteristics.

Copy link
Author

@yairgott yairgott Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing this claim, or not stating something similar, I'm concerned that we leave almost no appetite to try it out...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the "high reliable" to be totally bland and a turn-off. It's worse than saying nothing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leverage some of the Valkey verbiage? Something like "Learn all about doing vector similarity search on Valkey, the worlds fastest xxxxx" ?? Here the claim is for Valkey and VSS lives in the reflected glory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valkey is not he worlds fastest datastore. We don't make that claim anywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We sometimes just say "Built for high-performance applications".

yairgott and others added 7 commits June 16, 2025 17:49
Signed-off-by: Yair Gottdenker <[email protected]>
@@ -0,0 +1,152 @@
+++
title= "Introducing Vector Search To Valkey"
description = "Learn how to use valkey-search to search through billions of vectors with single-digit millisecond latencies and greater than 99% recall."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valkey is not he worlds fastest datastore. We don't make that claim anywhere.


The Valkey project is introducing vector similarity search capabilities through [valkey-search](https://github.com/valkey-io/valkey-search) (BSD-3-Clause licensed), an official Valkey module compatible with Valkey versions 8.1.1 and above.

With valkey-search you can search through billions of vectors with single-digit millisecond latencies and greater than 99% recall. Whether you're building semantic search, fraud detection systems, or conversational AI experiences, valkey-search offers a performant and flexible foundation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With valkey-search you can search through billions of vectors with single-digit millisecond latencies and greater than 99% recall. Whether you're building semantic search, fraud detection systems, or conversational AI experiences, valkey-search offers a performant and flexible foundation.
With valkey-search you can easily create indexes to search through billions of vectors stored within your Valkey instances. Whether you're building semantic search, fraud detection systems, or conversational AI experiences, valkey-search offers a flexible foundation for your application.

Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a lot of nits on this, but it's overall a very comprehensive blog post.

The one place that needs a little work that I couldn't really resolve is how the headings are supposed to work. I would flatten the overall structure: you have all the way up to an H5 but the post seems to be written more flatly than this.

github: allenss-amazon
---

Allen Samuels is a Principal Engineer at AWS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, this will have a couple of lines beyond title and affliation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add this:

He is passionate about distributed, performant systems. When not travelling the world for pleasure or playing duplicate bridge, Allen can be found in San Jose, California.

featured_image = "/assets/media/featured/random-08.webp"
+++

The Valkey project is introducing vector similarity search capabilities through [valkey-search](https://github.com/valkey-io/valkey-search) (BSD-3-Clause licensed), an official Valkey module compatible with Valkey versions 8.1.1 and above.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valkey project is introducing

Present tense is odd and I'm not sure that this is a great first sentence. I would drop it.

The next line way more impactful - take the technical aspects here (license, compatibility, link) and put them into the next line.

@@ -0,0 +1,173 @@
The Valkey project is introducing vector similarity search capabilities through [valkey-search](https://github.com/valkey-io/valkey-search) (BSD-3-Clause licensed), an official Valkey module compatible with Valkey versions 8.1.1 and above.

With valkey-search you can search through billions of vectors with single-digit millisecond latencies and greater than 99% recall. Whether you're building semantic search, fraud detection systems, or conversational AI experiences, valkey-search offers a performant and flexible foundation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid being specific because the numbers aren't backed up by a benchmark, but you can definitely say something looser but accurate "you can search through billions of vectors with the kind of performance you expect out of Valkey"


## Semantic Search

The ability of AI models to extract semantic meaning enables new classes of searching algorithms, collectively known as semantic search. An AI model can process an input and convert it into a single high-dimension numeric vector – known as an embedding. Inputs with similar meaning will have similar embeddings. Semantic search is the process of converting a query into its embedding and searching a database of embeddings to find the embeddings that are most alike.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'searching algorithms' -> 'search algorithms'


## Semantic Search

The ability of AI models to extract semantic meaning enables new classes of searching algorithms, collectively known as semantic search. An AI model can process an input and convert it into a single high-dimension numeric vector – known as an embedding. Inputs with similar meaning will have similar embeddings. Semantic search is the process of converting a query into its embedding and searching a database of embeddings to find the embeddings that are most alike.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term 'embedding' is used a ton here and it reduces the clarity of the the sentences. We should try to minimize 'embedding' where possible to make it less repetitious.

Example:

searching a database of embeddings to find the embeddings that are most alike

to

searching a database of embeddings to find one that are most alike


## Performance & Low Latency

Valkey-search is designed as an in-memory secondary index, achieving exceptional performance. A multi-threaded architecture optimizes query and mutation processing with minimal thread contention, enabling near-linear vertical scalability.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned earlier, I think I would avoid directly describing performance since we haven't proven this in any way.

If you alter it slightly, the reader will fill in the blanks as far as performance without needing a proof point.

'Valkey-search was designed from the group up as an in-memory secondary index.'


Valkey-search is designed as an in-memory secondary index, achieving exceptional performance. A multi-threaded architecture optimizes query and mutation processing with minimal thread contention, enabling near-linear vertical scalability.

At its core, valkey-search’s threading architecture follows a common design pattern: a worker thread pool combined with task queues. It employs advanced synchronization mechanisms to maintain index consistency while minimizing contention among worker threads. By time-slicing CPU access between read and write operations, the system enables an almost lock-free read path, delivering high performance and consistently low search latency.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My skeptical brain reads: 'the system enables an almost lock-free read path' as 'the read path isn't lock free'.

I might change it to 'the system minimizes locks on the read path'.

It's harder to twist this around.


At its core, valkey-search’s threading architecture follows a common design pattern: a worker thread pool combined with task queues. It employs advanced synchronization mechanisms to maintain index consistency while minimizing contention among worker threads. By time-slicing CPU access between read and write operations, the system enables an almost lock-free read path, delivering high performance and consistently low search latency.

Valley-search’s HNSW implementation is based on the OSS project [HNSWLib](https://github.com/nmslib/hnswlib). While HNSWLib is well-regarded for its speed, we have enhanced its performance and efficiency for our use case. These improvements include better `SIMD` utilization, promotion of CPU cache efficiency, memory utilization and more.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valley-search -> Valkey-search :)

I also wouldn't code block SIMD (it's just an initialism)


We welcome contributions of all kinds - code, documentation, testing, and feedback. Join the community, file issues, open pull requests, or suggest improvements. Your involvement helps make valkey-search better for everyone.

Ready to dive in? Clone the repo, fire up the [dev container](https://hub.docker.com/r/valkey/valkey-extensions), and start building high-performance vector search with valkey-search.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's valkey-bundle now


Clients must send data mutation (write) commands to the primary node which are executed and then automatically asynchronously transmitted to each replica. Clients can send data read operations to any node in the cluster, recognizing that reading from a replica delivers a result reflecting a historical point in time.

When Valkey-search is used, each node, whether a primary or a replica, builds and maintains its own indexes. No additional traffic on the replication channel is generated for index maintenance. Search query operations sent to a replica will be executed against its indexes, reflecting the historical point in time of the data within that node.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower case Valkey-search

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants