diff --git a/lightrag/operate.py b/lightrag/operate.py index 66e4533c..cf096993 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1025,6 +1025,10 @@ async def _build_query_context( [hl_relations_context, ll_relations_context], [hl_text_units_context, ll_text_units_context], ) + # not necessary to use LLM to generate a response + if not entities_context.strip() and not relations_context.strip(): + return None + return f""" -----Entities----- ```csv