Custom Categories
Enhance your product experience by adding custom categories tailored to your needs
How to set custom categories?
You can now create custom categories tailored to your specific needs, instead of using the default categories such as travel, sports, music, and more (see default categories below). When custom categories are provided, they will override the default categories.
There are two ways to set custom categories:
1. Project Level
You can set custom categories at the project level, which will be applied to all memories added within that project. Mem0 will automatically assign relevant categories from your custom set to new memories based on their content. Setting custom categories at the project level will override the default categories.
Here’s how to set custom categories:
This is how you will use these custom categories during the add
API call:
You can also retrieve the current custom categories:
These project-level categories will be automatically applied to all new memories added to the project.
2. During the add
API call
You can also set custom categories during the add
API call. This will override any project-level custom categories for that specific memory addition. For example, if you want to use different categories for food-related memories, you can provide custom categories like “food” and “user_preferences” in the add
call. These custom categories will be used instead of the project-level categories when categorizing those specific memories.
Default Categories
Here is the list of default categories. If you don’t specify any custom categories using the above methods, these will be used as default categories.
You can check whether default categories are being used by calling get_custom_instructions_and_categories()
. If custom_categories
returns None
, it means the default categories are being used.
If you have any questions, please feel free to reach out to us using one of the following methods: