Change KG chunk selection default to VECTOR

- Set KG_CHUNK_PICK_METHOD default to VECTOR
- Update env.example with new config option
This commit is contained in:
yangdx 2025-08-13 23:10:42 +08:00
parent 947e826e61
commit 5a40ff654e
3 changed files with 4 additions and 2 deletions

View file

@ -71,6 +71,8 @@ ENABLE_LLM_CACHE=true
# MAX_RELATION_TOKENS=10000
### control the maximum tokens send to LLM (include entities, raltions and chunks)
# MAX_TOTAL_TOKENS=30000
### chunk selection strategies for KG: WEIGHT or VECTOR
KG_CHUNK_PICK_METHOD=VECTOR
### maximum number of related chunks per source entity or relation (higher values increase re-ranking time)
# RELATED_CHUNK_NUMBER=5

View file

@ -27,7 +27,7 @@ DEFAULT_MAX_RELATION_TOKENS = 10000
DEFAULT_MAX_TOTAL_TOKENS = 30000
DEFAULT_COSINE_THRESHOLD = 0.2
DEFAULT_RELATED_CHUNK_NUMBER = 5
DEFAULT_KG_CHUNK_PICK_METHOD = "WEIGHT"
DEFAULT_KG_CHUNK_PICK_METHOD = "VECTOR"
# Deprated: history message have negtive effect on query performance
DEFAULT_HISTORY_TURNS = 0

View file

@ -2803,7 +2803,7 @@ async def _find_related_text_unit_from_entities(
entities_with_chunks, max_related_chunks, min_related_chunks=1
)
logger.debug(
logger.info(
f"Selecting {len(selected_chunk_ids)} from {total_entity_chunks} entity-related chunks by weighted polling"
)