Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Python-related files
__pycache__/
__pycache__
*.py[cod]
*.egg-info/
.eggs/
Expand Down Expand Up @@ -67,9 +67,10 @@ lightrag-dev/
gui/

# unit-test files
test_*
# test_*

# Cline files
memory-bank
memory-bank/
.clinerules
throwaway
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
345 changes: 202 additions & 143 deletions README.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions lightrag/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ async def get_edges_by_chunk_ids(self, chunk_ids: list[str]) -> list[dict]:
return all_edges

@abstractmethod
async def upsert_node(self, node_id: str, node_data: dict[str, str]) -> None:
async def upsert_node(
self, node_id: str, node_data: dict[str, str | int | float]
) -> None:
"""Insert a new node or update an existing node in the graph.

Importance notes for in-memory storage:
Expand All @@ -575,7 +577,10 @@ async def upsert_node(self, node_id: str, node_data: dict[str, str]) -> None:

@abstractmethod
async def upsert_edge(
self, source_node_id: str, target_node_id: str, edge_data: dict[str, str]
self,
source_node_id: str,
target_node_id: str,
edge_data: dict[str, str | int | float],
) -> None:
"""Insert a new edge or update an existing edge in the graph.

Expand Down
7 changes: 7 additions & 0 deletions lightrag/kg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"PGGraphStorage",
"MongoGraphStorage",
"MemgraphStorage",
"KuzuDBStorage",
# "AGEStorage",
# "TiDBGraphStorage",
# "GremlinStorage",
],
"required_methods": ["upsert_node", "upsert_edge"],
},
Expand Down Expand Up @@ -53,6 +57,8 @@
"Neo4JStorage": ["NEO4J_URI", "NEO4J_USERNAME", "NEO4J_PASSWORD"],
"MongoGraphStorage": [],
"MemgraphStorage": ["MEMGRAPH_URI"],
"KuzuDBStorage": [],
# "TiDBGraphStorage": ["TIDB_USER", "TIDB_PASSWORD", "TIDB_DATABASE"],
"AGEStorage": [
"AGE_POSTGRES_DB",
"AGE_POSTGRES_USER",
Expand Down Expand Up @@ -101,6 +107,7 @@
"FaissVectorDBStorage": ".kg.faiss_impl",
"QdrantVectorDBStorage": ".kg.qdrant_impl",
"MemgraphStorage": ".kg.memgraph_impl",
"KuzuDBStorage": ".kg.kuzu_impl",
}


Expand Down
Loading