Documentation
¶
Overview ¶
Package longmemeval provides fast, self-contained SMOKE scenarios for the Phase 2 memory work, shaped after the LongMemEval benchmark's skill categories. These are NOT the LongMemEval benchmark: they are a handful of short, hand-authored conversations (2–5 turns), not the dataset's long (~100k-token) histories, so they exercise the memory plumbing end-to-end with a real model and no download — a regression signal, not a published-comparable score.
Why a smoke layer at all: memory fails silently (a missing or stale memory yields a subtly worse answer, not an error), so even a coarse model-graded check is worth having in a form that runs with zero external data.
The rigorous bar — the actual LongMemEval dataset adapted through this same agent/eval harness — is a follow-up loader that reads the downloaded dataset from an env path (the dataset is NOT vendored; see ATTRIBUTION.md), the same convention the conformance suites use for external test data. That loader, plus a general eval/benchmark adapter seam so the harness can point at many external suites, is where comparable numbers come from.
The scenario table and its deterministic assertions live in the default build so they are unit-testable for well-formedness; running them against a live model (with an LLM judge for the fuzzy categories) is behind the eval_llm build tag in live_test.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category string
Category names the LongMemEval-style skill a case exercises.
const ( // CatExtraction — recall a fact stated earlier in one conversation. CatExtraction Category = "extraction" // CatMultiSession — synthesize facts stated across separate sessions. CatMultiSession Category = "multi-session" // CatKnowledgeUpdate — a fact was superseded; the latest value must win. CatKnowledgeUpdate Category = "knowledge-update" // CatTemporal — reason about the order or timing of remembered facts. CatTemporal Category = "temporal" // CatAbstention — a fact was never stated; the model must not invent one. CatAbstention Category = "abstention" // CatCompaction — an early fact must survive history compaction: the run // uses a low compaction budget so the head is summarized, and the answer // still depends on a detail from the summarized region. CatCompaction Category = "compaction" )
type MemCase ¶
type MemCase struct {
Category Category
Scenario eval.Scenario
// Rubric grades the final answer via the LLM judge (fuzzy categories).
// Empty skips the judge.
Rubric string
// Must requires each substring in the final answer (deterministic).
Must []string
// MustNot forbids each substring in the final answer (deterministic) —
// the supersede and abstention checks.
MustNot []string
// NewCompactor, when set, runs the scenario under the Compactor it builds
// (given the run's provider, since a SummarizingCompactor needs a model to
// summarize the head). Nil runs with no compaction. It is how a
// CatCompaction case proves a fact survives the compaction boundary — and
// because it hands over a Compactor, not a token budget, a case can plug
// ANY compaction strategy, not just SummarizingCompactor. The Compactor
// itself decides per turn whether to compact (Compact is a no-op under
// budget), so this only chooses the strategy, not the trigger.
NewCompactor func(provider agent.Provider) (agent.Compactor, error)
}
MemCase is one memory scenario plus how to grade its final answer: deterministic substring checks (Must / MustNot) where the expected token is unambiguous, and a Rubric for the LLM judge where it is not.
func SmokeScenarios ¶
func SmokeScenarios() []MemCase
SmokeScenarios returns the illustrative smoke set, one short scenario per category. Each is memory-enabled so the model manages the fact through its tools. These are a plumbing regression signal, not the LongMemEval benchmark — see the package doc.
func (MemCase) Deterministic ¶
Deterministic returns the substring scorers for a case (Must → Contains, MustNot → NotContains). These run without a model, so they are the CI-safe regression layer; the LLM judge (Rubric) is the periodic quality layer.