Redis Similarity

Redis Similarity

Certified

Run a similarity search on a Redis vector set

Runs VSIM to find the elements of a Redis vector set closest to a query vector or to an existing element, ranked by similarity score. See the Redis VSIM documentation for details.

yaml
type: io.kestra.plugin.redis.vector.Similarity

Find the 5 embeddings most similar to a query vector.

yaml
id: similarity_search
namespace: company.team

inputs:
  - id: queryVector
    type: ARRAY
    itemType: FLOAT

tasks:
  - id: search
    type: io.kestra.plugin.redis.vector.Similarity
    url: "redis://:{{ secret('REDIS_PASSWORD') }}@{{ secret('REDIS_HOST') }}:6379"
    key: "doc_embeddings"
    vector: "{{ inputs.queryVector }}"
    count: 5

  - id: log_matches
    type: io.kestra.plugin.core.log.Log
    message: "Top matches: {{ outputs.search.matches }}"
Properties

Vector set key

Rendered before calling VSIM.

Redis connection string

Result count

Maps to the VSIM COUNT option; the maximum number of matches to return, between 1 and 10000. When left unset, the property is omitted from the VSIM call and Redis applies its own default (10).

Query element

The id of an existing element to search similar elements for. Set exactly one of vector or element. If the id does not exist in the vector set, VSIM returns an empty result rather than an error.

Epsilon

Maps to the VSIM EPSILON option; a distance threshold controlling the range of the graph exploration. Must be a non-negative number. When left unset, the property is omitted from the VSIM call and Redis applies its own default.

Exploration factor

Maps to the VSIM EF option; controls the search effort in the underlying HNSW graph, higher values improve recall at the cost of speed. When left unset, the property is omitted from the VSIM call and Redis applies its own default.

Filter expression

Maps to the VSIM FILTER option; restricts matches to elements whose attributes satisfy this expression, see attribute filtering. When left unset, the property is omitted from the VSIM call and no filtering is applied.

Filter efficiency

Maps to the VSIM FILTER-EF option; caps the effort spent scanning candidates to satisfy filter before giving up. Only meaningful together with filter. When left unset, the property is omitted from the VSIM call and Redis applies its own default.

Reference (ref) of the pluginDefaults to apply to this task.

SubTypenumber

Query vector

The vector to search similar elements for, as a list of numbers. Set exactly one of vector or element.

SubTypestring

Matching element ids

Element ids returned by VSIM, ranked from most to least similar.

SubTypenumber

Similarity scores

Similarity score for each element id in matches, in the same order.