Skip to content

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

fix(vectordb): parse count from __TOTAL__ (#2009)

dingben75b625c897b6
diff --git a/openviking/storage/vectordb_adapters/base.py b/openviking/storage/vectordb_adapters/base.py
index 163e7b59b..53c94208d 100644
--- a/openviking/storage/vectordb_adapters/base.py
+++ b/openviking/storage/vectordb_adapters/base.py
@@ -507,8 +507,8 @@ class CollectionAdapter(ABC):
op="count",
filters=self._compile_filter(filter),
)
- if "_total" in result.agg:
- parsed_total = self._coerce_int(result.agg.get("_total"))
+ if "__TOTAL__" in result.agg:
+ parsed_total = self._coerce_int(result.agg.get("__TOTAL__"))
if parsed_total is not None:
return parsed_total