Skip to main content
MemContext gives you two simple fields for organizing memory: scope and project. Use scope when your API key serves more than one user, tenant, organization, or workspace. Use project when you want to group related memories inside that scope. For Context Vault, there are two additional fields: workspaceId and optional vaultId. The workspace is the hard company/team/account boundary. A vault is the shared knowledge container inside that workspace. scope is a hard lane inside the selected workspace or vault. project is a soft grouping inside the selected scope.

Scope

scope is the isolation key. A search with one scope only returns memories saved with that same scope.
Good scope values are stable IDs from your own app, such as:
  • user_123
  • org_acme
  • workspace_42
  • tenant_kakiyo
If you omit scope, the memory belongs to the default area for that API key. Named scopes are not included unless you pass that scope again during search, update, delete, feedback, or history calls.

Project

project is a filter inside the selected scope. It is useful for product areas, repositories, support queues, or customer workspaces.
Projects are not meant for tenant isolation. If two customers must never see each other’s memories, put them in different scopes.

Context Vault Semantics

For company knowledge bases: Use scope when retrieving the wrong lane would be risky. Use project when you only need a helpful filter or collection label. Context Vault search also supports multi-scope retrieval with scopes.
When scopes is provided, MemContext searches those named lanes inside the selected workspace vault. It does not search other workspaces or vaults.

Which Field Should I Use?

Common Patterns

For a SaaS product:
For a coding assistant:
For a multi-tenant AI app, always pass the same scope on save and search:
See the TypeScript SDK for full usage.