Documentation
¶
Overview ¶
Package memoryeval compares document-level evidence retrieval on a shared corpus. It does not score generated answers or claim benchmark parity.
Index ¶
- type Fixture
- type Query
- type QueryResult
- type RecordedModels
- func (r RecordedModels) Embed(_ context.Context, texts []string) ([][]float32, error)
- func (r RecordedModels) EmbedFacts(ctx context.Context, facts []memory.ExtractedFact, mentionedAt time.Time) ([][]float32, error)
- func (r RecordedModels) Extract(_ context.Context, req memory.RetainRequest) ([]memory.ExtractedFact, error)
- func (r RecordedModels) ModelID() string
- type Report
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"`
}
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) EmbedFacts ¶
func (r RecordedModels) EmbedFacts(ctx context.Context, facts []memory.ExtractedFact, mentionedAt time.Time) ([][]float32, error)
func (RecordedModels) Extract ¶
func (r RecordedModels) Extract(_ context.Context, req memory.RetainRequest) ([]memory.ExtractedFact, error)
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 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.
Click to show internal directories.
Click to hide internal directories.