MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / BaseGraphStorage

Class BaseGraphStorage

LightRAG/lightrag/base.py:90–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89@dataclass
90class BaseGraphStorage(StorageNameSpace):
91 embedding_func: EmbeddingFunc = None
92
93 async def has_node(self, node_id: str) -> bool:
94 raise NotImplementedError
95
96 async def has_edge(self, source_node_id: str, target_node_id: str) -> bool:
97 raise NotImplementedError
98
99 async def node_degree(self, node_id: str) -> int:
100 raise NotImplementedError
101
102 async def edge_degree(self, src_id: str, tgt_id: str) -> int:
103 raise NotImplementedError
104
105 async def get_node(self, node_id: str) -> Union[dict, None]:
106 raise NotImplementedError
107
108 async def get_edge(
109 self, source_node_id: str, target_node_id: str
110 ) -> Union[dict, None]:
111 raise NotImplementedError
112
113 async def get_node_edges(
114 self, source_node_id: str
115 ) -> Union[list[tuple[str, str]], None]:
116 raise NotImplementedError
117
118 async def upsert_node(self, node_id: str, node_data: dict[str, str]):
119 raise NotImplementedError
120
121 async def upsert_edge(
122 self, source_node_id: str, target_node_id: str, edge_data: dict[str, str]
123 ):
124 raise NotImplementedError
125
126 async def delete_node(self, node_id: str):
127 raise NotImplementedError
128
129 async def embed_nodes(self, algorithm: str) -> tuple[np.ndarray, list[str]]:
130 raise NotImplementedError("Node embedding is not used in lightrag.")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected