Help us shape the future of Go! Take the 2026 Go Developer Survey

memoryeval

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memoryeval compares document-level evidence retrieval on a shared corpus. It does not score generated answers or claim benchmark parity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct {
	EmbeddingPreprocessing string                            `json:"embedding_preprocessing,omitempty"`
	Documents              []memory.RetainRequest            `json:"documents"`
	Queries                []Query                           `json:"queries"`
	RecordedFacts          map[string][]memory.ExtractedFact `json:"recorded_facts,omitempty"`
	RecordedEmbeddings     map[string][]float32              `json:"recorded_embeddings,omitempty"`
}

func (Fixture) Validate

func (f Fixture) Validate() error

type Query

type Query struct {
	Name              string               `json:"name"`
	Request           memory.RecallRequest `json:"request"`
	ExpectedDocuments []string             `json:"expected_documents"`
}

type QueryResult

type QueryResult struct {
	Name               string              `json:"name"`
	ExpectedDocuments  []string            `json:"expected_documents"`
	RetrievedDocuments []string            `json:"retrieved_documents"`
	EvidenceRecall     float64             `json:"evidence_recall"`
	ReciprocalRank     float64             `json:"reciprocal_rank"`
	LatencyMS          int64               `json:"latency_ms"`
	Evidence           memory.RecallResult `json:"evidence"`
}

type RecordedModels

type RecordedModels struct{ Fixture Fixture }

RecordedModels fails for unknown inputs instead of fabricating embeddings or facts. It isolates storage/retrieval tests from live model nondeterminism.

func (RecordedModels) Embed

func (r RecordedModels) Embed(_ context.Context, texts []string) ([][]float32, error)

func (RecordedModels) EmbedFacts

func (r RecordedModels) EmbedFacts(ctx context.Context, facts []memory.ExtractedFact, mentionedAt time.Time) ([][]float32, error)

func (RecordedModels) Extract

func (RecordedModels) ModelID

func (r RecordedModels) ModelID() string

type Report

type Report struct {
	Backend                     string                `json:"backend"`
	Scope                       memory.Scope          `json:"scope"`
	PinnedUpstreamCommit        string                `json:"pinned_upstream_commit"`
	ReferenceDeploymentVerified bool                  `json:"reference_deployment_verified"`
	RecordedModels              bool                  `json:"recorded_models"`
	RetainWorkers               int                   `json:"retain_workers"`
	RetainResults               []memory.RetainResult `json:"retain_results"`
	RetainMS                    int64                 `json:"retain_ms"`
	MeanEvidenceRecall          float64               `json:"mean_evidence_recall"`
	MeanReciprocalRank          float64               `json:"mean_reciprocal_rank"`
	Queries                     []QueryResult         `json:"queries"`
}

func Evaluate

func Evaluate(ctx context.Context, backend memory.Backend, scope memory.Scope, fixture Fixture, name string, recorded bool) (Report, error)

func EvaluateWithWorkers

func EvaluateWithWorkers(ctx context.Context, backend memory.Backend, scope memory.Scope, fixture Fixture, name string, recorded bool, workers int) (Report, error)

EvaluateWithWorkers keeps queries behind a successful ingestion barrier. Concurrency is explicit in the report; both backends receive the same limit.

Jump to

Keyboard shortcuts

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