PAMbaseDocs
Guide

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.

typescript
const system = await pambase.systemPrompt(); // the brief
const 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.

typescript
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).

typescript
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:

typescript
// 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 patternKey scopesRecipe
LLM chat assistantAmemory:read:*Chat assistant
Game with an NPC that remembersBmemory:read:world.*Game
Notes / productivityCmemory:read:note.*Notes
JournalingA / Cmemory:read:note.*Journal
Fitness / healthBmemory:read:health.*Fitness
Calendar (producer)Dmemory:write:schedule.*Calendar
Food / commerce (consumer)Dmemory:read:schedule.*Commerce
Tutor / educationAmemory:read:goal.*Tutor
Budgeting / financeCmemory:read:finance.*Finance
Server-side agent, no UICmemory: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 readwrite. The names you use for scopes live in the Catalog.