AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Oct 14, 2026, 22:00 JST

SCHEMA wins in Neo4j SimpleKGPipeline test

SCHEMA wins in Neo4j SimpleKGPipeline test

3 Key Points

  1. What happened

    Maru ran Neo4j GraphRAG for Python's SimpleKGPipeline on the same cookbook.md, which holds curry rice and nikujaga recipes, under FREE, EXTRACTED, and SCHEMA settings on Neo4j 2026.07.1 and gpt-oss-20b.

  2. Why it matters

    Only the human-defined SCHEMA captured the links the author cared about: which step uses which ingredient and the order of the cooking steps.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The test deliberately held the LLM and chunking constant, changing only how the schema was supplied. To split by recipe rather than a fixed size, the author wrote an H1MarkdownTextSplitter that cuts the Markdown at each H1 heading, so the curry rice and nikujaga sections become one chunk each. The same two recipes include shared ingredients — beef, onion, carrot, potato — which gave the comparison a way to see whether those shared links and the cooking sequence were represented.

The results followed a clear pattern. FREE, with no schema, produced near-duplicate node types for the same object and multiple relationship types meaning similar things, leaving text-to-Cypher queries uncertain about which type to pick. EXTRACTED made type names more consistent because the LLM inferred one schema from the whole document, but it did not model which step uses which ingredient or the order between steps, so process-oriented questions stayed unanswerable. SCHEMA, with human-defined node types, relationship types, and patterns such as Recipe-REQUIRES_INGREDIENT->Ingredient and Step-NEXT_STEP->Step, let the author traverse shared ingredients and step order. Even so, across repeated runs with the same schema and input, node names varied, suggesting a residual constraint common to all three modes.

FAQ
What is Neo4j GraphRAG for Python?
It is Neo4j's official Python library for GraphRAG, offering text chunking, LLM-based entity and relationship extraction, and writing to Neo4j, with SimpleKGPipeline as a packaged pipeline.
What are the three schema modes in SimpleKGPipeline?
FREE uses no schema, EXTRACTED has the LLM infer a schema, and SCHEMA has a human predefine node types, relationship types, and connection patterns.
What caused inconsistent results even with SCHEMA?
The schema guides graph structure, but which information becomes an entity or relationship and how it is named depends on the LLM, so repeated runs with the same input did not match exactly.

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleGemini skills, not ChatGPT GPTs: 30分 no-code agent guide