imbajin commented on code in PR #414:
URL: https://github.com/apache/hugegraph-ai/pull/414#discussion_r4516744529
##########
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:
⚠️ The dimension is also used when an index already exists:
`FaissVectorIndex.from_name` returns an empty index on a mismatch, and
`QdrantVectorIndex.from_name` deletes and recreates the existing collection. A
caller following this contract could therefore lose stored vectors. Please
document the backend-specific mismatch behavior and the need to supply the
existing dimension.
--
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]