Skip to content

✨ feat(agent-memory): preserve contrastive insights in skill consolidation - #7

Open
JadeeeZh wants to merge 1 commit into
EverMind-AI:mainfrom
JadeeeZh:feat/agent-memory-contrastive-skill-consolidation
Open

✨ feat(agent-memory): preserve contrastive insights in skill consolidation#7
JadeeeZh wants to merge 1 commit into
EverMind-AI:mainfrom
JadeeeZh:feat/agent-memory-contrastive-skill-consolidation

Conversation

@JadeeeZh

Copy link
Copy Markdown

Problem

AGENT_SKILL_SUCCESS_EXTRACT_PROMPT consolidates a cluster's majority pattern. When most cases in a cluster succeeded via the standard checklist, the minority lessons carried by failed-then-corrected cases (root causes the standard checks missed) get averaged away — even when every individual AgentCase.key_insight states them correctly.

We hit this on a τ²-bench telecom support benchmark: 74 support calls consolidated into skills whose steps dropped the decisive correction entirely, and one skill even codified the trap as a decision branch — literally If roaming enabled → proceed, when the failed cases showed that check passing while the problem persisted. Case layer: lesson present (150 mentions). Skill layer: gone.

Change (prompt-only, domain-agnostic)

  • New GOOD-skill criterion: preserve hard-won corrections that distinguish look-alike situations.
  • New "Contrastive insight preservation" hard rules:
    • failure-derived root-cause checks must appear as Steps/Decision branches (not only Pitfalls) and survive later condensation;
    • no if <check> passes → proceed branch when any case shows <check> passing while the problem persisted;
    • look-alike variants require an explicit discriminator, not just both fixes listed;
    • capabilities governed by multiple independent controls are verified per control.
  • Pitfall cap 4 → 6, and failure-derived pitfalls can no longer be evicted by generic advice.
  • Update-op guidance: contrastive checks and failure-derived pitfalls are load-bearing — preserve or strengthen, never summarize away.

No API, schema, or output-format changes; the JSON operation contract and placeholders are untouched. CHANGELOG [Unreleased] updated.

Validation

A/B on τ²-bench telecom (same 74 recorded train calls replayed through the pipeline, same models/seeds, only this prompt differing), 40 held-out tasks vs a no-memory baseline:

stock prompt this prompt
Held-out resolution 50% (20/40) 62% (25/40)
Paired vs baseline 2 wins / 2 losses 6 wins / 1 loss
vs stock-prompt arm (same tasks) 5 wins / 0 losses

5 of the 6 wins are exactly the failure family the stock prompt had flattened; the consolidated skills retain the correction after all 74 incremental updates. Honest caveats: n=40, discordant pairs 6:1 (one-sided binomial p≈0.063) — directionally strong, below conventional significance; the benchmark is one domain.

Tests

  • uv run pytest packages/everalgo-agent-memory/tests — 275 passed
  • uv run ruff check / ruff format --check — clean
  • The only test touching this constant monkeypatches it, so no content assertions were affected.

🤖 Generated with Claude Code

…ation

The success-path consolidation prompt summarizes the majority pattern of a
cluster, so the minority lessons carried by failed-then-corrected cases get
averaged away — in one benchmark the consolidated skill even codified the
exact trap as a decision branch ("if <check> passes -> proceed").

Add domain-agnostic hard rules: failure-derived root-cause checks must land
in Steps/Decision branches and survive condensation; no "passes -> proceed"
branch when a case contradicts it; look-alike variants need an explicit
discriminator; independently-controlled capabilities are verified per
control. Pitfall cap 4 -> 6, failure-derived pitfalls protected.

Validated on tau2-bench telecom (74 train calls -> 40 held-out): resolution
50% -> 62% vs an otherwise identical pipeline; the wins concentrate on the
exact failure family the stock prompt had flattened.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant