Tagging and Organizing Memories Fresh
Use metadata and categories to organize memories for efficient retrieval.
Metadata Tagging
python
client.add(
messages, user_id="alice",
metadata={"category": "food", "source": "chat", "priority": "high"}
)Filtering by Tags
python
results = client.search(
"preferences", user_id="alice",
filters={"metadata": {"category": "food"}}
)Custom Categories
python
client.add(
messages, user_id="alice",
custom_categories={
"dietary": "Food preferences and restrictions",
"travel": "Travel destinations and preferences"
}
)Best Practices
- Keep category names consistent across your application
- Use flat metadata (no nested objects)
- Start with 2-3 categories and expand as needed