Function extractQueryEntities

  • Extract candidate entity strings from a query. Matches the Mem0-v3-style regex extractor used at ingest time so query and fact entities use the same canonicalization.

    Captures:

    • Capitalized words ≥ 3 characters (proper nouns: "Berlin", "Docker", "TypeScript")
    • Double-quoted strings ("hello world")
    • Single-quoted strings ('like this')

    Returns deduplicated entity strings preserving original casing (case-sensitive comparison happens upstream).

    Parameters

    • text: string

    Returns string[]