vectorstore

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	ID        string
	Content   string
	Metadata  map[string]string
	MediaType string // e.g., "text/plain", "image/jpeg", "image/png"
	MediaData []byte // Binary data for non-text content
}

Chunk represents a document chunk

type Result

type Result struct {
	Chunk
	Score float32
}

Result represents a search result

type SearchOptions

type SearchOptions struct {
	TopK     int
	Filter   map[string]interface{}
	MinScore float32
}

SearchOptions configures search behavior

type Store

type Store interface {
	Add(ctx context.Context, chunks []Chunk, embeddings [][]float32) error
	Search(ctx context.Context, query []float32, opts SearchOptions) ([]Result, error)
	Delete(ctx context.Context, ids []string) error
}

Store defines the interface for vector storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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