Summary
When the LLM extraction path produces entities or edges with nested Map/List attributes (e.g. a dict of lists, or a list of dicts), writing them to Neo4j via the bulk path raises:
Neo.ClientError.Statement.TypeError
Property values can only be of primitive types or arrays thereof.
Encountered: Map{...}
and the whole build_communities / bulk-add call fails. The Kuzu backend already handles this case by serializing attributes — Neo4j needs the same treatment.
Reproduction
Any extraction that yields a nested attribute. Minimal example: an entity whose extracted attributes look like {"metadata": {"tags": ["x", "y"]}} or {"history": [{"year": 2020, "event": "..."}]}.
Expected
Nested attributes round-trip through Neo4j without crashing the write, matching the Kuzu backend's behavior.
Actual
Neo4j rejects the write because attributes are currently spread as individual node properties instead of serialized.
Proposed fix
I've opened #1109 with a fix that serializes attributes to JSON for the Neo4j write path (mirroring what bulk_utils.py already does for Kuzu) and updates the read path to transparently handle both JSON strings and the legacy dict format, so existing data keeps working. The PR has been waiting for review since December — happy to rebase or adjust the approach if there's a different direction you'd prefer.
Summary
When the LLM extraction path produces entities or edges with nested
Map/Listattributes (e.g. a dict of lists, or a list of dicts), writing them to Neo4j via the bulk path raises:and the whole
build_communities/ bulk-add call fails. The Kuzu backend already handles this case by serializing attributes — Neo4j needs the same treatment.Reproduction
Any extraction that yields a nested attribute. Minimal example: an entity whose extracted attributes look like
{"metadata": {"tags": ["x", "y"]}}or{"history": [{"year": 2020, "event": "..."}]}.Expected
Nested attributes round-trip through Neo4j without crashing the write, matching the Kuzu backend's behavior.
Actual
Neo4j rejects the write because attributes are currently spread as individual node properties instead of serialized.
Proposed fix
I've opened #1109 with a fix that serializes attributes to JSON for the Neo4j write path (mirroring what
bulk_utils.pyalready does for Kuzu) and updates the read path to transparently handle both JSON strings and the legacy dict format, so existing data keeps working. The PR has been waiting for review since December — happy to rebase or adjust the approach if there's a different direction you'd prefer.