RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Refa: Clean the folders. (#12890)
Kevin Hu32c0161ff10d
diff --git a/CLAUDE.md b/CLAUDE.mdindex d774fc376c..58d1217afe 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -27,7 +27,7 @@ RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on d- **Document Processing**: `deepdoc/` - PDF parsing, OCR, layout analysis- **LLM Integration**: `rag/llm/` - Model abstractions for chat, embedding, reranking- **RAG Pipeline**: `rag/flow/` - Chunking, parsing, tokenization-- **Graph RAG**: `graphrag/` - Knowledge graph construction and querying+- **Graph RAG**: `rag/graphrag/` - Knowledge graph construction and querying### Agent System (`/agent/`)- **Components**: Modular workflow components (LLM, retrieval, categorize, etc.)@@ -113,4 +113,4 @@ RAGFlow supports switching between Elasticsearch (default) and Infinity:- Node.js >=18.20.4- Docker & Docker Compose- uv package manager-- 16GB+ RAM, 50GB+ disk space\ No newline at end of file+- 16GB+ RAM, 50GB+ disk spacediff --git a/Dockerfile b/Dockerfileindex 1da8843435..c1859878ea 100644--- a/Dockerfile+++ b/Dockerfile@@ -192,10 +192,8 @@ COPY conf confCOPY deepdoc deepdocCOPY rag ragCOPY agent agent-COPY graphrag graphragCOPY pyproject.toml uv.lock ./COPY mcp mcp-COPY plugin pluginCOPY common commonCOPY memory memorydiff --git a/plugin/README.md b/agent/plugin/README.mdsimilarity index 98%rename from plugin/README.mdrename to agent/plugin/README.mdindex cd11e91dbc..4f1ac152c1 100644--- a/plugin/README.md+++ b/agent/plugin/README.md@@ -23,7 +23,7 @@ All the execution logic of this tool should go into this method.When you start RAGFlow, you can see your plugin was loaded in the log:```-2025-05-15 19:29:08,959 INFO 34670 Recursively importing plugins from path `/some-path/ragflow/plugin/embedded_plugins`+2025-05-15 19:29:08,959 INFO 34670 Recursively importing plugins from path `/some-path/ragflow/agent/plugin/embedded_plugins`2025-05-15 19:29:08,960 INFO 34670 Loaded llm_tools plugin BadCalculatorPlugin version 1.0.0```diff --git a/plugin/README_zh.md b/agent/plugin/README_zh.mdsimilarity index 98%rename from plugin/README_zh.mdrename to agent/plugin/README_zh.mdindex 17b3dd703d..eb9910ba40 100644--- a/plugin/README_zh.md+++ b/agent/plugin/README_zh.md@@ -23,7 +23,7 @@ RAGFlow将会从`embedded_plugins`子文件夹中递归加载所有的插件。当你启动RAGFlow时,你会在日志中看见你的插件被加载了:```-2025-05-15 19:29:08,959 INFO 34670 Recursively importing plugins from path `/some-path/ragflow/plugin/embedded_plugins`+2025-05-15 19:29:08,959 INFO 34670 Recursively importing plugins from path `/some-path/ragflow/agent/plugin/embedded_plugins`2025-05-15 19:29:08,960 INFO 34670 Loaded llm_tools plugin BadCalculatorPlugin version 1.0.0```diff --git a/plugin/__init__.py b/agent/plugin/__init__.pysimilarity index 100%rename from plugin/__init__.pyrename to agent/plugin/__init__.pydiff --git a/plugin/common.py b/agent/plugin/common.pysimilarity index 100%rename from plugin/common.pyrename to agent/plugin/common.pydiff --git a/plugin/embedded_plugins/llm_tools/bad_calculator.py b/agent/plugin/embedded_plugins/llm_tools/bad_calculator.pysimilarity index 94%rename from plugin/embedded_plugins/llm_tools/bad_calculator.pyrename to agent/plugin/embedded_plugins/llm_tools/bad_calculator.pyindex 04c3b815a3..38376aa984 100644--- a/plugin/embedded_plugins/llm_tools/bad_calculator.py+++ b/agent/plugin/embedded_plugins/llm_tools/bad_calculator.py@@ -1,5 +1,5 @@import logging-from plugin.llm_tool_plugin import LLMToolMetadata, LLMToolPlugin+from agent.plugin.llm_tool_plugin import LLMToolMetadata, LLMToolPluginclass BadCalculatorPlugin(LLMToolPlugin):diff --git a/plugin/llm_tool_plugin.py b/agent/plugin/llm_tool_plugin.pysimilarity index 100%rename from plugin/llm_tool_plugin.pyrename to agent/plugin/llm_tool_plugin.pydiff --git a/plugin/plugin_manager.py b/agent/plugin/plugin_manager.pysimilarity index 100%rename from plugin/plugin_manager.pyrename to agent/plugin/plugin_manager.pydiff --git a/api/apps/plugin_app.py b/api/apps/plugin_app.pyindex 6e7a876901..fb0a7bb610 100644--- a/api/apps/plugin_app.py+++ b/api/apps/plugin_app.py@@ -18,7 +18,7 @@from quart import Responsefrom api.apps import login_requiredfrom api.utils.api_utils import get_json_result-from plugin import GlobalPluginManager+from agent.plugin import GlobalPluginManager@manager.route('/llm_tools', methods=['GET']) # noqa: F821diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.pyindex 1a25a8308d..8a11397e4d 100644--- a/api/db/services/dialog_service.py+++ b/api/db/services/dialog_service.py@@ -35,7 +35,7 @@ from api.db.services.llm_service import LLMBundlefrom common.metadata_utils import apply_meta_data_filterfrom api.db.services.tenant_llm_service import TenantLLMServicefrom common.time_utils import current_timestamp, datetime_format-from graphrag.general.mind_map_extractor import MindMapExtractor+from rag.graphrag.general.mind_map_extractor import MindMapExtractorfrom rag.advanced_rag import DeepResearcherfrom rag.app.tag import label_questionfrom rag.nlp.search import index_namediff --git a/api/db/services/document_service.py b/api/db/services/document_service.pyindex 99e0f0f8fd..4f015ddd58 100644--- a/api/db/services/document_service.py+++ b/api/db/services/document_service.py@@ -1077,7 +1077,7 @@ def doc_upload_and_parse(conversation_id, file_objs, user_id):cks = [c for c in docs if c["doc_id"] == doc_id]if parser_ids[doc_id] != ParserType.PICTURE.value:- from graphrag.general.mind_map_extractor import MindMapExtractor+ from rag.graphrag.general.mind_map_extractor import MindMapExtractormindmap = MindMapExtractor(llm_bdl)try:mind_map = asyncio.run(mindmap([c["content_with_weight"] for c in docs if c["doc_id"] == doc_id]))diff --git a/api/ragflow_server.py b/api/ragflow_server.pyindex 193efff3b2..1beb0cd099 100644--- a/api/ragflow_server.py+++ b/api/ragflow_server.py@@ -41,7 +41,7 @@ from common.versions import get_ragflow_versionfrom common.config_utils import show_configsfrom common.mcp_tool_call_conn import shutdown_all_mcp_sessionsfrom common.log_utils import init_root_logger-from plugin import GlobalPluginManager+from agent.plugin import GlobalPluginManagerfrom rag.utils.redis_conn import RedisDistributedLockstop_event = threading.Event()diff --git a/common/settings.py b/common/settings.pyindex 83415c680a..41ac2f5eb4 100644--- a/common/settings.py+++ b/common/settings.py@@ -317,7 +317,7 @@ def init_settings():global retriever, kg_retrieverretriever = search.Dealer(docStoreConn)- from graphrag import search as kg_search+ from rag.graphrag import search as kg_searchkg_retriever = kg_search.KGSearch(docStoreConn)diff --git a/chat_demo/index.html b/example/chat_demo/index.htmlsimilarity index 100%rename from chat_demo/index.htmlrename to example/chat_demo/index.htmldiff --git a/chat_demo/widget_demo.html b/example/chat_demo/widget_demo.htmlsimilarity index 100%rename from chat_demo/widget_demo.htmlrename to example/chat_demo/widget_demo.htmldiff --git a/rag/app/tag.py b/rag/app/tag.pyindex 8e516a75ff..d43692f612 100644--- a/rag/app/tag.py+++ b/rag/app/tag.py@@ -124,7 +124,7 @@ def chunk(filename, binary=None, lang="Chinese", callback=None, **kwargs):def label_question(question, kbs):from api.db.services.knowledgebase_service import KnowledgebaseService- from graphrag.utils import get_tags_from_cache, set_tags_to_cache+ from rag.graphrag.utils import get_tags_from_cache, set_tags_to_cachetags = Nonetag_kb_ids = []for kb in kbs:diff --git a/graphrag/__init__.py b/rag/graphrag/__init__.pysimilarity index 100%rename from graphrag/__init__.pyrename to rag/graphrag/__init__.pydiff --git a/graphrag/entity_resolution.py b/rag/graphrag/entity_resolution.pysimilarity index 98%rename from graphrag/entity_resolution.pyrename to rag/graphrag/entity_resolution.pyindex ec65e84b70..5639e2a9c7 100644--- a/graphrag/entity_resolution.py+++ b/rag/graphrag/entity_resolution.py@@ -23,12 +23,12 @@ from typing import Any, Callableimport networkx as nx-from graphrag.general.extractor import Extractor+from rag.graphrag.general.extractor import Extractorfrom rag.nlp import is_englishimport editdistance-from graphrag.entity_resolution_prompt import ENTITY_RESOLUTION_PROMPT+from rag.graphrag.entity_resolution_prompt import ENTITY_RESOLUTION_PROMPTfrom rag.llm.chat_model import Base as CompletionLLM-from graphrag.utils import perform_variable_replacements, chat_limiter, GraphChange+from rag.graphrag.utils import perform_variable_replacements, chat_limiter, GraphChangefrom api.db.services.task_service import has_canceledfrom common.exceptions import TaskCanceledExceptiondiff --git a/graphrag/entity_resolution_prompt.py b/rag/graphrag/entity_resolution_prompt.pysimilarity index 100%rename from graphrag/entity_resolution_prompt.pyrename to rag/graphrag/entity_resolution_prompt.pydiff --git a/graphrag/general/__init__.py b/rag/graphrag/general/__init__.pysimilarity index 100%rename from graphrag/general/__init__.pyrename to rag/graphrag/general/__init__.pydiff --git a/graphrag/general/community_report_prompt.py b/rag/graphrag/general/community_report_prompt.pysimilarity index 100%rename from graphrag/general/community_report_prompt.pyrename to rag/graphrag/general/community_report_prompt.pydiff --git a/graphrag/general/community_reports_extractor.py b/rag/graphrag/general/community_reports_extractor.pysimilarity index 95%rename from graphrag/general/community_reports_extractor.pyrename to rag/graphrag/general/community_reports_extractor.pyindex 9a01f98c66..4c616ac5a7 100644--- a/graphrag/general/community_reports_extractor.py+++ b/rag/graphrag/general/community_reports_extractor.py@@ -21,12 +21,12 @@ import pandas as pdfrom api.db.services.task_service import has_canceledfrom common.exceptions import TaskCanceledExceptionfrom common.connection_utils import timeout-from graphrag.general import leiden-from graphrag.general.community_report_prompt import COMMUNITY_REPORT_PROMPT-from graphrag.general.extractor import Extractor-from graphrag.general.leiden import add_community_info2graph+from rag.graphrag.general import leiden+from rag.graphrag.general.community_report_prompt import COMMUNITY_REPORT_PROMPT+from rag.graphrag.general.extractor import Extractor+from rag.graphrag.general.leiden import add_community_info2graphfrom rag.llm.chat_model import Base as CompletionLLM-from graphrag.utils import perform_variable_replacements, dict_has_keys_with_types, chat_limiter+from rag.graphrag.utils import perform_variable_replacements, dict_has_keys_with_types, chat_limiterfrom common.token_utils import num_tokens_from_string@dataclassdiff --git a/graphrag/general/entity_embedding.py b/rag/graphrag/general/entity_embedding.pysimilarity index 94%rename from graphrag/general/entity_embedding.pyrename to rag/graphrag/general/entity_embedding.pyindex 78c7fc31d4..993f8474ec 100644--- a/graphrag/general/entity_embedding.py+++ b/rag/graphrag/general/entity_embedding.py@@ -9,7 +9,7 @@ from typing import Anyimport numpy as npimport networkx as nxfrom dataclasses import dataclass-from graphrag.general.leiden import stable_largest_connected_component+from rag.graphrag.general.leiden import stable_largest_connected_componentimport graspologic as gc@@ -63,4 +63,4 @@ def run(graph: nx.Graph, args: dict[str, Any]) -> dict:pairs = zip(embeddings.nodes, embeddings.embeddings.tolist(), strict=True)sorted_pairs = sorted(pairs, key=lambda x: x[0])- return dict(sorted_pairs)\ No newline at end of file+ return dict(sorted_pairs)diff --git a/graphrag/general/extractor.py b/rag/graphrag/general/extractor.pysimilarity index 99%rename from graphrag/general/extractor.pyrename to rag/graphrag/general/extractor.pyindex 899845a83d..ccb0d3ba8b 100644--- a/graphrag/general/extractor.py+++ b/rag/graphrag/general/extractor.py@@ -26,8 +26,8 @@ import networkx as nxfrom api.db.services.task_service import has_canceledfrom common.connection_utils import timeoutfrom common.token_utils import truncate-from graphrag.general.graph_prompt import SUMMARIZE_DESCRIPTIONS_PROMPT-from graphrag.utils import (+from rag.graphrag.general.graph_prompt import SUMMARIZE_DESCRIPTIONS_PROMPT+from rag.graphrag.utils import (GraphChange,chat_limiter,flat_uniq_list,diff --git a/graphrag/general/graph_extractor.py b/rag/graphrag/general/graph_extractor.pysimilarity index 95%rename from graphrag/general/graph_extractor.pyrename to rag/graphrag/general/graph_extractor.pyindex c769acd941..26caa93f2a 100644--- a/graphrag/general/graph_extractor.py+++ b/rag/graphrag/general/graph_extractor.py@@ -13,9 +13,9 @@ from typing import Anyfrom dataclasses import dataclassimport tiktoken-from graphrag.general.extractor import Extractor, ENTITY_EXTRACTION_MAX_GLEANINGS-from graphrag.general.graph_prompt import GRAPH_EXTRACTION_PROMPT, CONTINUE_PROMPT, LOOP_PROMPT-from graphrag.utils import ErrorHandlerFn, perform_variable_replacements, chat_limiter, split_string_by_multi_markers+from rag.graphrag.general.extractor import Extractor, ENTITY_EXTRACTION_MAX_GLEANINGS+from rag.graphrag.general.graph_prompt import GRAPH_EXTRACTION_PROMPT, CONTINUE_PROMPT, LOOP_PROMPT+from rag.graphrag.utils import ErrorHandlerFn, perform_variable_replacements, chat_limiter, split_string_by_multi_markersfrom rag.llm.chat_model import Base as CompletionLLMimport networkx as nxfrom common.token_utils import num_tokens_from_stringdiff --git a/graphrag/general/graph_prompt.py b/rag/graphrag/general/graph_prompt.pysimilarity index 100%rename from graphrag/general/graph_prompt.pyrename to rag/graphrag/general/graph_prompt.pydiff --git a/graphrag/general/index.py b/rag/graphrag/general/index.pysimilarity index 98%rename from graphrag/general/index.pyrename to rag/graphrag/general/index.pyindex 632d374948..1a43ebe092 100644--- a/graphrag/general/index.py+++ b/rag/graphrag/general/index.py@@ -25,12 +25,12 @@ from api.db.services.task_service import has_canceledfrom common.exceptions import TaskCanceledExceptionfrom common.misc_utils import get_uuidfrom common.connection_utils import timeout-from graphrag.entity_resolution import EntityResolution-from graphrag.general.community_reports_extractor import CommunityReportsExtractor-from graphrag.general.extractor import Extractor-from graphrag.general.graph_extractor import GraphExtractor as GeneralKGExt-from graphrag.light.graph_extractor import GraphExtractor as LightKGExt-from graphrag.utils import (+from rag.graphrag.entity_resolution import EntityResolution+from rag.graphrag.general.community_reports_extractor import CommunityReportsExtractor+from rag.graphrag.general.extractor import Extractor+from rag.graphrag.general.graph_extractor import GraphExtractor as GeneralKGExt+from rag.graphrag.light.graph_extractor import GraphExtractor as LightKGExt+from rag.graphrag.utils import (GraphChange,chunk_id,does_graph_contains,diff --git a/graphrag/general/leiden.py b/rag/graphrag/general/leiden.pysimilarity index 100%rename from graphrag/general/leiden.pyrename to rag/graphrag/general/leiden.pydiff --git a/graphrag/general/mind_map_extractor.py b/rag/graphrag/general/mind_map_extractor.pysimilarity index 96%rename from graphrag/general/mind_map_extractor.pyrename to rag/graphrag/general/mind_map_extractor.pyindex f221e89f9b..3e7c5d9ae2 100644--- a/graphrag/general/mind_map_extractor.py+++ b/rag/graphrag/general/mind_map_extractor.py@@ -21,9 +21,9 @@ import refrom typing import Anyfrom dataclasses import dataclass-from graphrag.general.extractor import Extractor-from graphrag.general.mind_map_prompt import MIND_MAP_EXTRACTION_PROMPT-from graphrag.utils import ErrorHandlerFn, perform_variable_replacements, chat_limiter+from rag.graphrag.general.extractor import Extractor+from rag.graphrag.general.mind_map_prompt import MIND_MAP_EXTRACTION_PROMPT+from rag.graphrag.utils import ErrorHandlerFn, perform_variable_replacements, chat_limiterfrom rag.llm.chat_model import Base as CompletionLLMimport markdown_to_jsonfrom functools import reducediff --git a/graphrag/general/mind_map_prompt.py b/rag/graphrag/general/mind_map_prompt.pysimilarity index 100%rename from graphrag/general/mind_map_prompt.pyrename to rag/graphrag/general/mind_map_prompt.pydiff --git a/graphrag/general/smoke.py b/rag/graphrag/general/smoke.pysimilarity index 95%rename from graphrag/general/smoke.pyrename to rag/graphrag/general/smoke.pyindex ba405e193f..0070270379 100644--- a/graphrag/general/smoke.py+++ b/rag/graphrag/general/smoke.py@@ -25,8 +25,8 @@ from api.db.services.document_service import DocumentServicefrom api.db.services.knowledgebase_service import KnowledgebaseServicefrom api.db.services.llm_service import LLMBundlefrom api.db.services.user_service import TenantService-from graphrag.general.graph_extractor import GraphExtractor-from graphrag.general.index import update_graph, with_resolution, with_community+from rag.graphrag.general.graph_extractor import GraphExtractor+from rag.graphrag.general.index import update_graph, with_resolution, with_communityfrom common import settingssettings.init_settings()diff --git a/graphrag/light/__init__.py b/rag/graphrag/light/__init__.pysimilarity index 100%rename from graphrag/light/__init__.pyrename to rag/graphrag/light/__init__.pydiff --git a/graphrag/light/graph_extractor.py b/rag/graphrag/light/graph_extractor.pysimilarity index 95%rename from graphrag/light/graph_extractor.pyrename to rag/graphrag/light/graph_extractor.pyindex 027589ca9e..b304e6ad80 100644--- a/graphrag/light/graph_extractor.py+++ b/rag/graphrag/light/graph_extractor.py@@ -15,9 +15,9 @@ from typing import Anyimport networkx as nx-from graphrag.general.extractor import ENTITY_EXTRACTION_MAX_GLEANINGS, Extractor-from graphrag.light.graph_prompt import PROMPTS-from graphrag.utils import chat_limiter, pack_user_ass_to_openai_messages, split_string_by_multi_markers+from rag.graphrag.general.extractor import ENTITY_EXTRACTION_MAX_GLEANINGS, Extractor+from rag.graphrag.light.graph_prompt import PROMPTS+from rag.graphrag.utils import chat_limiter, pack_user_ass_to_openai_messages, split_string_by_multi_markersfrom rag.llm.chat_model import Base as CompletionLLMfrom common.token_utils import num_tokens_from_stringdiff --git a/graphrag/light/graph_prompt.py b/rag/graphrag/light/graph_prompt.pysimilarity index 100%rename from graphrag/light/graph_prompt.pyrename to rag/graphrag/light/graph_prompt.pydiff --git a/graphrag/light/smoke.py b/rag/graphrag/light/smoke.pysimilarity index 95%rename from graphrag/light/smoke.pyrename to rag/graphrag/light/smoke.pyindex bfa3ca256f..2688e0bb60 100644--- a/graphrag/light/smoke.py+++ b/rag/graphrag/light/smoke.py@@ -25,8 +25,8 @@ from api.db.services.document_service import DocumentServicefrom api.db.services.knowledgebase_service import KnowledgebaseServicefrom api.db.services.llm_service import LLMBundlefrom api.db.services.user_service import TenantService-from graphrag.general.index import update_graph-from graphrag.light.graph_extractor import GraphExtractor+from rag.graphrag.general.index import update_graph+from rag.graphrag.light.graph_extractor import GraphExtractorfrom common import settingssettings.init_settings()diff --git a/graphrag/query_analyze_prompt.py b/rag/graphrag/query_analyze_prompt.pysimilarity index 100%rename from graphrag/query_analyze_prompt.pyrename to rag/graphrag/query_analyze_prompt.pydiff --git a/graphrag/search.py b/rag/graphrag/search.pysimilarity index 98%rename from graphrag/search.pyrename to rag/graphrag/search.pyindex 64abfd68a1..6b6ebb82a3 100644--- a/graphrag/search.py+++ b/rag/graphrag/search.py@@ -22,8 +22,8 @@ import json_repairimport pandas as pdfrom common.misc_utils import get_uuid-from graphrag.query_analyze_prompt import PROMPTS-from graphrag.utils import get_entity_type2samples, get_llm_cache, set_llm_cache, get_relation+from rag.graphrag.query_analyze_prompt import PROMPTS+from rag.graphrag.utils import get_entity_type2samples, get_llm_cache, set_llm_cache, get_relationfrom common.token_utils import num_tokens_from_stringfrom rag.nlp.search import Dealer, index_namediff --git a/graphrag/utils.py b/rag/graphrag/utils.pysimilarity index 100%rename from graphrag/utils.pyrename to rag/graphrag/utils.pydiff --git a/rag/prompts/generator.py b/rag/prompts/generator.pyindex 5f834d85a3..d3d7b65a65 100644--- a/rag/prompts/generator.py+++ b/rag/prompts/generator.py@@ -492,7 +492,7 @@ async def gen_meta_filter(chat_mdl, meta_data: dict, query: str) -> dict:async def gen_json(system_prompt: str, user_prompt: str, chat_mdl, gen_conf={}, max_retry=2):- from graphrag.utils import get_llm_cache, set_llm_cache+ from rag.graphrag.utils import get_llm_cache, set_llm_cachecached = get_llm_cache(chat_mdl.llm_name, system_prompt, user_prompt, gen_conf)if cached:return json_repair.loads(cached)@@ -928,4 +928,4 @@ async def multi_queries_gen(chat_mdl, question: str, query:str, missing_infos:li)except Exception as e:logging.exception(e)- return {}\ No newline at end of file+ return {}diff --git a/rag/raptor.py b/rag/raptor.pyindex ce9e5345e9..ac2325d648 100644--- a/rag/raptor.py+++ b/rag/raptor.py@@ -25,7 +25,7 @@ from api.db.services.task_service import has_canceledfrom common.connection_utils import timeoutfrom common.exceptions import TaskCanceledExceptionfrom common.token_utils import truncate-from graphrag.utils import (+from rag.graphrag.utils import (chat_limiter,get_embed_cache,get_llm_cache,diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.pyindex c414f21ee3..c5f31cf213 100644--- a/rag/svr/task_executor.py+++ b/rag/svr/task_executor.py@@ -40,8 +40,8 @@ from rag.utils.base64_image import image2idfrom rag.utils.raptor_utils import should_skip_raptor, get_skip_reasonfrom common.log_utils import init_root_loggerfrom common.config_utils import show_configs-from graphrag.general.index import run_graphrag_for_kb-from graphrag.utils import get_llm_cache, set_llm_cache, get_tags_from_cache, set_tags_to_cache+from rag.graphrag.general.index import run_graphrag_for_kb+from rag.graphrag.utils import get_llm_cache, set_llm_cache, get_tags_from_cache, set_tags_to_cachefrom rag.prompts.generator import keyword_extraction, question_proposal, content_tagging, run_toc_from_text, \gen_metadataimport logging@@ -73,7 +73,7 @@ from rag.nlp import search, rag_tokenizer, add_positionsfrom rag.raptor import RecursiveAbstractiveProcessing4TreeOrganizedRetrieval as Raptorfrom common.token_utils import num_tokens_from_string, truncatefrom rag.utils.redis_conn import REDIS_CONN, RedisDistributedLock-from graphrag.utils import chat_limiter+from rag.graphrag.utils import chat_limiterfrom common.signal_utils import start_tracemalloc_and_snapshot, stop_tracemallocfrom common.exceptions import TaskCanceledExceptionfrom common import settings