-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: make _storage a folder * feat: add neo4j backend * fix: remove test coverage for neo4j * refactor: dspy extraction * docs: update neo4j * fix: neo4j return clusters in node_data * tests: fix test wrong with clusters node data * improve coverage of llm
- 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.