Feature add tigergraph support#2315
Open
alexander-belikov wants to merge 10 commits intoHKUDS:mainfrom
Open
Conversation
danielaskdd
requested changes
Nov 6, 2025
| def _search_labels(): | ||
| try: | ||
| # Get all vertices and filter | ||
| vertices = self._conn.getVertices(workspace_label, limit=100000) |
Collaborator
There was a problem hiding this comment.
Querying via traversal is inefficient and not recommended.
| def _get_popular_labels(): | ||
| try: | ||
| # Get all vertices and calculate degrees | ||
| vertices = self._conn.getVertices(workspace_label, limit=100000) |
Collaborator
There was a problem hiding this comment.
Querying via traversal is inefficient and not recommended.
| edges_dict[node_id] = edges if edges is not None else [] | ||
| return edges_dict | ||
|
|
||
| async def get_nodes_by_chunk_ids(self, chunk_ids: list[str]) -> list[dict]: |
Collaborator
There was a problem hiding this comment.
get_nodes_by_chunk_ids is deprecated
|
|
||
| return await asyncio.to_thread(_get_nodes_by_chunk_ids) | ||
|
|
||
| async def get_edges_by_chunk_ids(self, chunk_ids: list[str]) -> list[dict]: |
Collaborator
There was a problem hiding this comment.
get_edges_by_chunk_ids is deprecated
Collaborator
|
Thank you for your contribution and your interest in LightRAG. At this stage, we are not merging new storage implementations into the main branch. As LightRAG is undergoing rapid iteration, maintaining multiple backends introduces significant overhead in compatibility testing, performance tuning, and data migration, which currently exceeds our team's operational capacity. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
This PR adds TigerGraph as a new graph storage backend option for LightRAG, expanding the available graph database integrations alongside existing options (Neo4j, Memgraph, PostgreSQL, MongoDB, NetworkX).
Changes Made
1. New TigerGraph Storage Implementation (
lightrag/kg/tigergraph_impl.py)New file: Complete implementation of
TigerGraphStorageclass extendingBaseGraphStorageAll abstract methods implemented:
has_node,get_node,get_nodes_batch,upsert_node,delete_node,remove_nodeshas_edge,get_edge,get_edges_batch,upsert_edge,remove_edgesget_node_edges,get_nodes_edges_batch,get_knowledge_graphnode_degree,node_degrees_batch,edge_degree,edge_degrees_batchget_all_labels,get_popular_labels,search_labelsget_nodes_by_chunk_ids,get_edges_by_chunk_idsget_all_nodes,get_all_edgesinitialize,finalize,index_done_callback,dropKey features:
pyTigerGraphPython driver with async wrappers (asyncio.to_thread)TIGERGRAPH_URItenacityfor write operations2. Storage Registry Updates (
lightrag/kg/__init__.py)TigerGraphStoragetoGRAPH_STORAGEimplementations listTIGERGRAPH_URI,TIGERGRAPH_USERNAME,TIGERGRAPH_PASSWORD"TigerGraphStorage": ".kg.tigergraph_impl"3. Configuration Examples
env.example: Added TigerGraph configuration section with:TIGERGRAPH_URI(default:http://localhost:9000)TIGERGRAPH_USERNAME(default:tigergraph)TIGERGRAPH_PASSWORD(required)TIGERGRAPH_GRAPH_NAME(default:lightrag)TIGERGRAPH_WORKSPACE(optional, for workspace override)config.ini.example: Added[tigergraph]section with corresponding configuration optionsImplementation Details
entity_idas vertex primary key (STRING type)entity_type,description,keywords,source_idwith dynamic attribute supportasyncio.to_thread()for async compatibilityget_data_init_lock()andget_graph_db_lock()for thread-safe initializationChecklist
Additional Notes
Testing Requirements
http://localhost:9000Dependencies
pyTigerGraph:Install viapip install -e ".[offline-storage]"or automatically installed viapipmasterCompatibility
Potential Future Enhancements
Known Limitations
get_nodes_batch) iterate through nodes sequentially due to TigerGraph API limitations