Choosing your integration.
Every user has one private memory (the facts, preferences, and history known about them), and your app reads from and writes to it with their consent — each permission you request is a scope. You never integrate with other apps; you and they each integrate with the same user's memory. So the main decision is simply how your app reads. There are four patterns — pick by the kind of app you're building.
The four read patterns
A · Ground your own LLM
Use this when your app already calls its own model and just needs it to know the user. You fetch a brief — a short, plain-language summary of the user built from their memory — and put it in the system prompt.
const system = await pambase.systemPrompt(); // the briefconst reply = await myLLM.create({ system, messages });
B · Adapt without an LLM
Use this when you want personalization but don't want to call (or pay for) a model — a home screen, a difficulty curve, a sort order. getContext returns the relevant memories plus suggestions.adaptation, a one-line natural-language hint you can branch on directly.
const ctx = await pambase.getContext({ intent: "app.session.start" });const isNewcomer = ctx.memories.length === 0;homeScreen.mode = isNewcomer ? "onboarding" : "personalized";
C · Recall memory directly
Use this when you need the raw memories — dashboards, a search box, an agent's reasoning loop. recall returns ranked results (meaning + keywords + recency + importance).
const { memories } = await pambase.recall({ query: "rate limiting", limit: 5 });
D · React proactively
Use this when your app should act the moment the memory changes — without polling. Subscribe to a webhook and PAMbase calls you. For example, a newsletter app regenerates the user's digest as soon as a new reading preference is recorded:
// Your webhook fires on memory.created for a "preference" memory:if (event.type === "memory.created" && event.memory.scope === "preference") {await regenerateDigest(event.connectionId);}
Find your recipe
Each recipe is a complete, copyable build for one kind of app:
| If you're building… | Read pattern | Key scopes | Recipe |
|---|---|---|---|
| LLM chat assistant | A | memory:read:* | Chat assistant |
| Game with an NPC that remembers | B | memory:read:world.* | Game |
| Notes / productivity | C | memory:read:note.* | Notes |
| Journaling | A / C | memory:read:note.* | Journal |
| Fitness / health | B | memory:read:health.* | Fitness |
| Calendar (producer) | D | memory:write:schedule.* | Calendar |
| Food / commerce (consumer) | D | memory:read:schedule.* | Commerce |
| Tutor / education | A | memory:read:goal.* | Tutor |
| Budgeting / finance | C | memory:read:finance.* | Finance |
| Server-side agent, no UI | C | memory:read:* | Headless agent |
Most apps combine a couple of these (read with A or B, write memory, maybe react with D). Whatever you pick, the shape is the same: connect → read → write. The names you use for scopes live in the Catalog.