bolt

package
v0.0.0-...-1414e4b Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPath       = "vector_store.db"
	DefaultBucket     = "embeddings"
	DefaultPermission = 0600
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Path       string
	Bucket     string
	Permission fs.FileMode
	Timeout    time.Duration
}

Options for the Bolt vector store.

type VectorStore

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

VectorStore is a vector store backed by BoltDB. It implements the flowllm.VectorStore interface, and it is ideal for small to medium-sized collections of vectors.

func NewVectorStore

func NewVectorStore(embeddings flowllm.Embeddings, opts Options) (*VectorStore, func(), error)

NewVectorStore creates a new Bolt vector store.

func (*VectorStore) AddDocuments

func (s *VectorStore) AddDocuments(ctx context.Context, documents ...flowllm.Document) error

func (*VectorStore) SimilaritySearch

func (s *VectorStore) SimilaritySearch(ctx context.Context, query string, k int) ([]flowllm.Document, error)

func (*VectorStore) SimilaritySearchVectorWithScore

func (s *VectorStore) SimilaritySearchVectorWithScore(_ context.Context, query []float32, k int) ([]flowllm.ScoredDocument, error)

Jump to

Keyboard shortcuts

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