Versions in this module Expand all Collapse all v1 v1.1.0 Jun 15, 2026 Changes in this version + type DocStore struct + func NewDocStore(store *Store) *DocStore + func (d *DocStore) Close() error + func (d *DocStore) DeleteCollection(ctx context.Context, collection string) error + func (d *DocStore) GetDocuments(ctx context.Context, collection string) ([]*schema.Document, error) + func (d *DocStore) RecallDocuments(ctx context.Context, collection string, query string, topK int) ([]*schema.Document, error) + func (d *DocStore) SaveDocuments(ctx context.Context, collection string, docs []*schema.Document) error + type EmbeddingFunc func(ctx context.Context, text string) ([]float32, error) + type IndexItem struct + Content string + Embedding []float32 + ID string + Role string + SessionID string + Timestamp int64 + type Retriever struct + func NewRetriever(config *RetrieverConfig, embedding EmbeddingFunc) (*Retriever, error) + func NewRetrieverFromStore(store *Store, config *RetrieverConfig, embedding EmbeddingFunc) (*Retriever, error) + func (r *Retriever) AddToIndex(ctx context.Context, id string, content string, embedding []float32) error + func (r *Retriever) Close() error + func (r *Retriever) IndexReady() bool + func (r *Retriever) RebuildIndex(ctx context.Context, msgs []IndexItem) error + func (r *Retriever) Recall(ctx context.Context, sessionID string, query string, topK int) ([]*schema.Message, error) + func (r *Retriever) RemoveFromIndex(ctx context.Context, sessionID string) error + type RetrieverConfig struct + Addr string + DB int + IndexName string + KeyPrefix string + Password string + VectorDim int + func DefaultRetrieverConfig() *RetrieverConfig + type Store struct + func NewStore(config *StoreConfig) (*Store, error) + func (s *Store) ClearSession(ctx context.Context, sessionID string) error + func (s *Store) Close() error + func (s *Store) GetClient() *redis.Client + func (s *Store) GetKeyPrefix() string + func (s *Store) GetSession(ctx context.Context, sessionID string) ([]*schema.Message, error) + func (s *Store) Save(ctx context.Context, sessionID string, msgs []*schema.Message) error + type StoreConfig struct + Addr string + DB int + KeyPrefix string + Password string + func DefaultStoreConfig() *StoreConfig