Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

refactor: remove with_vector from query APIs (#338)

kkkwjx793e9917bf48
diff --git a/openviking/storage/vectordb_adapters/base.py b/openviking/storage/vectordb_adapters/base.py
index fc74bb797..cee0f20f1 100644
--- a/openviking/storage/vectordb_adapters/base.py
+++ b/openviking/storage/vectordb_adapters/base.py
@@ -325,7 +325,6 @@ class CollectionAdapter(ABC):
limit: int = 10,
offset: int = 0,
output_fields: Optional[list[str]] = None,
- with_vector: bool = False,
order_by: Optional[str] = None,
order_desc: bool = False,
) -> list[Dict[str, Any]]:
@@ -367,9 +366,6 @@ class CollectionAdapter(ABC):
record["id"] = item.id
record["_score"] = item.score if item.score is not None else 0.0
record = self._normalize_record_for_read(record)
- if not with_vector:
- record.pop("vector", None)
- record.pop("sparse_vector", None)
records.append(record)
return records
@@ -383,7 +379,7 @@ class CollectionAdapter(ABC):
coll = self.get_collection()
delete_ids = list(ids or [])
if not delete_ids and filter is not None:
- matched = self.query(filter=filter, limit=limit, with_vector=True)
+ matched = self.query(filter=filter, limit=limit)
delete_ids = [record["id"] for record in matched if record.get("id")]
if not delete_ids:
diff --git a/openviking/storage/viking_vector_index_backend.py b/openviking/storage/viking_vector_index_backend.py
index 7307960a8..c5ef44fd4 100644
--- a/openviking/storage/viking_vector_index_backend.py
+++ b/openviking/storage/viking_vector_index_backend.py
@@ -200,7 +200,6 @@ class VikingVectorIndexBackend:
limit: int = 10,
offset: int = 0,
output_fields: Optional[List[str]] = None,
- with_vector: bool = False,
order_by: Optional[str] = None,
order_desc: bool = False,
) -> List[Dict[str, Any]]:
@@ -212,7 +211,6 @@ class VikingVectorIndexBackend:
limit=limit,
offset=offset,
output_fields=output_fields,
- with_vector=with_vector,
order_by=order_by,
order_desc=order_desc,
)
@@ -228,7 +226,6 @@ class VikingVectorIndexBackend:
limit: int = 10,
offset: int = 0,
output_fields: Optional[List[str]] = None,
- with_vector: bool = False,
) -> List[Dict[str, Any]]:
# Backward-compatible alias for internal call sites.
return await self.query(
@@ -238,7 +235,6 @@ class VikingVectorIndexBackend:
limit=limit,
offset=offset,
output_fields=output_fields,
- with_vector=with_vector,
)
async def filter(