✨ feat(agent-memory): preserve contrastive insights in skill consolidation - #7
Open
JadeeeZh wants to merge 1 commit into
Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AGENT_SKILL_SUCCESS_EXTRACT_PROMPTconsolidates 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 individualAgentCase.key_insightstates 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)
if <check> passes → proceedbranch when any case shows<check>passing while the problem persisted;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:
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 passeduv run ruff check/ruff format --check— clean🤖 Generated with Claude Code