Skip to content

MEMOIRNPC MEMORY ENGINE

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.

SHOWCASE_DEMO.MP4
Memoir Video Cover
PLAY SHOWCASE

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

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

Released under the MIT License.