Container Tags

A lightweight sub-namespace inside a collection. The typical use: your product has many end-users — tag each memory with the end-user's id, and scope searches to them.

Write with a tag#

# Python
mem.add("prefers metric units", collection="prefs", container_tag="user-alice")

# HTTP
POST /v1/memory/collections/prefs/memories
{"text": "prefers metric units", "container_tag": "user-alice"}

Search scoped to a tag#

# Python — only alice's memories are searched
mem.search("units?", collection="prefs", container_tag="user-alice")

# HTTP — works per-collection and across all collections
POST /v1/memory/search
{"query": "units?", "container_tag": "user-alice"}

Semantics#

Tags vs collections#

CollectionContainer tag
Granularitycoarse (a project, an app)fine (an end-user, a session)
Quotacounted per tierunlimited
Profileper collection

Rule of thumb: collections for your structure, container tags for your users' structure.