Redis
This document provides clear steps on how to use and integrate Redis with Superlinked.
Configuring your existing managed Redis
To use Superlinked with Redis, you will need several Redis modules. The simplest approach is to use the official Redis Stack, which includes all the necessary modules. Installation instructions for the Redis Stack can be found in the Redis official documentation. Alternatively, you can start a managed instance provided by Redis (a free-tier is available). For detailed steps on initiating a managed instance, refer to the Start a Managed Redis Instance section below.
Once your Redis instance is up and running, ensure it is accessible from the server that will use it. Additionally, configure the necessary authentication settings as described below.
Modifications in your configuration
To integrate Redis, you need to add the RedisVectorDatabase
class and include it in the executor. Here’s how you can do it:
To configure your Redis, the following code will help you:
Once you have configured the vector database just simply set it as your vector database.
Start a Managed Redis Instance
To initiate a managed Redis instance, navigate to Redis Labs, sign in, and click the "New Database" button. On the ensuing page, locate the Type
selector, which offers two options: Redis Stack
and Memcached
. By default, Redis Stack
is pre-selected, which is the correct choice. If it is not selected, ensure to choose Redis Stack
. For basic usage, no further configuration is necessary. Redis already generated a user which called default
and a password that you can see below it. However, if you intend to use the instance for persistent data storage beyond sandbox purposes, consider configuring High Availability (HA), data persistence, and other relevant settings.
Example app with Redis
You can find an example that utilizes Redis here
Last updated