forked from gusye1234/nano-graphrag
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from gusye1234/main
feat: add Neo4j graph backend (gusye1234#61)
- Loading branch information
Showing
26 changed files
with
1,111 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
1. Install [Neo4j](https://neo4j.com/docs/operations-manual/current/installation/) | ||
2. Install Neo4j GDS (graph data science) [plugin](https://neo4j.com/docs/graph-data-science/current/installation/neo4j-server/) | ||
3. Start neo4j server | ||
4. Get the `NEO4J_URL`, `NEO4J_USER` and `NEO4J_PASSWORD` | ||
- By default, `NEO4J_URL` is `neo4j://localhost:7687` , `NEO4J_USER` is `neo4j` and `NEO4J_PASSWORD` is `neo4j` | ||
|
||
Pass your neo4j instance to `GraphRAG`: | ||
|
||
```python | ||
from nano_graphrag import GraphRAG | ||
from nano_graphrag._storage import Neo4jStorage | ||
|
||
neo4j_config = { | ||
"neo4j_url": os.environ.get("NEO4J_URL", "neo4j://localhost:7687"), | ||
"neo4j_auth": ( | ||
os.environ.get("NEO4J_USER", "neo4j"), | ||
os.environ.get("NEO4J_PASSWORD", "neo4j"), | ||
) | ||
} | ||
GraphRAG( | ||
graph_storage_cls=Neo4jStorage, | ||
addon_params=neo4j_config, | ||
) | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .gdb_networkx import NetworkXStorage | ||
from .gdb_neo4j import Neo4jStorage | ||
from .vdb_hnswlib import HNSWVectorStorage | ||
from .vdb_nanovectordb import NanoVectorDBStorage | ||
from .kv_json import JsonKVStorage |
Oops, something went wrong.