faissgo

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 3 Imported by: 0

README

faissgo⚡

Lightweight Go bindings for Meta’s Faiss 🚀

Faiss CUDA

Go Reference Go Report Card

✨ Features

  • Easy-to-use bindings for Faiss, enabling fast and efficient similarity search of high-dimensional vectors.
  • Idiomatic Go bindings for Faiss, allowing seamless integration of Faiss' state-of-the-art vector indexing and search capabilities into Go applications.
  • (COMING SOON) Support's GPU acceleration for blazingly fast vector operations.

📦 Installation

go get github.com/Eigen-DB/eigen-db/libs/faissgo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLastError

func GetLastError() error

Types

type Index

type Index interface {
	Train(vecsFlat []float32) error

	Add(vecsFlat []float32) error

	AddWithIds(vecsFlat []float32, ids []int64) error

	RemoveIds(n int64, ids []int64) error

	Search(queryVectsFlat []float32, k int64) ([]int64, []float32, error)

	Reconstruct(id int64) ([]float32, error) // can be used to fetch a vector for any type of index (i think)

	ReconstructN(id int64, n int64) ([]float32, error) // Reconstruct vectors id to id + n - 1

	WriteToDisk(path string) error

	LoadFromDisk(path string) error

	IsTrained() bool

	NTotal() int64

	Free()
}

type MetricType

type MetricType int
const (
	MetricInnerProduct  MetricType = C.METRIC_INNER_PRODUCT
	MetricL2            MetricType = C.METRIC_L2
	MetricL1            MetricType = C.METRIC_L1
	MetricLinf          MetricType = C.METRIC_Linf
	MetricLp            MetricType = C.METRIC_Lp
	MetricCanberra      MetricType = C.METRIC_Canberra
	MetricBrayCurtis    MetricType = C.METRIC_BrayCurtis
	MetricJensenShannon MetricType = C.METRIC_JensenShannon
)

Jump to

Keyboard shortcuts

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