Skip to content

FalkorDriver rejects group_id values containing escaped underscores (\\_) that Neo4jDriver accepts — backend portability gap in 0.29.0 #1465

Description

@bluwavesd

Summary

FalkorDriver (graphiti-core 0.29.0, falkordb 1.6.1) rejects group_id values that Neo4jDriver accepts. Specifically, when add_episode() triggers entity-extraction and an entity name contains a backslash-escaped underscore (\_), FalkorDB writes fail with:

group_id "\_" must contain only alphanumeric characters, dashes, or underscores

The same chunks ingest cleanly into a Neo4j substrate (verified: 1871 entities + 679 episodics with the same corpus + same code-path on the Neo4j-backed instance).

Reproducer

Setup:

  • graphiti-core 0.29.0
  • falkordb 1.6.1, redis 7.4.0
  • LLM: gpt-4o-mini via OpenRouter
  • Embedder: Ollama nomic-embed-text
  • Cluster: FalkorDB v4.18.3 (docker run falkordb/falkordb:v4.18.3)

Behavior:

  1. Build Graphiti(graph_driver=FalkorDriver(host=..., port=6379), llm_client=..., embedder=...)
  2. Walk a corpus of markdown files (any chunk whose LLM-extracted entity names contain \_ or other backslash-escape patterns common in markdown)
  3. Call await g.add_episode(name=chunk.id, episode_body=chunk.text, source=EpisodeType.text, source_description=chunk.source_path, reference_time=...) per chunk
  4. Observe: ~60% of chunks fail with the group_id regex error; the same code path against Graphiti(uri=neo4j_uri, user=..., password=..., ...) ingests them cleanly

Diagnosis (best guess)

Somewhere in the entity-extraction → write-to-graph path, group_id is being derived from extracted entity names without backslash sanitization. Neo4jDriver accepts \_ as a group_id; FalkorDriver validates against a stricter regex (alphanumeric + dash + underscore only, no backslash) and rejects.

The backslash-escape commonly originates from markdown source: \_internal\_var\_ etc. that the LLM extracts verbatim into entity names.

Expected behavior

Either:

  • (a) FalkorDriver matches Neo4jDriver's permissiveness on group_id (loosen FalkorDB validation regex)
  • (b) graphiti-core sanitizes group_id consistently across drivers before write (probably the right answer — backend-portability layer)

Impact

  • Cross-backend swap from Neo4j → FalkorDB (advertised as a drop-in env-var change in some downstream docs) actually fails ~60% of corpus ingest at scale
  • Forces fall-back to Neo4j until upstream fix
  • Breaks the substrate-portability promise that motivates graphiti-core's multi-driver architecture

Workaround

We're falling back to Graphiti(uri=..., user=..., password=...) (Neo4jDriver) for v1.1 production. Will retry FalkorDriver swap once a fix lands.

Environment

  • Python 3.11
  • graphiti-core 0.29.0
  • falkordb 1.6.1
  • neo4j 6.x (working, baseline)
  • FalkorDB v4.18.3 server

Filed as part of BluWave's BRAIN-6 evaluation (collective-memory MCP tool over a fleet-skills corpus). Happy to provide a minimal failing repro script if useful — let me know what shape works for triage.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions