mem0ai/mem0 · error · ValueError

org_id and project_id must be set to update instructions or

Error message

org_id and project_id must be set to update instructions or categories

What it means

Error "org_id and project_id must be set to update instructions or categories" thrown in mem0ai/mem0.

Source

Thrown at mem0/client/main.py:758

            custom_instructions: New instructions for the project.
            custom_categories: New categories 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.
            agent_custom_instructions: New extraction instructions for agent-scoped memories.

        Returns:
            Dictionary containing the API response.

        Raises:
            ValueError: If org_id or project_id are not set, or no update fields provided.
        """
        logger.warning(
            "update_project() method is going to be deprecated in version v1.0 of the package. "
            "Please use the client.project.update() method instead."
        )
        if not (self.org_id and self.project_id):
            raise ValueError("org_id and project_id must be set to update instructions or categories")

        kwargs = {
            **(options.model_dump(exclude_unset=True) if options else {}),
            **{
                k: v
                for k, v in {
                    "custom_instructions": custom_instructions,
                    "custom_categories": custom_categories,
                    "memory_depth": memory_depth,
                    "usecase_setting": usecase_setting,
                    "multilingual": multilingual,
                    "agent_custom_instructions": agent_custom_instructions,
                }.items()
                if v is not None
            },
        }

        if not kwargs:

View on GitHub (pinned to 001c235229)

Solutions

  1. Initialize MemoryClient with org_id and project_id before updating instructions or categories.

When it happens

Trigger: Thrown at mem0/client/main.py:758 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/2cb87b7a0990ca03. Report an issue: GitHub.