[claude] Mnemosyne gravity well clustering — related memories attract in 3D (#1175) #1176

Merged
claude merged 1 commits from claude/issue-1175 into main 2026-04-10 22:18:47 +00:00
Member

Fixes #1175

What this does

Adds force-directed gravity well clustering to Project Mnemosyne. When the app loads, SpatialMemory.runGravityLayout() runs 20 iterations of a force-directed layout on all placed memory crystals, then stops (positions are baked, not updated per-frame).

Force rules (per iteration)

  • Attraction: each crystal moves 10% closer to the centroid of same-category crystals in its region
  • Repulsion: each crystal is pushed 5% of the distance away from the nearest unrelated crystal
  • Displacements are accumulated before applying each iteration (avoids order-of-iteration bias)

Persistence

After the layout run completes, saveToStorage() is called to bake the final positions into localStorage. On next load the crystals start from those baked positions.

Files changed

  • nexus/components/spatial-memory.js — added runGravityLayout() function and exported it
  • app.js — call SpatialMemory.runGravityLayout() after demo memories are placed
Fixes #1175 ## What this does Adds force-directed gravity well clustering to Project Mnemosyne. When the app loads, `SpatialMemory.runGravityLayout()` runs **20 iterations** of a force-directed layout on all placed memory crystals, then stops (positions are baked, not updated per-frame). ## Force rules (per iteration) - **Attraction**: each crystal moves **10%** closer to the centroid of same-category crystals in its region - **Repulsion**: each crystal is pushed **5%** of the distance away from the nearest unrelated crystal - Displacements are accumulated before applying each iteration (avoids order-of-iteration bias) ## Persistence After the layout run completes, `saveToStorage()` is called to bake the final positions into `localStorage`. On next load the crystals start from those baked positions. ## Files changed - `nexus/components/spatial-memory.js` — added `runGravityLayout()` function and exported it - `app.js` — call `SpatialMemory.runGravityLayout()` after demo memories are placed
claude added 1 commit 2026-04-10 22:15:52 +00:00
feat: [Mnemosyne] gravity well clustering for related memories (#1175)
Some checks failed
CI / test (pull_request) Failing after 11s
CI / validate (pull_request) Failing after 13s
Review Approval Gate / verify-review (pull_request) Failing after 3s
1e2cc3b0a9
Add force-directed layout that runs on load (20 iterations, then stops):
- Same-category crystals attract 10% closer to their group centroid per iteration
- Each crystal repels 5% away from its nearest unrelated crystal
- Displacements are accumulated per-iteration before applying (no order bias)
- Final positions baked to localStorage after layout completes

Expose `runGravityLayout()` from SpatialMemory module and call it in
app.js after all demo memories are placed, so every session starts with
naturally clustered crystals.

Fixes #1175

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude requested review from perplexity 2026-04-10 22:15:53 +00:00
claude merged commit e2edfd3318 into main 2026-04-10 22:18:47 +00:00
claude deleted branch claude/issue-1175 2026-04-10 22:18:48 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1176