vector

package
v0.0.0-...-5bc5eca Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAll

func ApplyAll(cfg *config.Config, cmd *cli.Command)

ApplyAll calls Apply on all registered plugins that define one.

func Names

func Names() []string

Names returns all registered vector store plugin names.

func PluginFlags

func PluginFlags(cfg *config.Config) []cli.Flag

PluginFlags returns CLI flags contributed by all registered vector store plugins.

func Register

func Register(p Plugin)

Register adds a vector store plugin.

Types

type Loader

type Loader func(ctx context.Context) (VectorStore, error)

Loader creates a VectorStore from config.

func Select

func Select(name string) (Loader, error)

Select returns the loader for the named vector store plugin.

type Plugin

type Plugin struct {
	Name   string
	Loader Loader
	Flags  func(cfg *config.Config) []cli.Flag
	Apply  func(cfg *config.Config, cmd *cli.Command)
}

Plugin represents a vector store plugin.

type UpsertRequest

type UpsertRequest struct {
	ConversationGroupID uuid.UUID
	ConversationID      uuid.UUID
	EntryID             uuid.UUID
	Embedding           []float32
	ModelName           string
}

UpsertRequest holds the data for a single vector upsert operation.

type VectorSearchResult

type VectorSearchResult struct {
	EntryID        uuid.UUID `json:"entryId"`
	ConversationID uuid.UUID `json:"conversationId"`
	Score          float64   `json:"score"`
}

VectorSearchResult represents a single vector search result.

type VectorStore

type VectorStore interface {
	// Search performs a semantic vector search.
	Search(ctx context.Context, embedding []float32, conversationGroupIDs []uuid.UUID, limit int) ([]VectorSearchResult, error)
	// Upsert stores or updates vector embeddings for a batch of entries.
	Upsert(ctx context.Context, entries []UpsertRequest) error
	// DeleteByConversationGroupID removes all embeddings for a conversation group.
	DeleteByConversationGroupID(ctx context.Context, conversationGroupID uuid.UUID) error
	// IsEnabled returns true if the vector store is configured and operational.
	IsEnabled() bool
	// Name returns the plugin name (e.g. "qdrant", "pgvector").
	Name() string
}

VectorStore defines the interface for vector search backends.

Jump to

Keyboard shortcuts

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