---
title: "Comment by Aamer Mehaisi on \"Building a Knowledge Graph Locally with Neo4j & Ollama\" | Hashnode"
description: "This is a fantastic walkthrough for anyone looking to bridge the gap between unstructured text and graph databases. A few thoughts: The schema-first approach yo"
url: "https://hashnode.com/posts/building-a-knowledge-graph-locally-with-neo4j-and-ollama/680617ce149b5afce9abae94/comment/69cbe30da85ec1e5d24edd8a"
---

[Discussion](https://hashnode.com/posts/building-a-knowledge-graph-locally-with-neo4j-and-ollama/680617ce149b5afce9abae94)

Comment [Building a Knowledge Graph Locally with Neo4j & Ollama](https://hashnode.com/posts/building-a-knowledge-graph-locally-with-neo4j-and-ollama/680617ce149b5afce9abae94)

[Aamer Mehaisi](https://hashnode.com/@mehaisi)

[Mar 31](https://hashnode.com/posts/building-a-knowledge-graph-locally-with-neo4j-and-ollama/680617ce149b5afce9abae94/comment/69cbe30da85ec1e5d24edd8a)

This is a fantastic walkthrough for anyone looking to bridge the gap between unstructured text and graph databases. A few thoughts:

The schema-first approach you demonstrate is crucial - I've seen knowledge graphs fall apart when entity types and relationships aren't well-defined upfront. Your Character/Ship ontology example makes this concrete.

For RAG applications specifically, there's an interesting trade-off between this extraction approach and vector embeddings. Knowledge graphs excel at relationship queries, while vectors handle semantic similarity. Combining both - using the graph for structured traversal and embeddings for fuzzy retrieval - is where things get powerful.

The MERGE vs CREATE distinction you included is a nice touch. In production pipelines, deduplication becomes critical when processing multiple documents that reference the same entities.

One thing I'd add: for larger-scale ingestion, you might want to batch Cypher statements. Each API call has overhead, and batching 100-1000 statements at once can significantly speed up bulk loads.

Thanks for the practical, end-to-end guide - the combination of Neo4j's visualization with a local LLM for extraction is a great pattern that more teams should adopt.
