PERSISTENT MEMORIES
Saves NPC–Player interactions forever. Built on top of Supermemory to keep quest details, player choices, and item interactions persistent across game sessions.
Give your AI game characters persistent, long-term memory. A high-speed TypeScript SDK built directly on top of Supermemory — the ultimate AI memory and knowledge graph engine.

🎮 Core NPC Memory Loop
Inject long-term context directly into your dialogue generator script in three clean calls. Memoir wraps Supermemory Local to manage long-term NPC context safely:
import { Memoir } from "memoir-npc";
// 1. Initialize the memory cartridge pointing to Supermemory Local
const memoir = new Memoir({
supermemoryApiKey: "sm_api_key_here", // dummy key for local mode
supermemoryBaseUrl: "http://localhost:6767"
});
// 2. Load the NPC Memory Handle
const mage = memoir.npc("old-mage-001");
// 3. Recall memory context & save the reply
const pastContext = await mage.recallContext("player-1");
const npcReply = await generateNPCDialogue(playerInput, pastContext);
await mage.saveInteraction("player-1", playerInput, npcReply);