TypeScript SDK
@cognimemo/client — the official TypeScript / JavaScript client.
npm install @cognimemo/clientQuickstart
import { CognimemoClient } from "@cognimemo/client";
const cm = new CognimemoClient({ baseUrl: "https://api.cognimemo.com", apiKey: "cmk_live_…" });
await cm.retain("[email protected]", "Jane ships on Fridays.");
const res = await cm.recall("[email protected]", "when does Jane ship?");
res.results.forEach((r) => console.log(r.type, r.text, r.scores));
const answer = await cm.reflect("[email protected]", "What is Jane's release cadence?");Data model — space → bank → memories
await cm.createSpace("acme", { name: "Acme Corp" });
await cm.retain("[email protected]", "Jane prefers dark mode", { space: "acme" });
await cm.recall("[email protected]", "what does jane prefer?", { space: "acme" });
await cm.listSpaceBanks("acme");Typed memory blocks
Each helper stores a distinct memory type that's processed and recalled differently — procedure (how a task is done), reasoning (why a decision was made), preference (how the user wants things), correction (a "no, do it this way" signal), profile (the user's tools/access). See Memory types & typed blocks for what each means and when to use it.
await cm.retainPreference("[email protected]", "For day-planning, use personal Gmail, never work mail.");
await cm.retainProcedure("[email protected]", ["make build", "kubectl apply -f prod.yaml"], { rationale: "prod deploy" });
await cm.retainReasoning("[email protected]", "Chose gRPC over REST: p99 latency mattered more.");
await cm.retainCorrection("[email protected]", "No — drain the pod before restart.");
await cm.updateProfile("[email protected]", "Admin on AWS, GitHub, Grafana.");
// any type directly:
await cm.retain("[email protected]", "Acme HQ is in Berlin.", { factType: "world" });
// type-filtered recall:
await cm.recall("[email protected]", "how to deploy", { types: ["procedure"] });See Typed memory blocks for the full list.
Layered / org memory
await cm.retain("__org__:acme", "Deploy freeze every December.");
await cm.recallLayered("[email protected]", "deploy policy", { space: "acme" });Entities
await cm.retain("[email protected]", "Jane joined the DeepMind team on Gemini.", {
entities: [{ text: "Jane", type: "PERSON" }, { text: "Gemini", type: "PROJECT" }],
});
// no-LLM auto-entities for verbatim ingest (off by default):
await cm.updateBankConfig("[email protected]", { retainAutoEntities: true });Encryption at rest
Encryption is a project-level policy set in the console (Settings → Security), not an SDK call. When it's on, memories are stored encrypted and the SDK keeps returning plaintext — nothing changes in your code. See Encryption at rest.
Recall response
recall(...) resolves to a RecallResponse with .results (each a RecallResult) and .usage. Each result carries type, text, context, occurred_start / occurred_end / mentioned_at, entities, and scores ({ final, semantic, keyword }). .usage includes tokens_used and org_blended for layered recall.