-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add lightrag support (#474) bump:patch
* feat: add lightrag support * docs: update README
- Loading branch information
Showing
6 changed files
with
477 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .graph_index import GraphRAGIndex | ||
from .light_graph_index import LightRAGIndex | ||
from .nano_graph_index import NanoGraphRAGIndex | ||
|
||
__all__ = ["GraphRAGIndex", "NanoGraphRAGIndex"] | ||
__all__ = ["GraphRAGIndex", "NanoGraphRAGIndex", "LightRAGIndex"] |
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,26 @@ | ||
from typing import Any | ||
|
||
from ..base import BaseFileIndexRetriever | ||
from .graph_index import GraphRAGIndex | ||
from .lightrag_pipelines import LightRAGIndexingPipeline, LightRAGRetrieverPipeline | ||
|
||
|
||
class LightRAGIndex(GraphRAGIndex): | ||
def _setup_indexing_cls(self): | ||
self._indexing_pipeline_cls = LightRAGIndexingPipeline | ||
|
||
def _setup_retriever_cls(self): | ||
self._retriever_pipeline_cls = [LightRAGRetrieverPipeline] | ||
|
||
def get_retriever_pipelines( | ||
self, settings: dict, user_id: int, selected: Any = None | ||
) -> list["BaseFileIndexRetriever"]: | ||
_, file_ids, _ = selected | ||
retrievers = [ | ||
LightRAGRetrieverPipeline( | ||
file_ids=file_ids, | ||
Index=self._resources["Index"], | ||
) | ||
] | ||
|
||
return retrievers |
Oops, something went wrong.