The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
Changes to client (#2562)
Prateek Chhikara78912928bc6c
diff --git a/mem0/client/main.py b/mem0/client/main.pyindex fde392379..891a96056 100644--- a/mem0/client/main.py+++ b/mem0/client/main.py@@ -485,7 +485,10 @@ class MemoryClient:@api_error_handlerdef update_project(- self, custom_instructions: Optional[str] = None, custom_categories: Optional[List[str]] = None+ self,+ custom_instructions: Optional[str] = None,+ custom_categories: Optional[List[str]] = None,+ retrieval_criteria: Optional[List[Dict[str, Any]]] = None,) -> Dict[str, Any]:"""Update the project settings.@@ -503,13 +506,13 @@ class MemoryClient:if not (self.org_id and self.project_id):raise ValueError("org_id and project_id must be set to update instructions or categories")- if custom_instructions is None and custom_categories is None:+ if custom_instructions is None and custom_categories is None and retrieval_criteria is None:raise ValueError(- "Currently we only support updating custom_instructions or custom_categories, so you must provide at least one of them"+ "Currently we only support updating custom_instructions or custom_categories or retrieval_criteria, so you must provide at least one of them")payload = self._prepare_params(- {"custom_instructions": custom_instructions, "custom_categories": custom_categories}+ {"custom_instructions": custom_instructions, "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria})response = self.client.patch(f"/api/v1/orgs/organizations/{self.org_id}/projects/{self.project_id}/",@@ -519,7 +522,7 @@ class MemoryClient:capture_client_event("client.update_project",self,- {"custom_instructions": custom_instructions, "custom_categories": custom_categories, "sync_type": "sync"},+ {"custom_instructions": custom_instructions, "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria, "sync_type": "sync"},)return response.json()@@ -955,18 +958,19 @@ class AsyncMemoryClient:@api_error_handlerasync def update_project(- self, custom_instructions: Optional[str] = None, custom_categories: Optional[List[str]] = None+ self, custom_instructions: Optional[str] = None, custom_categories: Optional[List[str]] = None,+ retrieval_criteria: Optional[List[Dict[str, Any]]] = None) -> Dict[str, Any]:if not (self.sync_client.org_id and self.sync_client.project_id):raise ValueError("org_id and project_id must be set to update instructions or categories")- if custom_instructions is None and custom_categories is None:+ if custom_instructions is None and custom_categories is None and retrieval_criteria is None:raise ValueError(- "Currently we only support updating custom_instructions or custom_categories, so you must provide at least one of them"+ "Currently we only support updating custom_instructions or custom_categories or retrieval_criteria, so you must provide at least one of them")payload = self.sync_client._prepare_params(- {"custom_instructions": custom_instructions, "custom_categories": custom_categories}+ {"custom_instructions": custom_instructions, "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria})response = await self.async_client.patch(f"/api/v1/orgs/organizations/{self.sync_client.org_id}/projects/{self.sync_client.project_id}/",@@ -976,7 +980,7 @@ class AsyncMemoryClient:capture_client_event("client.update_project",self.sync_client,- {"custom_instructions": custom_instructions, "custom_categories": custom_categories, "sync_type": "async"},+ {"custom_instructions": custom_instructions, "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria, "sync_type": "async"},)return response.json()diff --git a/pyproject.toml b/pyproject.tomlindex 29c1371c5..c55bcd258 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,6 +1,6 @@[tool.poetry]name = "mem0ai"-version = "0.1.91"+version = "0.1.92"description = "Long-term memory for AI Agents"authors = ["Mem0 <[email protected]>"]exclude = [