flat_simd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultVectorDim = 64

The MRL pipeline truncates embeddings to the first 64 dimensions, providing high preservation of semantic layout while dropping index size by 95%.

Variables

This section is empty.

Functions

func Quantize

func Quantize(raw ports.Vector) ([]int8, error)

Quantize handles the Float32 -> INT8 conversion loop. To normalize correctly, it evaluates the min/max range of the *truncated* array.

Types

type FlatSIMDStore

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

FlatSIMDStore implements VectorStorePort using a flat, memory-mapped INT8 file designed for embedded scale workloads (100k - 1M vectors).

func NewStore

func NewStore(path string) (*FlatSIMDStore, error)

NewStore initializes or opens a flat vector store from disk.

func (*FlatSIMDStore) Close

func (s *FlatSIMDStore) Close() error

Close unmaps and closes the file gracefully.

func (*FlatSIMDStore) Insert

func (s *FlatSIMDStore) Insert(vector ports.Vector, metadata string) error

Insert adds a quantized vector with its metadata ID into the mmap'd file.

func (*FlatSIMDStore) Search

func (s *FlatSIMDStore) Search(query ports.Vector, limit int, threshold float64) ([]string, error)

Search performs a brute-force INT8 dot-product scan over the mmap'd vectors, returning metadata IDs sorted by descending similarity.

Jump to

Keyboard shortcuts

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