Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

fix(pinecone): hybrid search crashes when filters is None (#5533)

Hrushikesh Yadavd46464282c98
diff --git a/mem0/vector_stores/pinecone.py b/mem0/vector_stores/pinecone.py
index 1d2d6eb96..91be9efdb 100644
--- a/mem0/vector_stores/pinecone.py
+++ b/mem0/vector_stores/pinecone.py
@@ -230,7 +230,7 @@ class PineconeDB(VectorStoreBase):
if filter_dict:
query_params["filter"] = filter_dict
- if self.hybrid_search and self.sparse_encoder and "text" in filters:
+ if self.hybrid_search and self.sparse_encoder and filters and "text" in filters:
query_text = filters.get("text")
if query_text:
sparse_vector = self.sparse_encoder.encode_queries(query_text)