Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Weight up title and keywords for chunks in terms of retrieval (#3750)

Kevin Hu0f08b0f0535a
diff --git a/rag/nlp/search.py b/rag/nlp/search.py
index a24f7a71d8..5abacc5f93 100644
--- a/rag/nlp/search.py
+++ b/rag/nlp/search.py
@@ -250,7 +250,7 @@ class Dealer:
content_ltks = sres.field[i][cfield].split()
title_tks = [t for t in sres.field[i].get("title_tks", "").split() if t]
important_kwd = sres.field[i].get("important_kwd", [])
- tks = content_ltks + title_tks + important_kwd
+ tks = content_ltks + title_tks*2 + important_kwd*5
ins_tw.append(tks)
sim, tksim, vtsim = self.qryr.hybrid_similarity(sres.query_vector,