Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
clean vector collection redis cache (#6494)
Jyongf38034e4557e
diff --git a/api/core/rag/datasource/vdb/analyticdb/analyticdb_vector.py b/api/core/rag/datasource/vdb/analyticdb/analyticdb_vector.pyindex 123b93fcd5a..442d71293f6 100644--- a/api/core/rag/datasource/vdb/analyticdb/analyticdb_vector.py+++ b/api/core/rag/datasource/vdb/analyticdb/analyticdb_vector.py@@ -293,15 +293,18 @@ class AnalyticdbVector(BaseVector):return documentsdef delete(self) -> None:- from alibabacloud_gpdb20160503 import models as gpdb_20160503_models- request = gpdb_20160503_models.DeleteCollectionRequest(- collection=self._collection_name,- dbinstance_id=self.config.instance_id,- namespace=self.config.namespace,- namespace_password=self.config.namespace_password,- region_id=self.config.region_id,- )- self._client.delete_collection(request)+ try:+ from alibabacloud_gpdb20160503 import models as gpdb_20160503_models+ request = gpdb_20160503_models.DeleteCollectionRequest(+ collection=self._collection_name,+ dbinstance_id=self.config.instance_id,+ namespace=self.config.namespace,+ namespace_password=self.config.namespace_password,+ region_id=self.config.region_id,+ )+ self._client.delete_collection(request)+ except Exception as e:+ raise eclass AnalyticdbVectorFactory(AbstractVectorFactory):def init_vector(self, dataset: Dataset, attributes: list, embeddings: Embeddings):diff --git a/api/core/rag/datasource/vdb/tencent/tencent_vector.py b/api/core/rag/datasource/vdb/tencent/tencent_vector.pyindex cdcc22aec99..3325a1028ec 100644--- a/api/core/rag/datasource/vdb/tencent/tencent_vector.py+++ b/api/core/rag/datasource/vdb/tencent/tencent_vector.py@@ -198,8 +198,6 @@ class TencentVector(BaseVector):self._db.drop_collection(name=self._collection_name)--class TencentVectorFactory(AbstractVectorFactory):def init_vector(self, dataset: Dataset, attributes: list, embeddings: Embeddings) -> TencentVector:diff --git a/api/core/rag/datasource/vdb/vector_base.py b/api/core/rag/datasource/vdb/vector_base.pyindex dbd8b6284bf..17768ab042d 100644--- a/api/core/rag/datasource/vdb/vector_base.py+++ b/api/core/rag/datasource/vdb/vector_base.py@@ -67,3 +67,7 @@ class BaseVector(ABC):def _get_uuids(self, texts: list[Document]) -> list[str]:return [text.metadata['doc_id'] for text in texts]++ @property+ def collection_name(self):+ return self._collection_namediff --git a/api/core/rag/datasource/vdb/vector_factory.py b/api/core/rag/datasource/vdb/vector_factory.pyindex 949a4b58471..256abd28afb 100644--- a/api/core/rag/datasource/vdb/vector_factory.py+++ b/api/core/rag/datasource/vdb/vector_factory.py@@ -9,6 +9,7 @@ from core.rag.datasource.entity.embedding import Embeddingsfrom core.rag.datasource.vdb.vector_base import BaseVectorfrom core.rag.datasource.vdb.vector_type import VectorTypefrom core.rag.models.document import Document+from extensions.ext_redis import redis_clientfrom models.dataset import Dataset@@ -134,6 +135,10 @@ class Vector:def delete(self) -> None:self._vector_processor.delete()+ # delete collection redis cache+ if self._vector_processor.collection_name:+ collection_exist_cache_key = 'vector_indexing_{}'.format(self._vector_processor.collection_name)+ redis_client.delete(collection_exist_cache_key)def _get_embeddings(self) -> Embeddings:model_manager = ModelManager()