Skip to main content
MemContext has two grouping primitives: scope and project. They are intentionally different.

Scope is the isolation boundary

Use scope when one API key serves multiple app users, organizations, workspaces, or tenants.
{
  "content": "User prefers concise release notes",
  "category": "preference",
  "scope": "user_123"
}
When scope is provided, MemContext only saves, searches, lists, profiles, updates, deletes, and graphs memories inside that exact scope. When scope is omitted, MemContext uses the unscoped/global memory lane only. Unscoped requests do not search across named scopes.

Project is a grouping filter

Use project to group memories inside the selected scope.
{
  "content": "This project uses PNPM",
  "category": "fact",
  "scope": "user_123",
  "project": "memcontext"
}
Projects are not a security boundary. They are a soft filter for project-specific context inside a scope or inside the global/unscoped lane.
FieldUse forExample
scopeHard app-user, tenant, org, or workspace laneuser_123, org_acme_42
projectSoft grouping inside that lanememcontext, supportbot
For a SaaS app, a good scope is the stable end-user or tenant ID from your own database. For a coding assistant, you can omit scope for personal/global memory and use project only when the project is known.

API behavior

All memory operations follow the same rule:
RequestResulting memory lane
No scopeOnly unscoped/global memories
scope=user_123Only memories in user_123
scope=user_123&project=xOnly project x memories inside user_123
Use the same scope when calling get, update, delete, history, or feedback for a scoped memory. Passing the wrong scope returns 404 instead of leaking data from another scope.

SDK example

import { MemContextClient } from "memcontext-sdk";

const client = new MemContextClient({
  apiKey: process.env.MEMCONTEXT_API_KEY!,
});

const userMemory = client.withScope("user_123");
const projectMemory = userMemory.withProject("memcontext");

await projectMemory.save({
  content: "User prefers concise release notes",
  category: "preference",
});
See the TypeScript SDK for full usage.