postgres

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTableName = "agentflow_knowledge_embeddings"

Variables

View Source
var ErrDimensionMismatch = errors.New("postgres vector store: embedding dimension mismatch")

ErrDimensionMismatch is returned when an upsert vector length does not match the store's configured expected dimension.

Functions

This section is empty.

Types

type Option

type Option func(*Store) error

func WithExpectedDimension added in v0.3.0

func WithExpectedDimension(n int) Option

WithExpectedDimension configures Upsert to reject vectors whose length does not match n. A non-positive n disables validation.

func WithTableName

func WithTableName(name string) Option

type ReindexRequiredError added in v0.3.0

type ReindexRequiredError struct {
	DocumentID string
	Expected   int
	Actual     int
}

ReindexRequiredError indicates stored/incoming embeddings use a different dimension than the store expects and the collection must be reindexed.

func (*ReindexRequiredError) Error added in v0.3.0

func (e *ReindexRequiredError) Error() string

func (*ReindexRequiredError) Is added in v0.3.0

func (e *ReindexRequiredError) Is(target error) bool

func (*ReindexRequiredError) Unwrap added in v0.3.0

func (e *ReindexRequiredError) Unwrap() error

type Store

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

func NewStore

func NewStore(db *sql.DB, opts ...Option) (*Store, error)

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, req knowledge.DeleteRequest) error

func (*Store) HybridQuery added in v0.1.5

func (s *Store) HybridQuery(ctx context.Context, query knowledge.Query) ([]knowledge.SearchResult, error)

HybridQuery combines vector and full-text search with reciprocal rank fusion.

func (*Store) Query

func (s *Store) Query(ctx context.Context, query knowledge.Query) ([]knowledge.SearchResult, error)

func (*Store) Upsert

func (s *Store) Upsert(ctx context.Context, documents []knowledge.DocumentEmbedding) error

Jump to

Keyboard shortcuts

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