Skip to content

✨ feat(user-memory): synthesise a holistic Profile.summary instead of copying the first fact#1

Open
LoveS0ph1e wants to merge 1 commit into
EverMind-AI:mainfrom
LoveS0ph1e:feat/user-memory-holistic-profile-summary
Open

✨ feat(user-memory): synthesise a holistic Profile.summary instead of copying the first fact#1
LoveS0ph1e wants to merge 1 commit into
EverMind-AI:mainfrom
LoveS0ph1e:feat/user-memory-holistic-profile-summary

Conversation

@LoveS0ph1e

@LoveS0ph1e LoveS0ph1e commented Jun 27, 2026

Copy link
Copy Markdown

Summary

ProfileExtractor currently sets Profile.summary to a verbatim copy of the first explicit_info description. For a field named summary, that surprises downstream consumers, who reasonably expect a short holistic paragraph.

This makes summary a genuine holistic summary, additively and backward-compatibly.

What changed

  • Prompts (prompts/{en,zh}/profile.py): the three prompts — INIT, UPDATE, COMPACT — now request a holistic summary as 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's summary and returns "" when it is absent, blank, or non-string. Wired into all three paths (INIT / UPDATE / COMPACT).

  • _build_summary now 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

  • If the model returns no summary (or a blank / non-string one), Profile.summary is "". Profile.summary is str (non-Optional); all downstream consumers handle empty strings safely.

Tests (24 total)

  • INIT / UPDATE / COMPACT prefer the model's summary / fall back to ""
  • _resolve_summary unit tests
  • _build_summary always returns ""
  • All existing tests pass with updated fallback assertions

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.

@LoveS0ph1e LoveS0ph1e force-pushed the feat/user-memory-holistic-profile-summary branch 4 times, most recently from 6261c81 to d953a50 Compare July 2, 2026 04:05
… 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.
@LoveS0ph1e LoveS0ph1e force-pushed the feat/user-memory-holistic-profile-summary branch from d953a50 to 0b09e68 Compare July 2, 2026 04:12
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