Skip to content

fix(falkordb): escape group_ids in RediSearch fulltext queries#1175

Merged
prasmussen15 merged 1 commit intogetzep:mainfrom
Milofax:fix/redisearch-group-id-escaping
Feb 5, 2026
Merged

fix(falkordb): escape group_ids in RediSearch fulltext queries#1175
prasmussen15 merged 1 commit intogetzep:mainfrom
Milofax:fix/redisearch-group-id-escaping

Conversation

@Milofax
Copy link
Contributor

@Milofax Milofax commented Jan 25, 2026

Summary

  • Group IDs like "main" are reserved words in RediSearch and cause syntax errors when used unquoted
  • Group IDs with hyphens (e.g., "project-name") also need escaping
  • This fix wraps all group_ids in double quotes in the fulltext query

Before: (@group_id:main|project-name)
After: (@group_id:"main"|"project-name")

Problem

Intermittent errors like:

RediSearch: Syntax error at offset 20 near main

Solution

Simple 4-line fix in graphiti_core/driver/falkordb_driver.py:

escaped_group_ids = [f'"{gid}"' for gid in group_ids]
group_values = '|'.join(escaped_group_ids)

Test plan

  • Tested with group_id "main" - no more syntax errors
  • Tested with group_id "Milofax-infrastructure" - works correctly
  • Tested with multiple group_ids - proper OR query generated

🤖 Generated with Claude Code

Group IDs like "main" are reserved words in RediSearch and cause
syntax errors when used unquoted. Similarly, group IDs with hyphens
(e.g., "project-name") need escaping.

This fix wraps all group_ids in double quotes in the fulltext query:
- Before: (@group_id:main|project-name)
- After:  (@group_id:"main"|"project-name")

Fixes intermittent "RediSearch: Syntax error at offset 20 near main"
errors when searching with group_id filters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Milofax
Copy link
Contributor Author

Milofax commented Jan 25, 2026

Hi team! 👋

Just wanted to follow up on my open PRs. I have 7 PRs waiting for review:

Bug Fixes (high priority):

Features:

The CI workflows are waiting for approval to run. Would really appreciate if someone could approve them when you get a chance!

Happy to address any feedback or make changes as needed. Thanks! 🙏

@prasmussen15 prasmussen15 merged commit 45882dd into getzep:main Feb 5, 2026
10 checks passed
@getzep getzep locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants