lplalbert commented on code in PR #414:
URL: https://github.com/apache/hugegraph-ai/pull/414#discussion_r4523396265
##########
hugegraph-llm/src/hugegraph_llm/indices/vector_index/base.py:
##########
@@ -72,34 +75,60 @@ def search(self, query_vector: List[float], top_k: int,
dis_threshold: float = 0
@abstractmethod
def save_index_by_name(self, *name: str):
"""
- #TODO: finish comment
+ Persist the index under the given name.
+
+ Server-backed stores persist on write and may do nothing here.
+
+ Args:
+ *name (str): Path segments identifying the index.
"""
@abstractmethod
def get_vector_index_info(
self,
) -> Dict:
"""
- #TODO: finish comment
+ Return backend-specific statistics about the index.
+
+ Returns:
+ Dict: Informational stats (e.g. dimensions and entry counts) for
display and diagnostics.
"""
@staticmethod
@abstractmethod
def from_name(embed_dim: int, *name: str) -> "VectorStoreBase":
"""
- #TODO: finish comment
+ Return the index registered under the given name.
+
+ Loads persisted data when it exists; otherwise returns an empty index
sized to embed_dim.
Review Comment:
Clarified in `182ddef`. `from_name` now documents the mismatch path
explicitly: reusing persisted vectors requires passing their existing dimension
as `embed_dim`; vectors built with a different dimension cannot be reused, so
the call returns a fresh empty index sized to `embed_dim` instead of failing
the load, and disposal of the stale data is backend-specific (the file-backed
store keeps its saved files, server-backed stores like Qdrant delete and
recreate the collection). A caller that changes `embed_dim` must expect to
re-index. Behavior is unchanged and stays pinned by
`test_load_with_different_dimension_starts_empty_index`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]