This is an automated email from the ASF dual-hosted git repository.

jin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-ai.git


The following commit(s) were added to refs/heads/main by this push:
     new e1d3e44  fix(llm): failed to remove vectors when updating vid 
embedding (#243)
e1d3e44 is described below

commit e1d3e44ee4aebf72e6d229fb1cfee412390c8222
Author: SoJGooo <[email protected]>
AuthorDate: Tue May 20 16:30:48 2025 +0800

    fix(llm): failed to remove vectors when updating vid embedding (#243)
    
    ## Bug Report
    After deleting vertices, running `update_vid_embedding` does **not**
    successfully remove the corresponding vectors.
    
    ### Initial State
    
    * 13 vertices
    * 13 `vid` embeddings
    
    ### After Clearing Graph Data
    
    * 0 vertices
    
    ### After `update_vid_embedding`
    
    * Output shows: “Removed 13 vectors”
    
    
![image](https://github.com/user-attachments/assets/be815bf5-c516-4ebb-989b-71e2120c9e66)
    
    However, calling `get_vector_index_info` still shows 13 `vid`
    embeddings.
    
    
![image](https://github.com/user-attachments/assets/0ab510d8-6b2e-4ce3-b54f-979e4ec775ba)
---
 .../src/hugegraph_llm/operators/index_op/build_semantic_index.py        | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/hugegraph-llm/src/hugegraph_llm/operators/index_op/build_semantic_index.py 
b/hugegraph-llm/src/hugegraph_llm/operators/index_op/build_semantic_index.py
index b2bff49..66ab259 100644
--- a/hugegraph-llm/src/hugegraph_llm/operators/index_op/build_semantic_index.py
+++ b/hugegraph-llm/src/hugegraph_llm/operators/index_op/build_semantic_index.py
@@ -53,6 +53,8 @@ class BuildSemanticIndex:
         present_vids = context["vertices"] # Warning: data truncated by 
fetch_graph_data.py
         removed_vids = set(past_vids) - set(present_vids)
         removed_num = self.vid_index.remove(removed_vids)
+        if removed_vids:
+            self.vid_index.to_index_file(self.index_dir)
         added_vids = list(set(present_vids) - set(past_vids))
 
         if added_vids:

Reply via email to