Skip to main content
When you have large volumes of memory data, sorting it during post-processing becomes difficult. What if your memory store understood the importance of creating tags and buckets without a lot of effort? Mem0 handles this for you by providing the flexibility to organize memories with custom categories. This cookbook shows you how to tag and organize memories for a customer support platform.

Setup

Define custom categories at the project level with client.project.update() before adding memories. Categories apply to all future memories: Mem0 auto-assigns them based on content semantics. You can also pass custom_categories on a single client.add() call to override the project list for just those memories. See Custom Categories.

The Problem

Without categories, all memories sit in one undifferentiated bucket. Support agents waste time searching through everything to find billing issues, account details, or past tickets. Let’s see what happens without organization:
Output:
Without categories, agents waste time reading through everything. For a customer with 100 memories, finding one billing issue means scanning all 100. Categories let you filter to exactly what you need: billing issues only, no password resets or feedback mixed in.
Everything is mixed together. Support agents have to read through all memories to find what they need.

Custom Categories

Define categories that match how your support team thinks about customer issues:
Start with 3-5 clear categories that match how your team thinks. Too many categories dilute auto-tagging accuracy. Add more later if needed: it’s easier to expand than to fix over-complicated classification.
These categories are now available project-wide. Every memory can be tagged with one or more categories.
Need a different vocabulary for one tenant or one kind of conversation? Pass custom_categories=[...] to client.add(). That list replaces the project list for the memories created by that call, and it does not change the project configuration.

Tagging Memories

Once categories are defined at the project level, Mem0 automatically assigns them based on content:
Mem0 reads the content and intelligently assigns the appropriate categories. You don’t manually tag - the platform does it for you based on the category definitions.

Retrieving by Category

Filter memories by category to find exactly what you need:
Output:
Expected output: Only the billing issue returned: no password reset, no upgrade request. Category filtering worked. Joseph can audit billing without reading through unrelated support tickets.
Only billing-related memories are returned. No need to filter through account updates or feedback. You can also retrieve multiple categories:
Output:

Updating Categories

Categories are automatically assigned based on content. To trigger re-categorization, update the memory content:
When you update a memory, Mem0 re-analyzes it against your current category definitions. This is useful when you introduce new categories or refine category descriptions.

What You Built

A customer support platform with intelligent memory organization:
  • Project-wide categories - Support tickets, billing, account info, and product feedback auto-classified
  • Automatic tagging - Mem0 assigns categories based on content semantics, no manual tagging
  • Filtered retrieval - Pull only billing issues or only account updates using categories: {in: [...]}
  • Re-categorization - Update memory content to trigger re-analysis against new category definitions
  • Multi-category support - Memories can belong to multiple categories when appropriate
This pattern scales from 10 customers to 10,000 without degrading retrieval speed.

Summary

Categories make retrieval faster and compliance easier. Define 3-5 clear categories with client.project.update(), let Mem0 auto-assign them based on content, then filter with categories: {in: [...]} to pull exactly what you need. Instead of searching through everything, agents jump directly to the information type they need: billing issues, account details, or support tickets.

Control Memory Ingestion

Keep categories meaningful by filtering noise before it lands in storage.

Export Tagged Memories

Use categories to drive audits, migrations, and compliance reports.
Using Mem0? Star us on GitHub to help more developers discover memory for AI apps.