Versions in this module Expand all Collapse all v0 v0.2.11 Oct 19, 2026 Changes in this version + const DefaultMaxChunk + var ErrBadInput = errors.New("vecindex: bad input") + var ErrBadK = errors.New("vecindex: k must be positive") + var ErrDimension = errors.New("vecindex: vector dimension mismatch") + var ErrNotFinite = errors.New("vecindex: NaN or infinite value") + var ErrZeroVector = errors.New("vecindex: zero vector") + func ChunkID(source, text string) string + type Chunk struct + Heading string + ID string + Text string + func ChunkMarkdown(source, text string, maxBytes int) []Chunk + type Embedder interface + Dim func() int + Embed func(ctx context.Context, texts []string) ([][]float32, error) + type Flat struct + func New(dim int) (*Flat, error) + func (f *Flat) Delete(source string) int + func (f *Flat) Dim() int + func (f *Flat) Len() int + func (f *Flat) Search(q []float32, k int, minScore float32) ([]Hit, error) + func (f *Flat) Upsert(source string, chunks []Chunk, vecs [][]float32) (UpsertStats, error) + type Hit struct + ChunkID string + Heading string + Score float32 + Source string + Text string + type Index interface + Delete func(source string) int + Len func() int + Search func(q []float32, k int, minScore float32) ([]Hit, error) + Upsert func(source string, chunks []Chunk, vecs [][]float32) (UpsertStats, error) + type UpsertStats struct + Added int + Removed int + Unchanged int