Notebooks
M
Mistral AI
Property Graph Neo4j

Property Graph Neo4j

mistral-cookbookLlamaIndexthird_partypropertygraphs

PropertyGraph using Neo4j

In this notebook we will demonstrate building PropertyGraph using Neo4j

Neo4j is a production-grade graph database that excels in storing property graphs, performing vector searches, filtering, and more.

The simplest way to begin is by using a cloud-hosted instance through Neo4j Aura. However, for the purposes of this notebook, we will focus on how to run the database locally using Docker.

[ ]

Docker Setup

You need to login and set password for the first time.

  1. username: neo4j

  2. password: neo4j

[ ]

Setup

[1]
[2]
[3]

Download Data

[ ]

Load Data

[4]

Index Construction

[5]
Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.FeatureDeprecationWarning} {category: DEPRECATION} {title: This feature is deprecated and will be removed in future versions.} {description: The procedure has a deprecated field. ('config' used by 'apoc.meta.graphSample' is deprecated.)} {position: line: 1, column: 1, offset: 0} for query: "CALL apoc.meta.graphSample() YIELD nodes, relationships RETURN nodes, [rel in relationships | {name:apoc.any.property(rel, 'type'), count: apoc.any.property(rel, 'count')}] AS relationships"
[6]
/Users/ravithejad/Desktop/llamaindex/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
Parsing nodes: 100%|██████████| 1/1 [00:00<00:00, 27.19it/s]
Extracting paths from text: 100%|██████████| 22/22 [00:42<00:00,  1.92s/it]
Generating embeddings: 100%|██████████| 40/40 [00:13<00:00,  2.86it/s]
Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.FeatureDeprecationWarning} {category: DEPRECATION} {title: This feature is deprecated and will be removed in future versions.} {description: The procedure has a deprecated field. ('config' used by 'apoc.meta.graphSample' is deprecated.)} {position: line: 1, column: 1, offset: 0} for query: "CALL apoc.meta.graphSample() YIELD nodes, relationships RETURN nodes, [rel in relationships | {name:apoc.any.property(rel, 'type'), count: apoc.any.property(rel, 'count')}] AS relationships"
[7]

Retrievers

[10]

Querying

Retrieving

[16]
Yahoo -> Bought -> Viaweb in 1998
Hacker news -> Source of stress for -> Author
Author -> Wrote -> Yc's internal software in arc
Author -> Advised by -> Robert morris to not make yc the last cool thing
Author -> Decided to hand yc over to -> Sam altman
Author -> Worked on -> Writing essays and yc
Viaweb -> Software -> Works via the web
Robert morris -> Showed -> World wide web

QueryEngine

[17]
[ ]