vectorstore

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package vectorstore provides functionality for storing and managing vector embeddings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToRetriever

func ToRetriever(vectorStore schema.VectorStore, optFns ...func(o *retriever.VectorStoreOptions)) schema.Retriever

ToRetriever takes a vector store and returns a retriever

Types

type Pinecone added in v0.0.12

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

func NewPinecone added in v0.0.12

func NewPinecone(client pinecone.Client, embedder schema.Embedder, textKey string, optFns ...func(*PineconeOptions)) (*Pinecone, error)

func (*Pinecone) AddDocuments added in v0.0.12

func (vs *Pinecone) AddDocuments(ctx context.Context, docs []schema.Document) error

func (*Pinecone) SimilaritySearch added in v0.0.12

func (vs *Pinecone) SimilaritySearch(ctx context.Context, query string) ([]schema.Document, error)

type PineconeOptions added in v0.0.12

type PineconeOptions struct {
	Namespace string
	TopK      int64
}

type Weaviate added in v0.0.40

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

Weaviate represents a Weaviate vector store.

func NewWeaviate added in v0.0.40

func NewWeaviate(client *weaviate.Client, embedder schema.Embedder, optFns ...func(*WeaviateOptions)) *Weaviate

NewWeaviate creates a new Weaviate vector store with the given Weaviate client, embedder, and optional configuration options.

func (*Weaviate) AddDocuments added in v0.0.40

func (vs *Weaviate) AddDocuments(ctx context.Context, docs []schema.Document) error

AddDocuments adds a batch of documents to the Weaviate vector store.

func (*Weaviate) CreateClassIfNotExist added in v0.0.41

func (vs *Weaviate) CreateClassIfNotExist(ctx context.Context) error

CreateClassIfNotExist checks if the Weaviate class for the vector store exists, and creates it if it doesn't.

func (*Weaviate) Delete added in v0.0.41

func (vs *Weaviate) Delete(ctx context.Context, uuid string) error

Delete removes a document from the Weaviate vector store based on its UUID.

func (*Weaviate) SimilaritySearch added in v0.0.40

func (vs *Weaviate) SimilaritySearch(ctx context.Context, query string) ([]schema.Document, error)

SimilaritySearch performs a similarity search with the given query in the Weaviate vector store.

type WeaviateOptions added in v0.0.40

type WeaviateOptions struct {
	// TextKey is the name of the property in the Weaviate objects where the text content is stored.
	TextKey string

	// TopK is the number of documents to retrieve in similarity search.
	TopK int

	// IndexName is the name of the index to store the vectors.
	IndexName string

	// AdditionalFields is a list of additional fields to retrieve during similarity search.
	AdditionalFields []string
}

WeaviateOptions contains options for configuring the Weaviate vector store.

Jump to

Keyboard shortcuts

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