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
graphify query: punctuation in search terms breaks node matching #978
graphify query, graphify path, and graphify explain all fail to match nodes when the search term contains punctuation (e.g. ?, !, ., ,, :).
Root Cause
In serve.py line 309, _query_graph_text tokenizes the question by simply splitting on whitespace:
python terms = [t.lower() for t in question.split() if len(t) > 2]
This means a search for "authentication?" stays as "authentication?" and never matches a node with label "Authentication" or "auth_service".
The same issue affects _find_node (line 328), which is used by graphify path and graphify explain - if the user passes "Authentication?" as an argument, the ? prevents matching.
Example
`�ash
graphify query "how does the authentication work?"
Searches for ["how", "does", "authentication?", "work?"]
"authentication?" never matches node "Authentication" or "auth_service"
Falls back to unrelated nodes matching shorter terms
graphify query "how does the authentication work"
Works correctly - matches "Authentication", "auth_service" nodes
`
Suggested Fix
In serve.py, strip punctuation from each term before matching. Change line 309 from:
python terms = [t.lower() for t in question.split() if len(t) > 2]
to:
python import re terms = [re.sub(r'[^\w\s]', '', t).lower() for t in question.split() if len(t) > 2]
A similar cleanup should be applied in _find_node for the label parameter.
Fixed in 0.8.21 — _search_tokens now strips punctuation from search terms in _query_terms, _score_nodes, and _find_node, so queries like "what calls extract?" correctly match the extract node (#994).
Activity
safishamsi commentedon May 27, 2026
Fixed in 0.8.21 —
_search_tokensnow strips punctuation from search terms in_query_terms,_score_nodes, and_find_node, so queries like"what calls extract?"correctly match theextractnode (#994).