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
Duplicate embedding cache check (#3134)
Jyongab9fcbdfb961
diff --git a/api/core/embedding/cached_embedding.py b/api/core/embedding/cached_embedding.pyindex 11dfe8dc15f..4156368e562 100644--- a/api/core/embedding/cached_embedding.py+++ b/api/core/embedding/cached_embedding.py@@ -60,14 +60,17 @@ class CacheEmbedding(Embeddings):db.session.rollback()except Exception as e:logging.exception('Failed transform embedding: ', e)+ cache_embeddings = []for i, embedding in zip(embedding_queue_indices, embedding_queue_embeddings):text_embeddings[i] = embeddinghash = helper.generate_text_hash(texts[i])- embedding_cache = Embedding(model_name=self._model_instance.model,- hash=hash,- provider_name=self._model_instance.provider)- embedding_cache.set_embedding(embedding)- db.session.add(embedding_cache)+ if hash not in cache_embeddings:+ embedding_cache = Embedding(model_name=self._model_instance.model,+ hash=hash,+ provider_name=self._model_instance.provider)+ embedding_cache.set_embedding(embedding)+ db.session.add(embedding_cache)+ cache_embeddings.append(hash)db.session.commit()except Exception as ex:db.session.rollback()