purego

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package purego provides a zero-CGO, pure Go VectorIndex implementation. It performs in-memory cosine similarity scanning over vector embeddings, allowing fully functional semantic search without external database extensions or build tags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements domain.VectorIndex in pure Go.

func New

func New() *Adapter

New creates a new pure Go vector index adapter.

func (*Adapter) Capabilities

func (a *Adapter) Capabilities(_ context.Context) (domain.Capabilities, error)

Capabilities returns the adapter's capabilities.

func (*Adapter) Close

func (a *Adapter) Close() error

Close releases resources.

func (*Adapter) Delete

func (a *Adapter) Delete(_ context.Context, ids []int64) error

Delete removes vectors by ID.

func (*Adapter) Health

func (a *Adapter) Health(_ context.Context) domain.Health

Health always reports healthy for the pure Go in-memory index.

func (*Adapter) ID

func (a *Adapter) ID() string

ID returns the adapter identifier.

func (*Adapter) Search

Search performs cosine similarity calculation against indexed points.

func (*Adapter) Upsert

func (a *Adapter) Upsert(_ context.Context, points []domain.VectorPoint) error

Upsert stores or updates vector points in memory.

Jump to

Keyboard shortcuts

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