feat: integrate nano-graphrag (#433)
* add nano graph-rag * ignore entities for relevant context reference * refactor and add local model as default nano-graphrag * feat: add kotaemon llm & embedding integration with nanographrag * fix: add env var for nano GraphRAG --------- Co-authored-by: Tadashi <tadashi@cinnamon.is>
This commit is contained in:
@@ -284,11 +284,43 @@ SETTINGS_REASONING = {
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
USE_NANO_GRAPHRAG = config("USE_NANO_GRAPHRAG", default=False, cast=bool)
|
||||
GRAPHRAG_INDEX_TYPE = (
|
||||
"ktem.index.file.graph.GraphRAGIndex"
|
||||
if not USE_NANO_GRAPHRAG
|
||||
else "ktem.index.file.graph.NanoGraphRAGIndex"
|
||||
)
|
||||
KH_INDEX_TYPES = [
|
||||
"ktem.index.file.FileIndex",
|
||||
"ktem.index.file.graph.GraphRAGIndex",
|
||||
GRAPHRAG_INDEX_TYPE,
|
||||
]
|
||||
|
||||
GRAPHRAG_INDEX = (
|
||||
{
|
||||
"name": "GraphRAG",
|
||||
"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": "ktem.index.file.graph.GraphRAGIndex",
|
||||
}
|
||||
if not USE_NANO_GRAPHRAG
|
||||
else {
|
||||
"name": "NanoGraphRAG",
|
||||
"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": "ktem.index.file.graph.NanoGraphRAGIndex",
|
||||
}
|
||||
)
|
||||
|
||||
KH_INDICES = [
|
||||
{
|
||||
"name": "File",
|
||||
@@ -301,15 +333,5 @@ KH_INDICES = [
|
||||
},
|
||||
"index_type": "ktem.index.file.FileIndex",
|
||||
},
|
||||
{
|
||||
"name": "GraphRAG",
|
||||
"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": "ktem.index.file.graph.GraphRAGIndex",
|
||||
},
|
||||
GRAPHRAG_INDEX,
|
||||
]
|
||||
|
Reference in New Issue
Block a user