chromem

package
v0.4.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const VsChromemEmbeddingParallelThread = "VS_CHROMEM_EMBEDDING_PARALLEL_THREAD"

VsChromemEmbeddingParallelThread can be set as an environment variable to control the number of parallel API calls to create embedding for documents. Default is 100

Variables

This section is empty.

Functions

This section is empty.

Types

type ChromemStore added in v0.4.11

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

func New

func New(dsn string, embeddingFunc chromem.EmbeddingFunc) (*ChromemStore, error)

New creates a new Chromem vector store. Three types are supported: 1. In-memory: chromem://:memory: 2. Persistent: chromem://path/to/db-file 3. In-memory, loaded from archive: chromem://archive://path/to/archive-file

func (*ChromemStore) AddDocuments added in v0.4.11

func (s *ChromemStore) AddDocuments(ctx context.Context, docs []vs.Document, collection string) ([]string, error)

func (*ChromemStore) CreateCollection added in v0.4.11

func (s *ChromemStore) CreateCollection(_ context.Context, name string) error

func (*ChromemStore) ExportCollectionsToFile added in v0.4.11

func (s *ChromemStore) ExportCollectionsToFile(ctx context.Context, path string, collections ...string) error

func (*ChromemStore) GetDocuments added in v0.4.11

func (s *ChromemStore) GetDocuments(ctx context.Context, collection string, where map[string]string, whereDocument []chromem.WhereDocument) ([]vs.Document, error)

func (*ChromemStore) ImportCollectionsFromFile added in v0.4.11

func (s *ChromemStore) ImportCollectionsFromFile(ctx context.Context, path string, collections ...string) error

func (*ChromemStore) RemoveCollection added in v0.4.11

func (s *ChromemStore) RemoveCollection(_ context.Context, collection string) error

func (*ChromemStore) RemoveDocument added in v0.4.11

func (s *ChromemStore) RemoveDocument(ctx context.Context, documentID string, collection string, where map[string]string, whereDocument []chromem.WhereDocument) error

func (*ChromemStore) SimilaritySearch added in v0.4.11

func (s *ChromemStore) SimilaritySearch(ctx context.Context, query string, numDocuments int, collection string, where map[string]string, whereDocument []chromem.WhereDocument) ([]vs.Document, error)

Jump to

Keyboard shortcuts

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