vector

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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      string
	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 string    `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