From 6cc1c1532076a2ccfa7ec8810aaae06c4a1a67be Mon Sep 17 00:00:00 2001 From: soumil-rathi Date: Thu, 2 Apr 2026 06:08:26 -0700 Subject: [PATCH] feat(sdk): add multilingual param to project update (#4314) Co-authored-by: Soumil Rathi Co-authored-by: Claude Opus 4.6 --- docs/api-reference/organizations-projects.mdx | 8 ++++++-- docs/openapi.json | 4 ++++ mem0-ts/src/client/mem0.types.ts | 1 + mem0/client/main.py | 10 ++++++++++ mem0/client/project.py | 14 ++++++++++++-- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/api-reference/organizations-projects.mdx b/docs/api-reference/organizations-projects.mdx index 2d54de68e..69d6c9140 100644 --- a/docs/api-reference/organizations-projects.mdx +++ b/docs/api-reference/organizations-projects.mdx @@ -82,7 +82,7 @@ new_project = client.project.create( ### Update Project Settings -Modify project configuration including custom instructions, categories, and graph settings: +Modify project configuration including custom instructions, categories, graph settings, and language preferences: ```python # Update project with custom categories @@ -101,6 +101,9 @@ client.project.update( # Enable graph memory for the project client.project.update(enable_graph=True) +# Use the input language for memory storage and retrieval +client.project.update(multilingual=True) + # Update multiple settings at once client.project.update( custom_instructions="...", @@ -108,7 +111,8 @@ client.project.update( {"personal_info": "User personal information and preferences"}, {"work_context": "Professional context and work-related information"} ], - enable_graph=True + enable_graph=True, + multilingual=True ) ``` diff --git a/docs/openapi.json b/docs/openapi.json index f7aff39d5..5dd03e6eb 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -3686,6 +3686,10 @@ "type": "object" }, "description": "List of custom categories to be used for memory categorization." + }, + "multilingual": { + "type": "boolean", + "description": "Whether to use the input language for memory storage and retrieval." } } } diff --git a/mem0-ts/src/client/mem0.types.ts b/mem0-ts/src/client/mem0.types.ts index fa0fd1ed6..6db195eac 100644 --- a/mem0-ts/src/client/mem0.types.ts +++ b/mem0-ts/src/client/mem0.types.ts @@ -167,6 +167,7 @@ export interface PromptUpdatePayload { exclusion_prompt?: string; memory_depth?: string | null; usecase_setting?: string | number; + multilingual?: boolean; [key: string]: any; } diff --git a/mem0/client/main.py b/mem0/client/main.py index 6f9304717..aef020862 100644 --- a/mem0/client/main.py +++ b/mem0/client/main.py @@ -676,6 +676,7 @@ class MemoryClient: exclusion_prompt: Optional[str] = None, memory_depth: Optional[str] = None, usecase_setting: Optional[str] = None, + multilingual: Optional[bool] = None, ) -> Dict[str, Any]: """Update the project settings. @@ -689,6 +690,7 @@ class MemoryClient: exclusion_prompt: Exclusion prompt for the project memory_depth: Memory depth for the project usecase_setting: Usecase setting for the project + multilingual: Whether to use the input language for memory storage and retrieval Returns: Dictionary containing the API response. @@ -718,6 +720,7 @@ class MemoryClient: and exclusion_prompt is None and memory_depth is None and usecase_setting is None + and multilingual is None ): raise ValueError( "Currently we only support updating custom_instructions or " @@ -736,6 +739,7 @@ class MemoryClient: "exclusion_prompt": exclusion_prompt, "memory_depth": memory_depth, "usecase_setting": usecase_setting, + "multilingual": multilingual, } ) response = self.client.patch( @@ -756,6 +760,7 @@ class MemoryClient: "exclusion_prompt": exclusion_prompt, "memory_depth": memory_depth, "usecase_setting": usecase_setting, + "multilingual": multilingual, "sync_type": "sync", }, ) @@ -1554,6 +1559,7 @@ class AsyncMemoryClient: retrieval_criteria: Optional[List[Dict[str, Any]]] = None, enable_graph: Optional[bool] = None, version: Optional[str] = None, + multilingual: Optional[bool] = None, ) -> Dict[str, Any]: """Update the project settings. @@ -1563,6 +1569,7 @@ class AsyncMemoryClient: retrieval_criteria: New retrieval criteria for the project enable_graph: Enable or disable the graph for the project version: Version of the project + multilingual: Whether to use the input language for memory storage and retrieval Returns: Dictionary containing the API response. @@ -1588,6 +1595,7 @@ class AsyncMemoryClient: and retrieval_criteria is None and enable_graph is None and version is None + and multilingual is None ): raise ValueError( "Currently we only support updating custom_instructions or custom_categories or retrieval_criteria, so you must provide at least one of them" @@ -1600,6 +1608,7 @@ class AsyncMemoryClient: "retrieval_criteria": retrieval_criteria, "enable_graph": enable_graph, "version": version, + "multilingual": multilingual, } ) response = await self.async_client.patch( @@ -1616,6 +1625,7 @@ class AsyncMemoryClient: "retrieval_criteria": retrieval_criteria, "enable_graph": enable_graph, "version": version, + "multilingual": multilingual, "sync_type": "async", }, ) diff --git a/mem0/client/project.py b/mem0/client/project.py index 45c90819f..92a021dec 100644 --- a/mem0/client/project.py +++ b/mem0/client/project.py @@ -399,6 +399,7 @@ class Project(BaseProject): custom_categories: Optional[List[str]] = None, retrieval_criteria: Optional[List[Dict[str, Any]]] = None, enable_graph: Optional[bool] = None, + multilingual: Optional[bool] = None, ) -> Dict[str, Any]: """ Update project settings. @@ -408,6 +409,7 @@ class Project(BaseProject): custom_categories: New categories for the project retrieval_criteria: New retrieval criteria for the project enable_graph: Enable or disable the graph for the project + multilingual: Whether to use the input language for memory storage and retrieval Returns: Dictionary containing the API response. @@ -424,11 +426,12 @@ class Project(BaseProject): and custom_categories is None and retrieval_criteria is None and enable_graph is None + and multilingual is None ): raise ValueError( "At least one parameter must be provided for update: " "custom_instructions, custom_categories, retrieval_criteria, " - "enable_graph" + "enable_graph, multilingual" ) payload = self._prepare_params( @@ -437,6 +440,7 @@ class Project(BaseProject): "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria, "enable_graph": enable_graph, + "multilingual": multilingual, } ) response = self._client.patch( @@ -452,6 +456,7 @@ class Project(BaseProject): "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria, "enable_graph": enable_graph, + "multilingual": multilingual, "sync_type": "sync", }, ) @@ -716,6 +721,7 @@ class AsyncProject(BaseProject): custom_categories: Optional[List[str]] = None, retrieval_criteria: Optional[List[Dict[str, Any]]] = None, enable_graph: Optional[bool] = None, + multilingual: Optional[bool] = None, ) -> Dict[str, Any]: """ Update project settings. @@ -725,6 +731,7 @@ class AsyncProject(BaseProject): custom_categories: New categories for the project retrieval_criteria: New retrieval criteria for the project enable_graph: Enable or disable the graph for the project + multilingual: Whether to use the input language for memory storage and retrieval Returns: Dictionary containing the API response. @@ -741,11 +748,12 @@ class AsyncProject(BaseProject): and custom_categories is None and retrieval_criteria is None and enable_graph is None + and multilingual is None ): raise ValueError( "At least one parameter must be provided for update: " "custom_instructions, custom_categories, retrieval_criteria, " - "enable_graph" + "enable_graph, multilingual" ) payload = self._prepare_params( @@ -754,6 +762,7 @@ class AsyncProject(BaseProject): "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria, "enable_graph": enable_graph, + "multilingual": multilingual, } ) response = await self._client.patch( @@ -769,6 +778,7 @@ class AsyncProject(BaseProject): "custom_categories": custom_categories, "retrieval_criteria": retrieval_criteria, "enable_graph": enable_graph, + "multilingual": multilingual, "sync_type": "async", }, )