Skip to content

[Bug]: default values of prompt when install and upgrade #1092

@jgong

Description

@jgong

Describe the bug

Following the semantic refactor in PR #882, we need to audit the newly introduced PromptConf default values. The goal is to ensure a seamless experience for both new users and those upgrading from previous versions.

The current implementation defines the following default in code:

class PromptConf(YamlSerializableMixin):
"""Prompt configuration for semantic memory contexts."""
default_org_categories: list[str] = Field(
default=["profile_prompt"],
description="The default prompts to use for semantic organization memory",
)
default_project_categories: list[str] = Field(
default=["profile_prompt", "writing_assistant_prompt", "coding_prompt"],
description="The default prompts to use for semantic project memory",
)
default_user_categories: list[str] = Field(
default=["profile_prompt"],
description="The default prompts to use for semantic user memory",
)
episode_summary_system_prompt_path: str = Field(
default="",
description="The prompt template to use for episode summary generation - system part",
)
episode_summary_user_prompt_path: str = Field(
default="",
description="The prompt template to use for episode summary generation - user part",
)

  prompt:
    # Categories assigned to org-level semantic memory
    default_org_categories:
      - profile_prompt

    # Categories assigned to project-level semantic memory
    default_project_categories:
      - profile_prompt
      - writing_assistant_prompt
      - coding_prompt

    # Categories assigned to user-level semantic memory
    default_user_categories:
      - profile_prompt

    # Empty by default — uses built-in defaults when blank
    episode_summary_system_prompt_path: ""
    episode_summary_user_prompt_path: ""

The prompt in sample config is https://github.com/MemMachine/MemMachine/blob/main/sample_configs/episodic_memory_config.cpu.sample#L26-L28

prompt:
  default_project_categories:
  - profile_prompt

Steps to reproduce

Fresh install

  1. In configuration.yml, it is set to
  default_project_categories:
  - profile_prompt
  1. However, note that default values defined in code will still set default_org_categories to profile_prompt and default_user_categories to profile_prompt
  2. So after ingestion, user will see org level set_ids and user_level set_ids, for example
mem_set_type_org_universal_0_46b9dd2b0ba8__
mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user
...
  1. There will be features extracted at org_level and user_level by default
                   set_id                    | semantic_category_id |            tag_id             |               feature               |                                             value
---------------------------------------------+----------------------+-------------------------------+-------------------------------------+-----------------------------------------------------------------------------------------------
 mem_set_type_org_universal_0_46b9dd2b0ba8__ | profile              | Health & Wellness             | allergies                           | Severe peanut allergy
 mem_set_type_org_universal_0_46b9dd2b0ba8__ | profile              | Demographic Information       | age                                 | 29
 mem_set_type_org_universal_0_46b9dd2b0ba8__ | profile              | Demographic Information       | upcoming_birthday                   | Turning 30 next year
                                set_id                                | semantic_category_id |                   tag_id                   |               feature               |                                             value
----------------------------------------------------------------------+----------------------+--------------------------------------------+-------------------------------------+-----------------------------------------------------------------------------------------------
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user_xqs8b2yo | profile              | Health & Wellness                          | peanut_allergy                      | User has a severe peanut allergy.
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user_xqs8b2yo | profile              | Hobbies & Interests                        | cuisine_preference                  | User loves Italian cuisine.
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user_xqs8b2yo | profile              | Career & Work Preferences                  | job_title                           | senior product manager
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user_xqs8b2yo | profile              | Career & Work Preferences                  | team_composition                    | engineers
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user_xqs8b2yo | profile              | Career & Work Preferences                  | role_level                          | senior

Upgrade

  1. In the release v0.2.6 and before, the prompt in configuration.yml is set to
prompt:
  session:
  - profile_prompt
  1. Note that once we upgrade to the latest image from main, the prompt settings will set to the default values in the code. This means those settings will take effect silently without a manual update to the config. Should we make sure this is explicitly mentioned to the users so they aren't surprised by the change in behavior?
    default_org_categories:
      - profile_prompt

    # Categories assigned to project-level semantic memory
    default_project_categories:
      - profile_prompt
      - writing_assistant_prompt
      - coding_prompt

    # Categories assigned to user-level semantic memory
    default_user_categories:
      - profile_prompt
  1. Current behavior is that user will see many features extracted for different combinations of set_ids and semantic_category_ids
-- Features by set_id / semantic_category_id:
                                        set_id                                        | semantic_category_id | cnt
--------------------------------------------------------------------------------------+----------------------+-----
 mem_project_set_org_universal_project_project_u2jbfxnc_both_0_46b9dd2b0ba8__         | coding_style         |  35
 mem_project_set_org_universal_project_project_u2jbfxnc_both_0_46b9dd2b0ba8__         | profile              |  28
 mem_project_set_org_universal_project_project_u2jbfxnc_both_0_46b9dd2b0ba8__         | writing_assistant    |  11
 mem_project_set_org_universal_project_project_u2jbfxnc_empty_fields_0_46b9dd2b0ba8__ | coding_style         |  26
 mem_project_set_org_universal_project_project_u2jbfxnc_empty_fields_0_46b9dd2b0ba8__ | profile              |  19
 mem_project_set_org_universal_project_project_u2jbfxnc_empty_fields_0_46b9dd2b0ba8__ | writing_assistant    |   3
 mem_project_set_org_universal_project_project_u2jbfxnc_semantic_0_46b9dd2b0ba8__     | profile              |  38
 mem_project_set_org_universal_project_project_u2jbfxnc_semantic_0_46b9dd2b0ba8__     | coding_style         |  34
 mem_project_set_org_universal_project_project_u2jbfxnc_semantic_0_46b9dd2b0ba8__     | writing_assistant    |  24
 mem_set_type_org_universal_0_46b9dd2b0ba8__                                          | profile              |  97
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_admin_u2jbfxnc                | profile              |   6
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_agent_u2jbfxnc                | profile              |  14
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user                          | profile              |   4
 mem_user_set_org_universal_1_7e8d0b20c039__producer_id_user_u2jbfxnc                 | profile              |  56

Expected behavior

Seamless experience for both fresh install and upgrade with explicit config values taking effect.

Environment

  • Commit: aaea7b7

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions