Skip to content

feat(recall): entity-scoped language ranking over purpose adjuncts - #179

Merged
cursor[bot] merged 7 commits into
devfrom
pr/s2-entity-learning-language-1e9e
Aug 26, 2026
Merged

cursor[bot] merged 7 commits into
devfrom
pr/s2-entity-learning-language-1e9e

Conversation

@sdntsng

@sdntsng sdntsng commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Skip-ingest in-store product after P65 (148/180). Hybrid was answering Spanish for “Which language is Tim learning?” because compiler-misbound purpose adjuncts (“app to learn Spanish”, “interested in learning Spanish”) and John’s Spanish crowded Tim’s matrix fact “Tim is learning German”.

Approach: generic product ranking, not leftover-covering detectors and not a language/country dictionary.

Which-languagelooksWhichLanguageQuery (which/what + language + learn/study). Bind to the query person. Rank matrix “is learning X” above purpose adjuncts. One-token objects must appear capitalized next to a learn/study verb so “studying hard”, “during the week of”, and “into intervals of” cannot beat German. Lock hybrid and leftover covering when language_answer is set.

A first 180 that also skipped leftover covering on date_focus was 143/180 unique 1/6 (German gained; six temporal when-answers lost). That skip is reverted. Per-token when-event search union stays. Leftover covering still replaces bare dates (bowling vs adopt).

Pin: skip-ingest 180 p68 149/180 unique 1/0. Product SHA 205c47d, pin docs c1aa732. Fast-forwarded to origin/dev. Do not FF main.

Multi-ingest: not this PR. Frozen tenant diag-mh-135 stays skip-ingest-only. Next ingest uses a new tenant after an S1 compiler change. Do not ingest into diag-mh-135.

149/180 is not 90% (162/180) and is not a public LoCoMo / Mem0 claim.

Changes

  • internal/memory/planner.golooksWhichLanguageQuery; hops for those queries; no hop-compose dump.
  • internal/memory/recall.golanguageAnswerFromHops + hybrid/covering lock; capitalized name-like objects; per-token when-event search union. No leftover-covering skip on date_focus.
  • internal/memory/hop_executor.go — recover matrix language-learning slots onto the activity hop.
  • Pin docs: P66 149/180 artifact, README row, cycle-closeout section.
  • Tests: Tim German vs Spanish adjunct + John’s Spanish + studying-hard + week-of + interval adjuncts; hybrid cannot overwrite German; bowling/adopt leftover covering still holds.

Test plan

  • gofmt clean on touched files
  • go test ./internal/memory/ (green)
  • Live /recall on :18100 tenant diag-mh-135: conv-43-q163 German (language_answer). P65 holds: q48 Nov 16, q65 journey, q78 who-told, q79 Deborah Yes, Jolene not Yes, q39, q22, food-set q18/q37, soda/candy, collars/tags, tricks, Maria dogs, Jolene snakes. q24 remains tournament leftover (same as P65).
  • Skip-ingest 180 p67 with date_focus covering skip: 143/180 unique 1/6. Not a pin. Skip reverted.
  • Skip-ingest 180 p68 language-only: 149/180 unique 1/0. Pin. Do not FF main.

Linear / tracking

  • ENG-176 (MH / LoCoMo S2), parent ENG-168

Risk / follow-ups

Open in Web Open in Cursor 

sdntsng and others added 6 commits August 26, 2026 17:19
Which/what language+learn/study queries bind to the query person and
prefer "is learning X" / value_norm learning-X over "to learn X",
app-for, and interested-in. One slot. No language dictionary. Hybrid
and leftover covering cannot replace a typed language_answer.

Co-authored-by: aria <aria@engramhq.com>
dateAnswerFromHops returns the pick score. When score>0, set date_focus
and skip leftoverCoveringBareDateMissesEvent so a scored event date is
not replaced by a leftover line that merely shares a token. Score-0
hop dates (bowling vs adopt) still yield. Search when-event focus by
union of tokens so FTS AND of query verbs cannot drop organizing/party
lines.

Co-authored-by: aria <aria@engramhq.com>
Matrix language ranking tied with adverb objects ("studying hard") and
preferred the shorter token, so live /recall returned Hard instead of
German. Ground one-token objects in a capitalized source word next to a
learn/study verb; drop adverb/indefinite thin objects; do not tie-break
by length.

Co-authored-by: aria <aria@engramhq.com>
"Tim was studying during the week of …" parsed as learn-object
"during week of" (title-cased During Week Of) and tied with German.
Stop object extraction at during/after/before/about so week-of
studying cannot outrank matrix "is learning X".

Co-authored-by: aria <aria@engramhq.com>
Adjunct tails ("studying into intervals of", "during the week of")
were tying with matrix "is learning German" because multi-word objects
skipped the proper-noun check. Every learn-object token must appear
capitalized in source; prefer a one-token name when scores tie.

Co-authored-by: aria <aria@engramhq.com>
Skip-ingest 180 after date_focus skip was 143/180 unique 1/6 vs P65
148. Language ranking uniquely flipped Tim German; skipping leftover
covering whenever a focus-scored hop date existed replaced six
event-named when-answers with bare/wrong hop dates. Keep leftover
covering on bare dates (bowling vs adopt). Keep per-token when-event
search union.

Co-authored-by: aria <aria@engramhq.com>
@cursor cursor Bot changed the title feat(recall): entity-scoped language ranking and focus-dated when-answers feat(recall): entity-scoped language ranking over purpose adjuncts Aug 26, 2026
Skip-ingest 180 on frozen diag-mh-135: 149/180 unique 1/0 vs P65 148.
Unique gain conv-43-q163 German. date_focus leftover-covering skip 180
was 143/180 unique 1/6 and is not this pin.

Co-authored-by: aria <aria@engramhq.com>
@cursor
cursor Bot merged commit c1aa732 into dev Aug 26, 2026
2 checks passed
@sdntsng
sdntsng deployed to dev - brainy-worker-staging August 26, 2026 18:17 — with Render Active
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