fix(graph_dbs): sanitize nested metadata before Neo4j writes#1178
Conversation
|
This PR addresses the root cause described in #1172 and partially in #1122. The existing This PR adds a universal sanitization step that catches all remaining cases. |
2fc7a17 to
d954e4e
Compare
d954e4e to
760a8e7
Compare
4b3865d
into
MemTensor:dev-20260323-v2.0.11
|
Hey @kyan-du, thanks so much for this fix! |
|
Hey @kyan-du! Thanks for the contribution — already merged your PR, thanks for putting this together! 🚀 Btw if you enjoyed contributing and want to stay connected with the project, we run a Discord server for contributors, a chill space to discuss features, ask questions, or pick up new issues 👉🏻 MemOS Discord Server (Contributor Exclusive) Thanks again for shipping this, and happy MemOSing 🧠✨ |
Summary
Problem
Neo4j node properties only accept primitive values or arrays of primitives. Some MemOS flows (especially SkillMemory and feedback-related flows) can produce nested metadata like:
scripts: dictothers: dictinfoThose values can reach
SET n += $metadataand trigger errors like:Property values can only be of primitive types or arrays thereofCypherTypeError: Map{} encounteredFix
This PR adds a small sanitization layer before Neo4j writes:
This keeps metadata readable while making it safe for Neo4j property storage.
Validation
/product/addflow successfully createdSkillMemorywithout the previous Neo4jMap{}error