Vector Similarity Search
or
What is Vector Database?
Guy Korland, PhD.
CTO of Incubation, Redis
• What?
• Why?
• How?
Vector Database?
What is Vector Database?
It’s a new database vertical
Vector Database
Why do we need it?
Visual Search E-Commerce: Recommenders
Natural Language Search
Customer Service:
semantic search,
Q&A, content
recommendation,
Jobs
Recommend:
Similar products,
brands, properties
Image Recognition:
face recognition,
similar products
How?
Vector embedding
Vector representation of words + similarity (word2vec)
https://medium.com/@hari4om/word-embedding-d816f643140
Text embedding (BERT)
Semantic Similarity
Works in the space
https://github.com/facebookresearch/faiss/wiki
Benchmarks
http://ann-benchmarks.com/
• FAISS - Facebook
• ScaNN - Google
• SPTAG - Microsoft
• NGT - Yahoo!
• ANNOY - Spotify
Hashes
Bitmaps
Strings
Bit Field
Streams
Hyperloglog
Sorted Sets
Sets
Geospatial
Search Graph
TimeSeries
AI
JSON
Data-Structures Modules
BloomFilter
Redis beyond cache
Lists
Redis Enterprise core
Linear scalability HA Geo-distribution
Durability Backup & restore Tiered-memory access Security
Multi-tenant
Gears
Hashes
Bitmaps
Strings
Bit Field
Streams
Hyperloglog
Sorted Sets
Sets
Geospatial
Search Graph
TimeSeries
AI
JSON
Data-Structures Modules
BloomFilter
Redis beyond cache
Lists
Redis Enterprise core
Linear scalability HA Geo-distribution
Durability Backup & restore Tiered-memory access Security
Multi-tenant
Gears
Redis
15
Images embeddings
Texts embeddings
Videos embeddings
Stored Indexed
Redis as a database
RedisJSON RedisGraph
Hashes
Redis as a database
with
Similarity Search
RedisJSON RedisGraph
Hashes
{
"name": "MY Blue shirt"
"images": [
[0.2, 0.4, 0.3, 0.5…],
[0.1, 0.5, 0.3, 0.2…],
],
"price": 19.90,
"location": "32.05, 34.680"
}
Example
Catalog
FT.SEARCH products
"*=>[TOP_K 10 @images $BLOB]"
Example
Find me the Top 10 products most similar to given image
{
"name": "MY Blue shirt"
"images": [
[0.2, 0.4, 0.3, 0.5…],
[0.1, 0.5, 0.3, 0.2…],
],
"price": 19.90,
"location": "32.05, 34.680"
}
Example cont.
Find me the Top 10 products most similar to given image
that cost $10-$20
FT.SEARCH my_index
"@price[10 20] => [TOP_K 10 @images $BLOB]"
{
"name": "MY Blue shirt"
"images": [
[0.2, 0.4, 0.3, 0.5…],
[0.1, 0.5, 0.3, 0.2…],
],
"price": 19.90,
"location": "32.05, 34.680"
}
Example cont.
Find me the Top 10 products most similar to given image
that cost $10-$20
and the store located 10 KM from TLV
FT.SEARCH my_index
"@price[10 15] @location:[32.082, 34.780 10 km]
=> [TOP_K 10 @images $BLOB]"
{
"name": "MY Blue shirt"
"images": [
[0.2, 0.4, 0.3, 0.5…],
[0.1, 0.5, 0.3, 0.2…],
],
"price": 19.90,
"location": "32.05, 34.680"
}
Example cont.
Find me the Top 10 products most similar to given image
that cost $10-$20
and the store located 10 KM from TLV sort by Price
FT.SEARCH my_index
"@price[10 15] @location:[32.082, 34.780 10 km]
=> [TOP_K 10 @images $BLOB]"
SORTBY @price ASC
{
"name": "MY Blue shirt"
"images": [
[0.2, 0.4, 0.3, 0.5…],
[0.1, 0.5, 0.3, 0.2…],
],
"price": 19.90,
"location": "32.05, 34.680"
}
Graph?
MATCH
(:Product{image:$BLOB})<-[:in]-(:Cart)-[:in]->(p2:Product)
RETURN p2
• https://redisearch.io
- https://github.com/RediSearch/redisearch
• https://redisai.io
- https://github.com/RedisAI/VectorSimilarity
- https://redis.com/blog/build-intelligent-apps-redis-vector-similarity-search/
Where to read more? (Preview)
Thank you!
Questions?

Vector database