LogoLogo
👋 Get in touch⭐️ GitHub
  • Welcome
  • Getting Started
    • Why Superlinked?
    • Setup Superlinked
    • Basic Building Blocks
  • Run in Production
    • Overview
    • Setup Superlinked Server
      • Configuring your app
      • Interacting with app via API
    • Supported Vector Databases
      • Redis
      • Mongo DB
      • Qdrant
  • Concepts
    • Overview
    • Combining Multiple Embeddings for Better Retrieval Outcomes
    • Dynamic Parameters/Query Time weights
  • Reference
    • Overview
    • Changelog
    • Components
      • Dag
        • Period Time
      • Parser
        • Json Parser
        • Dataframe Parser
        • Data Parser
      • Schema
        • Id Schema Object
        • Schema Object
        • Schema
        • Event Schema Object
        • Event Schema
      • App
        • App
        • Interactive
          • Interactive App
        • Online
          • Online App
        • Rest
          • Rest App
        • In Memory
          • In Memory App
      • Space
        • Custom Space
        • Exception
        • Has Space Field Set
        • Number Space
        • Image Space Field Set
        • Text Similarity Space
        • Input Aggregation Mode
        • Image Space
        • Recency Space
        • Space Field Set
        • Categorical Similarity Space
        • Space
      • Executor
        • Exception
        • Executor
        • Interactive
          • Interactive Executor
        • Rest
          • Rest Descriptor
          • Rest Handler
          • Rest Executor
          • Rest Configuration
        • In Memory
          • In Memory Executor
        • Query
          • Query Executor
      • Registry
        • Superlinked Registry
        • Exception
      • Storage
        • Mongo Db Vector Database
        • Vector Database
        • Redis Vector Database
        • In Memory Vector Database
        • Qdrant Vector Database
      • Index
        • Effect
        • Index
        • Util
          • Aggregation Node Util
          • Event Aggregation Node Util
          • Event Aggregation Effect Group
          • Effect With Referenced Schema Object
          • Aggregation Effect Group
      • Source
        • Data Loader Source
        • Interactive Source
        • Types
        • In Memory Source
        • Source
        • Rest Source
      • Query
        • Param
        • Typed Param
        • Query
        • Query Weighting
        • Query Descriptor
        • Nlq Param Evaluator
        • Space Weight Param Info
        • Query Param Information
        • Query Filters
        • Nlq Pydantic Model Builder
        • Clause Params
        • Param Evaluator
        • Query Mixin
        • Query Param Value Setter
        • Query Filter Validator
        • Natural Language Query Param Handler
        • Query Filter Information
        • Query Vector Factory
        • Query Clause
        • Result
        • Query Result Converter
          • Default Query Result Converter
          • Query Result Converter
          • Serializable Query Result Converter
        • Predicate
          • Binary Op
          • Query Predicate
          • Binary Predicate
        • Query Clause
          • Similar Filter Clause
          • Overriden Now Clause
          • Looks Like Filter Clause
          • Space Weight Map
          • Nlq System Prompt Clause
          • Nlq Clause
          • Radius Clause
          • Weight By Space Clause
          • Base Looks Like Filter Clause
          • Limit Clause
          • Select Clause
          • Looks Like Filter Clause Weights By Space
          • Single Value Param Query Clause
          • Hard Filter Clause
          • Query Clause
        • Nlq
          • Nlq Compatible Clause Handler
          • Exception
          • Nlq Clause Collector
          • Nlq Handler
          • Suggestion
            • Query Suggestion Model
            • Query Suggestions Prompt Builder
          • Param Filler
            • Query Param Model Validator
            • Query Param Model Validator Info
            • Query Param Model Builder
            • Query Param Prompt Builder
            • Nlq Annotation
            • Templates
  • Recipes
    • Overview
    • Multi-Modal Semantic Search
      • Hotel Search
    • Recommendation System
      • E-Commerce RecSys
  • Tutorials
    • Overview
    • Semantic Search - News
    • Semantic Search - Movies
    • Semantic Search - Product Images & Descriptions
    • RecSys - Ecommerce
    • RAG - HR
    • Analytics - User Acquisition
    • Analytics - Keyword Expansion
  • Help & FAQ
    • Logging
    • Support
    • Discussion
  • Policies
    • Terms of Use
    • Privacy Policy
Powered by GitBook
On this page
  • Configuring your existing managed Redis
  • Modifications in your configuration
  • Start a Managed Redis Instance
  • Example app with Redis

Was this helpful?

Edit on GitHub
  1. Run in Production
  2. Supported Vector Databases

Redis

PreviousSupported Vector DatabasesNextMongo DB

Last updated 4 months ago

Was this helpful?

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 . 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 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:

from superlinked import framework as sl

vector_database = sl.RedisVectorDatabase(
    "<your_redis_host>", # (Mandatory) This is your Redis' URL without any port or extra fields.
    12315, # (Mandatory) This is the port and it must be an integer.
    default_query_limit=10, # This optional parameter specifies the maximum number of query results returned. If not set, it defaults to 10.
    # These params must be in a form of kwarg params. Here you can specify anything that the official python client 
    # enables. The params can be found here: https://redis.readthedocs.io/en/stable/connections.html. Below you can see a very basic user-pass authentication as an example.
    username="test",
    password="password"
)

Once you have configured the vector database just simply set it as your vector database.

...
executor = sl.RestExecutor(
    sources=[source],
    indices=[index],
    queries=[sl.RestQuery(sl.RestDescriptor("query"), query)],
    vector_database=vector_database, # Or any variable that you assigned your `RedisVectorDatabase`
)
...

Start a Managed Redis Instance

Example app with Redis

To initiate a managed Redis instance, navigate to , 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 is 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.

You can find an example that utilizes Redis .

Redis Labs
here
Redis official documentation
Start a Managed Redis Instance