vectoria

package module
v0.0.0-...-7779a7b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Vectoria

Vectoria aims to be an embedded vector database for simple use cases.

License

Apache License 2.0

Documentation

Overview

Package vectoria provides an embedded vector database for simple use cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(config DBConfig) (db *DB, err error)

func (*DB) Add

func (db *DB) Add(itemID string, itemVec []float64, indexNames ...string) error

TODO: rollback on err

func (*DB) Get

func (db *DB) Get(queryVec []float64, threshold float64, k uint32, indexNames ...string) (res map[string][]string, err error)

func (*DB) Indexes

func (db *DB) Indexes() []string

func (*DB) NumIndexes

func (db *DB) NumIndexes() uint32

type DBConfig

type DBConfig struct {
	Path string

	LSH []LSHConfig
	// contains filtered or unexported fields
}

type LSHConfig

type LSHConfig struct {
	IndexName string `json:"index_name"`

	// Number of rounds. More rounds improve quality, but also adds computation overhead.
	// It must be at least 1.
	// If invalid value is given, default value is used.
	NumRounds uint32 `json:"num_rounds"`

	// Number of hyperplanes to split the space on. It must be at least 1.
	// If invalid value is given, default value is used.
	NumHyperPlanes uint32 `json:"num_hyper_planes"`

	// Dimension of the space (vector length). It must be at least 2.
	// If invalid value is given, default value is used.
	SpaceDim uint32 `json:"space_dim"`
}

type Options

type Options func(*DB) error

Directories

Path Synopsis
internal
lsh

Jump to

Keyboard shortcuts

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