feat(recall): entity-scoped language ranking over purpose adjuncts - #179
Merged
Merged
Conversation
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>
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>
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
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-language —
looksWhichLanguageQuery(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 whenlanguage_answeris set.A first 180 that also skipped leftover covering on
date_focuswas 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 docsc1aa732. Fast-forwarded toorigin/dev. Do not FFmain.Multi-ingest: not this PR. Frozen tenant
diag-mh-135stays skip-ingest-only. Next ingest uses a new tenant after an S1 compiler change. Do not ingest intodiag-mh-135.149/180 is not 90% (162/180) and is not a public LoCoMo / Mem0 claim.
Changes
internal/memory/planner.go—looksWhichLanguageQuery; hops for those queries; no hop-compose dump.internal/memory/recall.go—languageAnswerFromHops+ hybrid/covering lock; capitalized name-like objects; per-token when-event search union. No leftover-covering skip ondate_focus.internal/memory/hop_executor.go— recover matrix language-learning slots onto the activity hop.Test plan
gofmtclean on touched filesgo test ./internal/memory/(green)/recallon:18100tenantdiag-mh-135:conv-43-q163German (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).main.Linear / tracking
Risk / follow-ups
diag-mh-135.