Skip to the page
Chapter 04 · Learning

It learns from outcomes.

Agents report whether a memory helped or misled them. ee keeps a Bayesian posterior for every memory, promotes it only when the evidence is clear, demotes it faster than it promotes, and does not let an agent's report stand in for a person's.

Read all eight chapters on one page

04.1Bayesian trust classes

A posterior for every memory.

A memory's trust class comes from how it was written: human_explicit for an ordinary ee remember, agent_assertion for a registered agent's attempt-family write, cass_evidence for a line imported from a session. Outcomes move a Beta posterior, and the class changes only when its 90% interval crosses a threshold.
Outcome feedback · a Beta posterior per memory

How outcomes move a memory's trust class.

ee's rule, computed here
Memory starts as
00.250.50.751helpful ratelower > 0.70upper < 0.35mean 0.5

Outcomes, sized by weight

1 2.5

No outcomes yet: the prior, Beta(0.5, 0.5).

α helpful

0.5

β harmful

0.5

Mean

0.5

the legacy confidence

CI90

0.01–0.99

α + β

1

sample-size gate

Helpful outcomes

0

The trust ladder

  1. human_explicit0.85
  2. peer_human_attested0.75
  3. agent_validated0.65
  4. agent_assertion0.5

    Agent claim with no outcome yet

    Promote when

    • CI90 lower > 0.70now 0.006
    • α + β ≥ 6now 1

    Demote when

    • CI90 upper < 0.35now 0.994
  5. cass_evidence0.45
  6. legacy_import0.3

Last class change

None yet. Every change writes a trust_class.transition audit row.

  • Harm weighs 2.5 times

    harmful β + 2.5 · helpful α + 1

    So the mean falls faster than it rises.

  • The 90% interval decides

    Promote when the lower bound clears one threshold, demote when the upper bound falls below another. In between, the class holds.

  • The top class needs a person

    No number of ordinary outcomes reaches human_explicit. It takes --source-type human_explicit, a named --actor and a --reason.

Sources and assumptions
src/core/bayes.rs · Jeffreys prior Beta(0.5, 0.5), helpful α + 1, harmful β + DEFAULT_HARMFUL_WEIGHT (2.5), equal-tailed 90% interval by bisection on I_x(α, β), trust_class_transition (ADR 0032) · src/core/outcome.rs · one transition evaluated per outcome · src/models/trust.rs · initial_confidence. The figure applies every outcome; ee holds a source’s harmful outcomes for review once it passes 5 in an hour (DEFAULT_HARMFUL_PER_SOURCE_PER_HOUR) or a sequential test (SPRT) flags the source.
04.2Failure-to-fix recall

Fixes from past sessions.

ee imports your past agent sessions through cass, finds the failures that were fixed and verified, and keeps each as a short incident card keyed by the error's fingerprint. When that error class appears again, ee diagnose-error or ee pack --error-log returns the fix with its provenance.
CASS import · failure-to-fix recall

Fixes recalled by error fingerprint.

Diagram · not program output

cass-session://ses_01J…7Q · an agent's session, as cass recorded it

A toy in your browser · not ee
  1. L1
    $ cargo test --lib
  2. L2
    error[E0277]: the trait bound `Widget: Serialize` is not satisfied
      --> src/widget.rs:41:9

    the failure

  3. L3
    Let me look at the widget module.

    narration: dropped

  4. L4
    Widget needs to derive Serialize: add #[derive(Serialize)] to the struct.

    the fix

  5. L5
    $ cargo test --lib
  6. L6
    test result: ok. 3 passed; 0 failed

    the proof

ee import cass reads the sessions your agents already recorded. It pairs each failing tool result with the assistant turns that explained the fix and a later successful run of the identical command that proved it.

Only admitted assistant sentences can become the fix. Narration is dropped, and a bare exit code is never an error class on its own.

Sources and assumptions
docs/adr/0091-derived-incident-cards.md · extractive facets, ≤ 120 tokens (INCIDENT_CARD_TOKEN_BUDGET) · src/core/incident_card.rs · header and facet format · src/core/error_recall.rs · canonical_message_template, layered_key · src/core/cass_error_recall_go.rs, cass_error_recall_js_tests.rs · go test and Vitest/Jest diagnostics · the transcripts are shortened, illustrative excerpts; ee parses a test report only when it is complete and its counts agree
04.3No silent memory mutation

Proposed changes go through review.

What ee proposes starts as a reviewable candidate, and applying one writes an audit entry. A person can also tombstone a memory directly, and the decay pass, run with --include-decay, demotes and tombstones on its own; both are audited. No LLM turns a session journal into candidates.
  1. Propose

    Candidates come from journals, imported sessions, consolidation and the steward. Nothing is applied yet.

    ee curate candidates --workspace . --json
  2. Validate

    Each candidate is checked against policy, duplicates and contradictions before anyone can apply it.

    ee curate validate <candidate-id> --workspace . --json
  3. Apply

    Applying writes the change and an audit entry together. Promotions, merges and tombstones are all logged.

    ee curate apply <candidate-id> --workspace . --json
04.4Privacy and trust

Checks on the way in and out.

Anything written to the store can reach every later session. ee refuses to store a memory that contains a secret, screens stored memories for injected instructions before it packs them, and only advises on commands: no ee check can stop the agent from running one. The trust model.

ee remember refuses secrets

Text that looks like an API key, JWT, password, private or SSH key, AWS secret or OAuth token is refused with exit 7, and the error says where it matched. --allow-secret-mention stores it anyway and writes an audit entry. Commands that export take a redaction level from none to paranoid.

Stored instructions are screened

Before packing, stored memories are screened for role overrides, hidden-prompt requests, credential requests and authority claims. A match is omitted with an explanation and kept for inspection.

Preflight only advises

ee preflight looks up the risk history of a command before you run it. It reports what it finds, and the risk it finds does not change its exit code; it does not block the command, and no ee hook denies one.

Imported evidence is committed

Session lines imported since v0.19.0 carry keyed BLAKE3 commitments under the store's root key, so evidence can be checked without keeping raw digests of it.

$ ee remember "DATABASE_URL=postgres://user:hunter2@host/db"
# refused: exit 7, policy_denied, detectedPattern database_url; nothing is written