Skip to content

Redislabs-Solution-Architects/vss-ops

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

VSS Examples

Examples of Vector Similarity Search (VSS) in Python

Blog

https://joeywhelan.blogspot.com/2022/12/redis-vector-similarity-search.html

Features

  • Provides examples of how to conduct straight vector and hybrid VSS searches.

Prerequisites

Installation

  1. Clone this repo.

  2. Create an images folder in the data folder and download the images from the URL above.

  3. Install Python requirements (either in a virtual env or global)

pip install -r requirements.txt

Usage

Options

  • --url. Redis connection string. Default = redis://localhost:6379
  • --objecttype. Redis Object Type. Default = json
  • --indextype. Redis VSS Index Type. Default = flat
  • --metrictype. Redis VSS Metric Type. Default = l2

Execution

python3 example.py --objecttype json --indextype hnsw --metrictype cosine

Output

Vector Query

Query Vector Image ID:58452

ID Score
58452 0
31863 0.12
46314 0.13
33909 0.22
22945 0.24

Hybrid Query

Query Vector Image ID:58452

Hybrid Query String: 2107|2656|25155|40953|34242

ID Score
2656 0.4
40953 0.42
34242 0.49
25155 0.51
2107 0.52

About

Various Vector Similarity Search examples

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages