You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory: catch contradictions in other languages and long sentences #95
Contradiction detection ("moved to Bengaluru" vs "lives in Pune") pairs facts by subject and attribute using English keyword families, and the subject must appear in the first few words. It misses other languages and sentences like "Last year in March, after the wedding, Riya ...".
Where: sentient/memory/facts.py (subject and attribute helpers) and sentient/memory/dreaming.py. Tests: tests/memory/test_related_facts.py.
Done when: the approach generalises (for example embedding-based attribute matching with the keyword families as a fast path) and tests cover at least one non-English example.
fact_subjects (sentient/memory/facts.py): rewrite the word tokenizer to be Unicode-category-aware instead of ASCII-only, so names in Devanagari, Cyrillic, CJK etc. are recognized at all. Scripts without a case distinction (Devanagari, CJK, ...) can't use capitalization as the "this looks like a name" signal, so any non-skip word there is accepted as a candidate. Also fixes two bugs on the way: capitalized month names ("March") were being mistaken for a person's name, and the function gave up entirely on the first unrecognized lowercase word, which is exactly what broke the issue's long-sentence example.
attribute_families: keeps the English keyword regexes as the fast path (unchanged, zero cost for existing English facts), with a new embedding-based fallback (embedding_attribute_families / profile_fact_async) used only when the keyword families come back empty - typically non-English text. Wired into the live dedup path and DreamingService.contradiction_pairs (the nightly consolidation pass).
New tests cover a Hindi (Devanagari) example and the long-sentence case from the issue.
Activity
anushkaanair commentedon Oct 13, 2026
I'd like to pick this up. Plan:
fact_subjects(sentient/memory/facts.py): rewrite the word tokenizer to be Unicode-category-aware instead of ASCII-only, so names in Devanagari, Cyrillic, CJK etc. are recognized at all. Scripts without a case distinction (Devanagari, CJK, ...) can't use capitalization as the "this looks like a name" signal, so any non-skip word there is accepted as a candidate. Also fixes two bugs on the way: capitalized month names ("March") were being mistaken for a person's name, and the function gave up entirely on the first unrecognized lowercase word, which is exactly what broke the issue's long-sentence example.attribute_families: keeps the English keyword regexes as the fast path (unchanged, zero cost for existing English facts), with a new embedding-based fallback (embedding_attribute_families/profile_fact_async) used only when the keyword families come back empty - typically non-English text. Wired into the live dedup path andDreamingService.contradiction_pairs(the nightly consolidation pass).PR incoming.