neo4j.exceptions.CypherTypeError:
Environment: 1、neo4j Version:5.27.0 Edition:community 2、python3.11 3、graphiti_core0.10.5
Error: neo4j.exceptions.CypherTypeError: {code: Neo.ClientError.Statement.TypeError} {message: Property values can only be of primitive types or arrays thereof. Encountered: Map{summary -> Map{description -> String("The customer is experiencing an issue with their Allbirds shoes, specifically the sole coming off after only 2 months of use. They have reached out to support for assistance and have been asked to provide their order number."), title -> String("Summary"), type -> String("string")}}.}
I checked the prompt and found that the node's summary is a dictionary placed inside the node's attributes. Below is a JSON snippet generated by the final node, where you can see the nested dictionary:
summary='', attributes={'properties': {'summary': {'description': 'A customer reported an issue with their Allbirds shoes, stating that the sole is coming off after only 2 months of use. The customer contacted support for assistance and was asked to provide their order number.', 'title': 'Summary', 'type': 'string'}}, 'required': ['summary'], 'title': 'EntityAttributes', 'type': 'object'}),
Here is a snippet of the system prompt:
\n\nRespond with a JSON object in the following format:\n\n{"properties": {"summary": {"description": "Summary containing the important information about the entity. Under 500 words", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "EntityAttributes", "type": "object"}'}]
Which LLM are you using?
I used the DashScope model qwen-turbo-latest and encountered the same problem.
Graphiti makes heavy use of structured outputs. If the model is incapable of reliably outputting the required format, Graphiti will error out in this way. Please see the note here: https://help.getzep.com/graphiti/graphiti/installation#openai-compatible-llm-providers