Problem
When build_fulltext_query in falkordb_driver.py receives a query where all words are filtered out as stopwords, sanitized_query becomes an empty string. The method still constructs the full query string, producing:
(@group_id:"standups") ()
The trailing () is invalid RediSearch syntax and causes FalkorDB to throw:
RediSearch: Syntax error at offset 24 near standups
This error surfaces during graphiti.add_episode() when graphiti internally searches for existing nodes to merge with, and the extracted entity name consists entirely of stopwords.
Steps to reproduce
- Use a FalkorDB-backed Graphiti instance with a
group_id set (e.g. "standups")
- Ingest an episode where the LLM extracts an entity whose name is composed entirely of RediSearch stopwords
- Graphiti calls
build_fulltext_query with that entity name — all words are stripped, sanitized_query = ""
- The method constructs
"(@group_id:\"standups\") ()" and passes it to FalkorDB
- FalkorDB raises a syntax error
Fix
Add a guard for the empty-query case before constructing full_query:
if not sanitized_query:
return ''
Insert this before the existing max_query_length check in build_fulltext_query (~line 419 in falkordb_driver.py).
Version
graphiti-core: 0.28.2
- FalkorDB driver
Problem
When
build_fulltext_queryinfalkordb_driver.pyreceives a query where all words are filtered out as stopwords,sanitized_querybecomes an empty string. The method still constructs the full query string, producing:The trailing
()is invalid RediSearch syntax and causes FalkorDB to throw:This error surfaces during
graphiti.add_episode()when graphiti internally searches for existing nodes to merge with, and the extracted entity name consists entirely of stopwords.Steps to reproduce
group_idset (e.g."standups")build_fulltext_querywith that entity name — all words are stripped,sanitized_query = """(@group_id:\"standups\") ()"and passes it to FalkorDBFix
Add a guard for the empty-query case before constructing
full_query:Insert this before the existing
max_query_lengthcheck inbuild_fulltext_query(~line 419 infalkordb_driver.py).Version
graphiti-core: 0.28.2