Every session starts from zero.
A new agent session re-learns the project's conventions, re-reads what an earlier session already read, and repeats failures an earlier one already hit, because nothing those sessions learned was kept where it could be found.
Without memory, session six repeats session two's mistake.
The same repository, with and without a memory.
- Useful work
- Re-discovering conventions
- Re-reading the same files
- Hitting a trap
- ee pack · 4k-token budget
- Recalled · preflight warned
Sess
01
No memory
Hits a trap: the migration test needs a fresh DB
With ee
Hits it too, then records it as a rule
Sess
02
No memory
Hits the migration trap again
With ee
The rule is in the pack, so it avoids the trap
Sess
03
No memory
Hits a trap: tagging before the changelog lands
With ee
Hits a new trap that no memory covers yet
Sess
04
No memory
Hits the migration trap again
With ee
Preflight recalls the rule before the test
Sess
05
No memory
Hits the tagging trap again
With ee
Preflight on git tag recalls the lesson
Sess
06
No memory
Hits the migration trap again
With ee
Rule recalled; most of the session goes to the task
Useful work · no memory
42%
6 traps hit in 6 sessions
Useful work · with ee
75%
2 traps hit: only the new ones
In memory
4 lessons
Each is written once with ee remember and can be packed in any later session.
Sources and assumptions
What happens as the notes file grows.
What a session gets from a notes file, a vector store and ee.
Week 52 · 520 lessons written · 139 now stale · 49 true lessons apply to “fix a flaky test”
- On-task and true
- True, off-task
- Repeats an earlier line
- Stale or contradicted
- Empty slot
Notes fileCLAUDE.md · AGENTS.md
Every line goes into every session, on-task or off. The file has been trimmed 4 times, stale and repeated lines first, and the trims have deleted 201 lessons that were still true.
8,000 tokens
- Useful
- 16%
- Stale
- 5
- Repeats
- 3
- Missed
- 23
- Deleted
- 201
Vector storetop 80 by similarity
Returns up to 80 chunks, the ones most similar to the task. The score does not mark a chunk as stale or as a repeat, and the store keeps no record of what it left out.
4,000 tokens
- Useful
- 38%
- Stale
- 27
- Repeats
- 12
- Missed
- 19
- Listed
- none
ee pack--max-tokens 4000
Strict MMR fills at most 4,000 tokens of memory text and demotes repeats. Lessons ee has detected as stale are excluded. The 20 candidates it left out are listed, each with a reason, in
data.pack.skipped[].10,400 tokens · 6,400 of metadata
- Useful
- 41%
- Stale
- 5
- Repeats
- 8
- Missed
- 16
- Listed
- 20
Useful: on-task, true and not a repeat. Missed: true lessons about this task that the session does not have. Deleted: true lessons the file's trims have removed so far. Listed: candidates the lane reports as left out.
- Notes file
- Vector store
- ee pack
- File trimmed
Tokens a session
8,000 · 4,000 · 10,400
Ranking. The vector store and ee's search use the same similarity score here, so both miss the on-task lessons it scores low. Top-k has no record of which lessons went stale or repeat one already in the session, so it passes them through.
Token cost. ee's budget counts only the memories' own text. In markdown, each item also lists its id, why it was chosen, its trust class and its provenance, about 80 tokens here. A smaller --max-tokens gives a smaller pack.
Keeping AGENTS.md. ee export agentsmd writes the primer's rules and warnings into a marker-delimited block of AGENTS.md, 600 tokens by default. It never edits outside its markers. ee diag agentsmd-drift reports where the file and the memory disagree.
Sources and assumptions
ee is a command the harness calls.
Agents write evidence to ee and read context from it.
Push in · writes
Pull out · reads
readtouches source of truth · index · graph
ee pack "<task>" --workspace . --max-tokens 4000 --format markdownAssembles a token-budgeted context pack; every item carries an evidence pointer and a score breakdown.
The harness keeps its tools, approvals and prompt loop; ee stores memory and answers queries. The dashed boxes are derived data: if the index is lost, ee index rebuild regenerates it from the source of truth.
Sources and assumptions
The basic loop in five commands.
- 1
Open a workspace
ee init --workspace .Idempotent. The store is FrankenSQLite under .ee/; indexes beside it are derived and rebuildable.
- 2
Teach it a rule
ee remember "Run cargo fmt --check before tagging a release." \ --workspace . --level procedural --kind rule --jsonText that looks like a secret is refused with exit 7, and the error says where it matched. A memory written this way starts in the human_explicit trust class.
- 3
Hand the next session a pack
ee pack "prepare the release" --workspace . \ --max-tokens 4000 --format markdownRules, decisions, failures and evidence that match the task, within the budget, each with provenance and a score.
- 4
Say what helped
ee outcome <memory-id> --workspace . --signal helpful \ --reason "caught the unformatted file before the tag"Feedback moves the memory's posterior. Harmful counts 2.5 times as much as helpful.
- 5
Ask why
ee why <memory-id> --workspace . --jsonWhere a memory came from, what supports it, how fresh and how trusted it is, and what would change its rank.