Skip to content

Memory: catch contradictions in other languages and long sentences #95

Open

Description

@itsskofficial

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.

Activity

  1. added
    enhancement
    help wanted
    area: memory
    on Oct 8, 2026
  2. anushkaanair commented on Oct 13, 2026

    @anushkaanair
    Contributor

    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 and DreamingService.contradiction_pairs (the nightly consolidation pass).
    • New tests cover a Hindi (Devanagari) example and the long-sentence case from the issue.

    PR incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: memoryenhancementhelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions