Last active
May 7, 2025 09:20
-
-
Save up1/f67577724a592e330adebbac17803e5e to your computer and use it in GitHub Desktop.
Vector Sets in Redis 8 (preview version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add datas | |
| $VADD mydata VALUES 4 0.5 1.2 0.75 3.8 "I love dogs" | |
| $VADD mydata VALUES 4 0.5 1.2 0.75 3.8 "I like cats" | |
| $VADD mydata VALUES 4 0.5 1.2 0.75 3.8 "I enjoy birds" | |
| # Show embedding data | |
| $VEMB mydata "I love dogs" | |
| $VEMB mydata "I like cats" | |
| $VEMB mydata "I enjoy birds" | |
| # Show basic information of vector set | |
| $VDIM mydata | |
| $VCARD mydata | |
| $VINFO mydata | |
| # Similarity search for "I love dogs" | |
| $VSIM mydata ELE "I love dogs" WITHSCORES COUNT 3 | |
| 1) "I love dogs" | |
| 2) "1" | |
| 3) "I like cats" | |
| 4) "0.8427733480930328" | |
| 5) "I enjoy birds" | |
| 6) "0.7713080942630768" | |
| # Similarity search for "I love" => embedding | |
| $VSIM mydata VALUES "4 0.5 1.2 0.75 3.8" WITHSCORES COUNT 3 | |
| 1) "I love dogs" | |
| 2) "0.7879546731710434" | |
| 3) "I like cats" | |
| 4) "0.7277481257915497" | |
| 5) "I enjoy birds" | |
| 6) "0.7191725969314575" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment