pgvector

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmbedderWrongNumberVectors = errors.New("number of vectors from embedder does not match number of documents")
	ErrInvalidScoreThreshold      = errors.New("score threshold must be between 0 and 1")
	ErrInvalidFilters             = errors.New("invalid filters")
	ErrUnsupportedOptions         = errors.New("unsupported options")
)

Functions

This section is empty.

Types

type AdditionnalValues

type AdditionnalValues struct {
	DocumentIDColumn ColumnValue
	TenantIDColumn   ColumnValue
}

func (AdditionnalValues) GetDocumentID

func (option AdditionnalValues) GetDocumentID() string

func (AdditionnalValues) GetTenantID

func (option AdditionnalValues) GetTenantID() string

type ColumnValue

type ColumnValue struct {
	Name  string
	Value any
}

type OptionFilter

type OptionFilter struct {
	TenantIDColumn ColumnValue
	TagsColumn     ColumnValue
	RolesColumn    ColumnValue
}

func (OptionFilter) GetRoles

func (option OptionFilter) GetRoles() []string

func (OptionFilter) GetTags

func (option OptionFilter) GetTags() []string

func (OptionFilter) GetTenantID

func (option OptionFilter) GetTenantID() string

type Store

type Store struct {

	//optional - data for these columns will be added to resulting langchain doc Metadata
	QueryAttributes []string
	// contains filtered or unexported fields
}

func New

func New(pgConnectionString, tableName, embeddingStoreColumnName, textColumnName string, saveMetadata bool, embedder embeddings.Embedder) (Store, error)

func (Store) AddDocuments

func (store Store) AddDocuments(ctx context.Context, docs []schema.Document, options ...vectorstores.Option) ([]string, error)

func (Store) SimilaritySearch

func (store Store) SimilaritySearch(ctx context.Context, searchString string, numDocuments int, options ...vectorstores.Option) ([]schema.Document, error)

Jump to

Keyboard shortcuts

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