You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Repository navigation
[Bug]: Go UpdateChunk does not refresh question_tks, important_tks, or the embedding #22297
Saving a chunk in the UI calls Go ChunkService.UpdateChunk. It rewrites content_ltks, important_kwd, and question_kwd only. It does not rewrite important_tks or question_tks, and it does not re-embed q_*_vec.
Full-text search uses question_tks^20, not question_kwd. The reranker also reads question_tks (repeated 6 times). Similar questions added or edited on an existing chunk therefore show up in the editor but do not change retrieval. Keywords still affect full-text because the query and the reranker read important_kwd directly, but important_tks stays stale. The stored vector stays whatever was computed when the chunk was created.
Expected behavior
Match the previous Python update_chunk in api/apps/restful_apis/chunk_api.py: when keywords or questions are in the request, rewrite important_tks and question_tks; always re-encode the vector. If the question list is non-empty, embed that list; otherwise embed the chunk content. The chunk editor says the same thing: if questions are given, the chunk embedding is based on them.
Steps to reproduce
1. Create a chunk with content only, so its vector is the content.
2. Edit that chunk, add similar questions and keywords, and save.
3. Retrieve with one of the new similar questions.
4. The question tokens and the vector are still the original ones. Only question_kwd and important_kwd changed.
Additional information
Open PR #20552 refreshes the vector when the embedding input changes, and its description says the change does not extend to question_tks. important_tks is also still missing from UpdateChunk. Both token fields are written only in AddChunk.
Activity