Versions in this module Expand all Collapse all v0 v0.3.0 Jun 15, 2026 v0.2.0 May 17, 2026 Changes in this version + type BatchIndex interface + DeleteBatch func(ctx context.Context, ids []string) error + InsertBatch func(ctx context.Context, nodes []Node) error + UpsertBatch func(ctx context.Context, nodes []Node) error + type DistanceMetric string + const DistanceCosine + const DistanceDot + const DistanceEuclidean + type Embedder interface + Embed func(ctx context.Context, text string) ([]float32, error) + EmbedBatch func(ctx context.Context, texts []string) ([][]float32, error) + Model func() string + type HNSWConfig struct + EfConstruction int + EfSearch int + M int + type Index interface + Delete func(ctx context.Context, id string) error + Insert func(ctx context.Context, node Node) error + Name func() string + Search func(ctx context.Context, embedding []float32, k int, filters map[string]string) ([]SearchResult, error) + Upsert func(ctx context.Context, node Node) error + type IndexConfig struct + Dimensions int + DistanceMetric DistanceMetric + HNSWConfig *HNSWConfig + IndexType IndexType + Name string + type IndexManager interface + CreateIndex func(ctx context.Context, cfg IndexConfig) error + DropIndex func(ctx context.Context, name string) error + IndexExists func(ctx context.Context, name string) (bool, error) + IndexStats func(ctx context.Context, name string) (*IndexStats, error) + ListIndexes func(ctx context.Context) ([]string, error) + type IndexStats struct + Dimensions int + IndexSizeBytes int64 + Name string + NodeCount int64 + type IndexType string + const IndexTypeFlat + const IndexTypeHNSW + const IndexTypeIVFFlat + type Node struct + Content string + Embedding []float32 + ID string + Metadata map[string]string + Source string + type Retriever struct + func NewRetriever(cfg RetrieverConfig) *Retriever + func (r *Retriever) Retrieve(ctx context.Context, q retrieve.Query) (*retrieve.Result, error) + type RetrieverConfig struct + DefaultTopK int + Embedder Embedder + Index Index + MinScore float64 + Observer retrieve.Observer + type SearchResult struct + Node Node + Score float64