|
| 1 | +--- |
| 2 | +title: What is Vector Similarity in Azure Cache for Redis? |
| 3 | +description: Learn about Azure Cache for Redis to store vector embeddings and provide similarity search. |
| 4 | +author: flang-msft |
| 5 | +ms.author: franlanglois |
| 6 | +ms.service: cache |
| 7 | +ms.topic: overview |
| 8 | +ms.date: 09/18/2023 |
| 9 | +--- |
| 10 | + |
| 11 | +# What is Vector Similarity in Azure Cache for Redis? |
| 12 | + |
| 13 | +You could rename this "about". Overview documents contain "nice-to-know" information, |
| 14 | +like background information, that is not strictly required to complete a task, but |
| 15 | +builds the readers confidence in the technology, when to use it, etc. |
| 16 | + |
| 17 | +I stole this from your tutorial ... we can break this up and expand on it throughout |
| 18 | +this document: |
| 19 | + |
| 20 | +```markdown |
| 21 | +Azure Cache for Redis can be used to store the embeddings vectors and to perform the vector similarity search. Redis is extremely fast because it runs in-memory. This can be very useful when processing large datasets! |
| 22 | +Because Redis is so popular, it is often already used in applications for caching or session store applications. Redis can often be an economical choice because it can pull double-duty by handling typical caching roles while simultaneously handling vector search applications. |
| 23 | + |
| 24 | +Redis has access to a wide range of search capabilities through the [RediSearch module](cache-redis-modules#redisearch), which is available in the Enterprise tier of Azure Cache for Redis. Vector search capabilities include: |
| 25 | +- Support for `Euclidean`, `Cosine`, and `Internal Product` search distance metrics |
| 26 | +- `FLAT` and `Hierarchical Navigable Small World (HNSW)` indexing methods |
| 27 | +- Hybrid filtering with [powerful query features](https://redis.io/docs/interact/search-and-query/) |
| 28 | +``` |
| 29 | + |
| 30 | +## What is a vector database? |
| 31 | + |
| 32 | +It might be nice to level set here. This would contextualize this article for those |
| 33 | +who may not be familiar with LLMs, embeddings, vectors, nearest neighbor / cosine |
| 34 | +similarity searches, etc. You don't have to go deep. |
| 35 | + |
| 36 | +Alternatively, you could create the section "Who is this for?" but that seems a bit |
| 37 | +more uncouth. |
| 38 | + |
| 39 | +## When should I use it? |
| 40 | + |
| 41 | +You could rename this to "key scenarios". When does it make sense to use Redis |
| 42 | +in this capacity -- as a vector database? |
| 43 | + |
| 44 | +### How does it work? |
| 45 | + |
| 46 | +This is where you could talk about requirements and some light discussion of the |
| 47 | +components in Redis that are employed that provide this functionality. Discuss |
| 48 | +the "under the hood" architecture to help provide insights and understanding, |
| 49 | +including a discussion of limitations and why a given limitation exists. |
| 50 | + |
| 51 | + |
| 52 | +### Why choose Azure Cashe for Redis for storing and searching for vectors? |
| 53 | + |
| 54 | +What are some of the benefits of using Redis for vectors? You named off a few |
| 55 | +the other day ... |
| 56 | + |
| 57 | +- First to provide this feature |
| 58 | +- Fast / in-memory |
| 59 | +- Inexpensive, esp. if you already have Redis as a component of your application architecture |
| 60 | +- Etc. |
| 61 | + |
| 62 | + |
| 63 | +### What are my other options for storing and searching for vectors? |
| 64 | + |
| 65 | +I personally believe that one of the most difficult things about Azure (and Microsoft |
| 66 | +all up) is the *paradox of choice*. With so many technology options at your disposal |
| 67 | +that can perform a similar role in a system architecture, which stack of technologies |
| 68 | +should I use? In the previous section, you told the reader why Redis makes the most |
| 69 | +sense. But to be even handed, its not always the right decision. So, if you can |
| 70 | +help the reader find other solutions, you've done them a great service. |
| 71 | + |
| 72 | +### Troubleshooting |
| 73 | + |
| 74 | +You may want to just point out the top one or two scenarios you've come across |
| 75 | +in testing that trip up users. Point them to most extensive documentation on Redis' |
| 76 | +site. |
0 commit comments