Skip to content

vec/hyde queries reject hyphenated compound words as negation operators #414

@Q9-Ahimsa

Description

@Q9-Ahimsa

Bug

validateSemanticQuery() in store.js (line ~1612) uses the regex /-\w/ to detect negation syntax in vec/hyde queries. This regex matches any hyphen followed by a word character, which incorrectly rejects compound words like "multi-agent", "role-based", "chain-of-thought", etc.

Reproduction

{"searches": [{"type": "vec", "query": "multi-agent orchestration patterns"}]}

Returns: Negation (-term) is not supported in vec/hyde queries. Use lex for exclusions.

Expected

The query should succeed — "multi-agent" is a compound word, not a negation operator.

Root Cause

// Current (buggy) — matches ANY hyphen + word char
if (/-\w/.test(query) || /-"/.test(query)) {

// Fix — only match hyphens preceded by whitespace or at string start (actual negation syntax)
if (/(?:^|\s)-[\w"]/.test(query)) {

Impact

Particularly acute for AI/ML knowledge bases where hyphenated terms are ubiquitous: multi-agent, few-shot, chain-of-thought, role-based, task-based, state-of-the-art, etc. Vec/hyde queries are essentially unusable for these domains.

Version

v1.1.6, installed via bun

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions