Going from text to Cypher ends up with a disconnected graph that's all over the place. Thus, we need to provide some modelling guidance to the LLM. Here's an approach that seems to work.
Applying a 2 stage approach.
Stage 1 modelling_nodes.md, semi-manual top-down analysis using the full text with LLM to establish constraints to the graph model. Particularly limiting the node types. Do this once.
Stage 2 modelling_relations.md, using the node types from Stage 1, apply a series of guided reasoning prompts to parse each paragraph into Cypher. Iterate this over every paragraph one at a time.
Going from text to Cypher ends up with a disconnected graph that's all over the place. Thus, we need to provide some modelling guidance to the LLM. Here's an approach that seems to work.
Applying a 2 stage approach.
Stage 1
modelling_nodes.md
, semi-manual top-down analysis using the full text with LLM to establish constraints to the graph model. Particularly limiting the node types. Do this once.Stage 2
modelling_relations.md
, using the node types from Stage 1, apply a series of guided reasoning prompts to parse each paragraph into Cypher. Iterate this over every paragraph one at a time.