How ee builds a pack.
The pack is what an agent reads at the start of a task: the memories that match it, within a token budget, near-duplicates dropped, each item with its source and score. The same inputs give the same pack.
A pipeline of timed stages.
ee pack runs a fixed pipeline. It validates the request, retrieves with lexical and semantic search fused by rank, resolves and admits candidates, selects under quotas, and assembles the pack with provenance. It reports every degradation, and --explain-performance adds each stage's time.Twelve of ee pack's timed stages, in order.
ee pack times each of these stages and names it in its timing trace (--explain-performance). Select a stage to read what it does; Play steps through them.
bars: candidates remaining, illustrative conditional opt-in unavailable
requestValidateevery packParses the task, profile and budget, and caps the token budget and candidate pool to the workspace's runtime profile. Every built-in profile asks for a pool of 64.
Search · lexical and semantic, fused
Lexical · BM25
exact words, names, flags
Reciprocal-rank fusion
Σ 1 / (60 + rank)
weights 0.45 · 0.45
Semantic · Model2Vec
potion-multilingual-128M · 256-d
Both searches run locally. If the model cannot load, a deterministic hash embedder replaces it and gets no semantic credit; lexical scores take the semantic weight, and the response records this in degraded.
Ordering · quality multipliers
score = base × recency × confidence × utility × maturity × harmful × scope + anchor match (±0.08)
- recencyexp(−age / 30 days), floor 0.5
- confidencethe memory's confidence, floor 0.1
- utility0.5 + 0.5 × utility
- maturityrules: retired 0 · candidate 0.5 · established 1 · proven 1.5
- harmful1 − 0.1 per harmful report, floor 0.2
- scope× 1.2 on an exact workspace or scope match
Recency, confidence and harmful reports each have a floor, so they can lower a memory's rank but cannot remove it. Maturity is the only multiplier that reaches 0, for a deprecated or retired rule. Memories that are not rules have maturity 1.
Sources and assumptions
Build a pack yourself.
Set a profile and a budget, and see what ee's rule packs.
$ ee pack "prepare the v0.20 release" --profile balanced --max-tokens 800 --explain
Profile
Selection
Candidates · ranked by relevance
select one to see its arithmetic
Why · m04 · 62 tokens · procedural:rule:release
- gain = 0.75 × 0.87 − 0.25 × 0.95 = 0.415
- max similarity 0.95 with m01 (same diversity key procedural:rule:release)
- room for 30 of its 62 tokens under the procedural_rules quota, and the preview tier (20%) was spent: a link, “Memory m04”, 14 tokens, in the peripheral index
Budget spent
680 / 800
- procedural_rules224/240
- decisions160/160
- failures160/160
- evidence108/160
- artifacts28/80
Items
14
6 full · 3 preview · 5 link
Omitted
5
each with a reason
Avg relevance
0.70
of what was chosen
Near-duplicates in
1 / 3
redundancy lowers gain
Sources and assumptions
Six questions every item answers.
ee why and ee pack --explain show the full detail.01
Why selected?
Score components for each stage of the pipeline.
02
What supports it?
Provenance URIs back to the session, file or command.
03
How fresh?
The recency term: a 30-day time constant, floored at 0.5, the same for every level.
04
How reliable?
Confidence, evidence count, and the weight of harmful feedback.
05
What scores mattered?
The final score, its kind, a normalized relevance, and the raw breakdown.
06
What would change it?
A counterfactual hint, when there is one.
Relevance scores rank results; they are not probabilities that a result answers the task. When results exist, ee reports retrieval quality as unknown rather than inventing a number, because score size, result count and interval coverage do not establish that an answer is correct. Judge a memory by its content and its evidence.
README, “Explainable Retrieval”
A pack hash that reproduces.
The bytes behind a pack's hash.
A pack's hash is a BLAKE3 digest of ten component digests (nine when the pack leaves out its skipped list), each over labeled fields. The first version fed a provenance's uri and note as raw adjacent bytes, so two different packs could get the same hash. Edit the fields below; the digests are BLAKE3, computed in your browser.
Pack A
Bytes fed to the hash
10 bytes · blake3
08c2db064656d895354dc8141e164f10869474e638ae198fe5acf14b9a087d81
Pack B
Bytes fed to the hash
10 bytes · blake3
08c2db064656d895354dc8141e164f10869474e638ae198fe5acf14b9a087d81
Scores, quantized before hashing
Every score the hash consumes is first rounded to Q20.12 fixed point (round(x × 4096) as a u32), so floating-point noise far below a quantum (1/4096 ≈ 0.000244) usually leaves the bytes, and the hash, unchanged. The exception is two scores on either side of a half-step: they round to different quanta however close they are.
Score A (f32)
0.75
× 4096 = 3072.0000
Score B (f32)
0.75000006
× 4096 = 3072.0002
Q20.12 A
3072
00 0c 00 00
Q20.12 B
3072
00 0c 00 00 · same bytes
Guaranteed
- Same source and index snapshots, config, profile, budget, seed, query and decision inputs: ties resolve the same way and the pack hash reproduces.
- The composite is built from tagged component digests, so the component two packs differ in can be found.
Not yet
- Selection itself still compares raw f32 scores.
- v7 does not yet establish cross-process or cross-host determinism gates (ADR 0087).