vectorstore

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedVectorStoreType = errors.New("unsupported vectorstore type")
)

Functions

func AddDocuments

func AddDocuments(ctx context.Context, log logr.Logger, vs *arcadiav1alpha1.VectorStore, embedder embeddings.Embedder, collectionName string, c client.Client, documents []lanchaingoschema.Document) (err error)

func NewVectorStore

func NewVectorStore(ctx context.Context, vs *arcadiav1alpha1.VectorStore, embedder embeddings.Embedder, collectionName string, c client.Client) (v vectorstores.VectorStore, finish func(), err error)

func RemoveCollection

func RemoveCollection(ctx context.Context, log logr.Logger, vs *arcadiav1alpha1.VectorStore, collectionName string, c client.Client) (err error)

Types

type PGVectorStore

type PGVectorStore struct {
	*pgx.Conn
	pgvector.Store
	*arcadiav1alpha1.PGVector
}

func NewPGVectorStore

func NewPGVectorStore(ctx context.Context, vs *arcadiav1alpha1.VectorStore, c client.Client, embedder embeddings.Embedder, collectionName string) (v *PGVectorStore, finish func(), err error)

func (*PGVectorStore) RemoveExist

func (s *PGVectorStore) RemoveExist(ctx context.Context, log logr.Logger, document []lanchaingoschema.Document) (doc []lanchaingoschema.Document, err error)

RemoveExist remove exist document from pgvector Note: it is currently assumed that the embedder of a knowledge base is constant that means the result of embedding a fixed document is fixed, disregarding the case where the embedder changes (and if it does, a lot of processing will need to be done in many places, not just here)

Jump to

Keyboard shortcuts

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