From 86a0a4872e378d46bd60f004bdff16783d38de53 Mon Sep 17 00:00:00 2001 From: zrguo <49157727+LarFii@users.noreply.github.com> Date: Tue, 15 Jul 2025 10:56:48 +0800 Subject: [PATCH] Update operate.py --- lightrag/operate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index baf290b1..98c045fb 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1929,10 +1929,7 @@ async def _build_query_context( (hl_entities_context, hl_relations_context, hl_chunks) = hl_data # Collect chunks from entity and relationship sources - all_chunks.extend(ll_chunks) - all_chunks.extend(hl_chunks) - - # Get vector chunks if in mix mode + # Get vector chunks first if in mix mode if query_param.mode == "mix" and chunks_vdb: vector_chunks = await _get_vector_context( query, @@ -1941,6 +1938,9 @@ async def _build_query_context( ) all_chunks.extend(vector_chunks) + all_chunks.extend(ll_chunks) + all_chunks.extend(hl_chunks) + # Combine entities and relations contexts entities_context = process_combine_contexts( ll_entities_context, hl_entities_context