✨ feat(user-memory): synthesise a holistic Profile.summary instead of copying the first fact#1
Open
LoveS0ph1e wants to merge 1 commit into
Conversation
6261c81 to
d953a50
Compare
… copying the first fact Rebased onto targeting + HARD RULE anti-bloat (PRs EverMind-AI#2 + EverMind-AI#3). Profile.summary was a verbatim copy of the first explicit_info description: the extraction prompts never requested a summary, and _build_summary just returned explicit_info[0]. With this change the prompts request a short paragraph summary, _resolve_summary prefers it, and _build_summary returns "" as the intentional empty fallback — downstream synthesis handles the true holistic portrait. Additive and backward-compatible: callers and prompt overrides that omit summary keep the previous behaviour, and all existing tests pass with updated assertions.
d953a50 to
0b09e68
Compare
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.
Summary
ProfileExtractorcurrently setsProfile.summaryto a verbatim copy of the firstexplicit_infodescription. For a field namedsummary, that surprises downstream consumers, who reasonably expect a short holistic paragraph.This makes
summarya genuine holistic summary, additively and backward-compatibly.What changed
Prompts (
prompts/{en,zh}/profile.py): the three prompts — INIT, UPDATE, COMPACT — now request a holisticsummaryas a short paragraph that synthesises the defining characteristics. The paragraph format is informed by production experience: a single sentence proved too abstract to capture character nuance and relationship tone; the downstream overall-impression synthesis layer independently reached the same conclusion after months of real-world use.Extractor (
profile.py): a new_resolve_summary(candidate, explicit, implicit)prefers the model'ssummaryand returns""when it is absent, blank, or non-string. Wired into all three paths (INIT / UPDATE / COMPACT)._build_summarynow returns""— it no longer copies the first description. Copying a single fact as the summary misled every downstream consumer (verified in production: a 214-byte music-preference paragraph labelled "summary"). Holistic summaries belong to the caller's synthesis layer.Backward compatibility
summary(or a blank / non-string one),Profile.summaryis"".Profile.summaryisstr(non-Optional); all downstream consumers handle empty strings safely.Tests (24 total)
""_resolve_summaryunit tests_build_summaryalways returns""Merge order note: These three PRs modify overlapping prompt sections. Suggested merge order: #3 (anti-bloat) → #2 (target-aware) → #1 (summary). Happy to rebase whichever is needed after the earlier ones land.