redisvector

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package redisvector provides a Redis-backed VectorStore adapter using RediSearch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSearchResponse

func ParseSearchResponse(resp, collection string) []storage.SearchResult

ParseSearchResponse parses a RediSearch FT.SEARCH RESP response into SearchResults.

FT.SEARCH response format (RESP2):

*<N>           — array header (1 + 2*num_results elements)
:<total>       — integer: total number of matches
$<len>         — bulk string: document key (e.g., "collection:id")
*<fields>      — array of field name-value pairs
  $<len> field_name
  $<len> field_value
  ...
$<len>         — next document key
*<fields>      — next document's fields
...

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements storage.VectorStore using Redis with RediSearch vector similarity.

func New

func New(addr string) (*Store, error)

New creates a RediSearch-backed vector store.

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateCollection

func (s *Store) CreateCollection(_ context.Context, name string, dimension int) error

func (*Store) Delete

func (s *Store) Delete(_ context.Context, collection string, ids []string) error

func (*Store) Search

func (s *Store) Search(_ context.Context, collection string, query []float32, topK int) ([]storage.SearchResult, error)

func (*Store) Upsert

func (s *Store) Upsert(_ context.Context, collection string, embeddings []storage.Embedding) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL