Conversation
Signed-off-by: share121 <me@s121.top>
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
Each profile item persists two 768-dimension embeddings (
centroidandanchor) that are only used internally for similarity, dedup and drift detection. Both thememorytool'sprofilemode andGET /api/user-profileserialized the rawprofileData, so they shipped those vectors to callers. A populated profile (18 items: 8 preferences + 8 patterns + 2 workflows) serialized to ~591 KB, which exceeded the tool-output limit and got truncated — theprofileresult was unusable and burned model context (observed as a truncated ~594 KB tool response).This change strips
centroid/anchorfrom serialized profile data. The vectors are still stored and used internally; they are only removed from what leaves the process.Changes
src/services/user-profile/profile-utils.ts: addstripProfileEmbeddings(data)that deletescentroid/anchorfrom every item inpreferences/patterns/workflows.src/index.ts: apply it to theprofileread branch of thememorytool.src/services/api-handlers.ts(handleGetUserProfile): apply it to the API response that feeds the Web UI.tests/profile-utils.test.ts: cover stripping across all three item types plus missing/malformed sections.Testing
bun test tests/profile-utils.test.ts— 2 passbunx tsc(build) — cleanbun test— 465 pass / 2 fail; both failures are Windows-environment only and unrelated to this change:tests/onnxruntime-resolve.test.ts—EPERMcreating a symlinktests/turso-legacy-migrator.test.ts—EBUSYunlinking a locked db filebunx prettier --checkon the changed files — cleanGET /api/user-profilereturns 4,812 bytes with nocentroid; memory search still returns the expected results.Notes