Skip to content

Commit

Permalink
feat: include light rag build in Docker (#475) #none
Browse files Browse the repository at this point in the history
* feat: update docker build for lightrag

* feat: update docker build

* feat: update docker build
  • Loading branch information
taprosoft authored Nov 7, 2024
1 parent aeace96 commit 42a5cbd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ RUN --mount=type=ssh \
pip install -e "libs/kotaemon[adv]" \
&& pip install unstructured[all-docs]

# Install lightRAG
ENV USE_LIGHTRAG=true
RUN --mount=type=ssh \
--mount=type=cache,target=/root/.cache/pip \
pip install aioboto3 nano-vectordb ollama xxhash lightrag-hku

# Clean up
RUN apt-get autoremove \
&& apt-get clean \
Expand Down
37 changes: 20 additions & 17 deletions flowsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,29 +289,32 @@
USE_NANO_GRAPHRAG = config("USE_NANO_GRAPHRAG", default=False, cast=bool)
USE_LIGHTRAG = config("USE_LIGHTRAG", default=False, cast=bool)

GRAPHRAG_INDEX_TYPES = ["ktem.index.file.graph.GraphRAGIndex"]

if USE_NANO_GRAPHRAG:
GRAPHRAG_INDEX_TYPE = "ktem.index.file.graph.NanoGraphRAGIndex"
GRAPHRAG_INDEX_TYPES.append("ktem.index.file.graph.NanoGraphRAGIndex")
elif USE_LIGHTRAG:
GRAPHRAG_INDEX_TYPE = "ktem.index.file.graph.LightRAGIndex"
else:
GRAPHRAG_INDEX_TYPE = "ktem.index.file.graph.GraphRAGIndex"
GRAPHRAG_INDEX_TYPES.append("ktem.index.file.graph.LightRAGIndex")

KH_INDEX_TYPES = [
"ktem.index.file.FileIndex",
GRAPHRAG_INDEX_TYPE,
*GRAPHRAG_INDEX_TYPES,
]

GRAPHRAG_INDEX = {
"name": GRAPHRAG_INDEX_TYPE.split(".")[-1].replace("Index", ""), # get last name
"config": {
"supported_file_types": (
".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, "
".pptx, .csv, .html, .mhtml, .txt, .md, .zip"
),
"private": False,
},
"index_type": GRAPHRAG_INDEX_TYPE,
}
GRAPHRAG_INDICES = [
{
"name": graph_type.split(".")[-1].replace("Index", ""), # get last name
"config": {
"supported_file_types": (
".png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx, "
".pptx, .csv, .html, .mhtml, .txt, .md, .zip"
),
"private": False,
},
"index_type": graph_type,
}
for graph_type in GRAPHRAG_INDEX_TYPES
]

KH_INDICES = [
{
Expand All @@ -325,5 +328,5 @@
},
"index_type": "ktem.index.file.FileIndex",
},
GRAPHRAG_INDEX,
*GRAPHRAG_INDICES,
]

0 comments on commit 42a5cbd

Please sign in to comment.