semanticindex

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT 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 (
	BackendUSearch = "usearch"
	USearchVersion = "2.26.0"
)
View Source
const BackendExact = "exact"

Variables

This section is empty.

Functions

func ValidateUSearchRuntimeRoot

func ValidateUSearchRuntimeRoot(context.Context, string, string, string, string, int, int64, int64, string, string) error

ValidateUSearchRuntimeRoot is unavailable in builds without the optional native backend. Untagged status stays unsupported before this can be called.

Types

type Capability

type Capability struct {
	State   CapabilityState `json:"state"`
	Backend string          `json:"backend,omitempty"`
	Version string          `json:"version,omitempty"`
	Reason  string          `json:"reason,omitempty"`
}

Capability describes whether this build can safely open a persisted native backend generation.

func RuntimeCapability

func RuntimeCapability() Capability

func (Capability) Admit

func (c Capability) Admit(backend, version string) (bool, string)

Admit reports whether a persisted backend generation is compatible with this runtime capability. Reasons are stable status codes suitable for callers.

type CapabilityState

type CapabilityState string
const (
	CapabilityUnsupported     CapabilityState = "unsupported"
	CapabilitySupportedReady  CapabilityState = "supported_ready"
	CapabilitySupportedBroken CapabilityState = "supported_broken"
)

type Exact

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

func NewExact

func NewExact(st ReadyStore) *Exact

func (*Exact) Search

func (e *Exact) Search(ctx context.Context, query []float32, opts SearchOptions) ([]Hit, Status, error)

type Filters

type Filters struct {
	AllowedParentKeys    []string `json:"allowed_parent_keys,omitempty"`
	AllowedParentKinds   []string `json:"allowed_parent_kinds,omitempty"`
	AllowedEvidenceRoles []string `json:"allowed_evidence_roles,omitempty"`
	AllowedSourceTypes   []string `json:"allowed_source_types,omitempty"`
}

type HNSWHit

type HNSWHit struct {
	Ordinal  uint64
	Distance float32
}

HNSWHit is an approximate graph candidate. Callers must exactly rerank and validate it against authoritative SQLite state before it becomes evidence.

type HNSWNode

type HNSWNode struct {
	Ordinal uint64
	Vector  []float32
}

HNSWNode identifies one graph vector by its dense, segment-local ordinal. The legacy name is shared by the rejected HNSW bakeoff and the optional USearch candidate so their content-free test harness uses one contract.

type Hit

type Hit struct {
	ChunkID         string  `json:"chunk_id"`
	Rank            int     `json:"rank"`
	Distance        float64 `json:"distance"`
	ParentKind      string  `json:"parent_kind,omitempty"`
	ParentSourceKey string  `json:"parent_source_key,omitempty"`
	SourceType      string  `json:"source_type,omitempty"`
	SectionOrdinal  int     `json:"section_ordinal,omitempty"`
}

type ReadyStore

type ReadyStore interface {
	ListReadyEmbeddings(context.Context, string, int) ([]store.RetrievalEmbeddingRow, error)
}

type SearchOptions

type SearchOptions struct {
	Profile   embedding.Profile
	Limit     int
	MaxChunks int
	Filters   Filters
}

type Searcher

type Searcher interface {
	Search(context.Context, []float32, SearchOptions) ([]Hit, Status, error)
}

type Status

type Status struct {
	State        StatusState  `json:"state"`
	Reason       StatusReason `json:"reason,omitempty"`
	Backend      string       `json:"backend,omitempty"`
	ProfileID    string       `json:"profile_id,omitempty"`
	GenerationID string       `json:"generation_id,omitempty"`
	Scanned      int          `json:"scanned"`
}

type StatusReason

type StatusReason string
const (
	ReasonNone                 StatusReason = ""
	ReasonProfileMismatch      StatusReason = "profile_mismatch"
	ReasonDimensionMismatch    StatusReason = "dimension_mismatch"
	ReasonTooLarge             StatusReason = "too_large"
	ReasonIndexCorrupt         StatusReason = "index_corrupt"
	ReasonCanceled             StatusReason = "canceled"
	ReasonSearchError          StatusReason = "search_error"
	ReasonProviderUnavailable  StatusReason = "provider_unavailable"
	ReasonQueryEmbeddingFailed StatusReason = "query_embedding_failed"
)

type StatusState

type StatusState string
const (
	StateSearched    StatusState = "searched"
	StateUnavailable StatusState = "unavailable"
)

Jump to

Keyboard shortcuts

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