Objective
Answering "Who founded the company that makes the iPhone?" requires linking three entities — product, company, person — across two hops. RAG with vector search alone struggles here because relevant facts are spread over multiple documents. A small knowledge graph answers it deterministically with one Cypher pattern, the foundation of any production KG-RAG system.
Step 1: Create the graph
// People
MERGE (steve_jobs:Person {name: "Steve Jobs", born: 1955})
MERGE (woz:Person {name: "Steve Wozniak", born: 1950})
MERGE (ronald:Person {name: "Ronald Wayne", born: 1934})
MERGE (gates:Person {name: "Bill Gates", born: 1955})
MERGE (allen:Person {name: "Paul Allen", born: 1953})
MERGE (musk:Person {name: "Elon Musk", born: 1971})
MERGE (tarpenning:Person {name: "Marc Tarpenning", born: 1964})
MERGE (eberhard:Person {name: "Martin Eberhard", born: 1960})
MERGE (bezos:Person {name: "Jeff Bezos", born: 1964})
MERGE (page:Person {name: "Larry Page", born: 1973})
MERGE (brin:Person {name: "Sergey Brin", born: 1973})
// Companies
MERGE (apple:Company {name: "Apple", founded: 1976, hq: "Cupertino"})
MERGE (msft:Company {name: "Microsoft", founded: 1975, hq: "Redmond"})
MERGE (tesla:Company {name: "Tesla", founded: 2003, hq: "Austin"})
MERGE (amazon:Company {name: "Amazon", founded: 1994, hq: "Seattle"})
MERGE (google:Company {name: "Google", founded: 1998, hq: "Mountain View"})
// Products
MERGE (iphone:Product {name: "iPhone", launched: 2007})
MERGE (mac:Product {name: "Mac", launched: 1984})
MERGE (windows:Product {name: "Windows", launched: 1985})
MERGE (modelS:Product {name: "Model S", launched: 2012})
MERGE (kindle:Product {name: "Kindle", launched: 2007})
MERGE (search:Product {name: "Google Search", launched: 1998})
// Founder edges
MERGE (steve_jobs)-[:FOUNDED]->(apple)
MERGE (woz)-[:FOUNDED]->(apple)
MERGE (ronald)-[:FOUNDED]->(apple)
MERGE (gates)-[:FOUNDED]->(msft)
MERGE (allen)-[:FOUNDED]->(msft)
MERGE (musk)-[:FOUNDED]->(tesla)
MERGE (tarpenning)-[:FOUNDED]->(tesla)
MERGE (eberhard)-[:FOUNDED]->(tesla)
MERGE (bezos)-[:FOUNDED]->(amazon)
MERGE (page)-[:FOUNDED]->(google)
MERGE (brin)-[:FOUNDED]->(google)
// Make edges
MERGE (apple)-[:MAKES]->(iphone)
MERGE (apple)-[:MAKES]->(mac)
MERGE (msft)-[:MAKES]->(windows)
MERGE (tesla)-[:MAKES]->(modelS)
MERGE (amazon)-[:MAKES]->(kindle)
MERGE (google)-[:MAKES]->(search);