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#
- Untagged memories have no tag; an unscoped search sees everything (tagged and untagged), a scoped search sees only that tag.
- Tags work in all three search modes (vector / text / hybrid) and cross-collection.
- Free-form strings up to 128 chars — user ids, session ids, document sets.
Tags vs collections#
| Collection | Container tag | |
|---|---|---|
| Granularity | coarse (a project, an app) | fine (an end-user, a session) |
| Quota | counted per tier | unlimited |
| Profile | per collection | — |
Rule of thumb: collections for your structure, container tags for your users' structure.