Idea · Jul 2, 2026

Persistent NPC Memory Engine

Students build a conversational game NPC with retrievable long-term memory: every player dialogue turn is embedded and stored in Supabase pgvector so the NPC can recall specific past events, form evolving opinions about the player, and exhibit measurable persona drift across extended sessions.

What it would do

Students design and implement a conversational game NPC (shopkeeper, quest giver, or villain) that maintains a persistent memory of every past conversation with a player. Each dialogue turn is embedded via the Claude API and stored in Supabase pgvector. When the player speaks, the NPC retrieves the three most semantically similar past memories via cosine similarity, injects them into the system prompt, and generates a response that references or reacts to prior events. Students also implement a lightweight 'persona state' vector tracking trust, curiosity, and hostility levels toward the player, updated after each exchange using sentiment classification. The assignment culminates in a controlled comparison: students test their NPC with (a) RAG retrieval memory, (b) rolling summarization memory, and (c) no memory, then write a reflection on narrative coherence, response latency, and token cost across the three strategies.

Key features

  • Every dialogue turn embedded with Claude API and stored in Supabase pgvector; retrieval via cosine similarity
  • Persona state vector (trust, curiosity, hostility) updated per exchange using sentiment classification
  • Three memory strategies to implement and compare: RAG retrieval, rolling summarization, sliding window
  • Simple web frontend to play as the player and inspect the NPC's current memory store and persona state in real time
  • Written reflection comparing strategies on narrative coherence, latency, and API token cost

More in Games & Puzzles

Procedural Game Balance Tester

Students implement a turn-based game with a defined API; an AI harness runs thousands of Monte Carlo playthroughs to surface dominant strategies, snowball effects, and unreachable game states, then generates a balance report with replay links.

Games & PuzzlesClass assignmentLargeJul 7, 2026

Behavior Tree Studio

Students build a visual drag-and-drop behavior tree editor for game NPCs, with a Claude assistant that explains the tree in plain English, warns about edge cases, and exports a runnable TypeScript or Python runtime.

Games & PuzzlesClass assignmentLargeJun 20, 2026

Tiny 2D Game Engine

js). The project is scaffolded into weekly milestones that end with students demoing a playable game built entirely on their own engine.

Games & PuzzlesClass assignmentLargeJun 17, 2026

Constraint Dungeon

A puzzle game where players solve programming challenges under creative constraints: sort a list without comparison operators, implement a calculator using only bitwise ops, reverse a string without slicing or indexing. Each "room" of the…

Games & PuzzlesClass assignmentLargeJun 11, 2026

All 41 ideas in Games & Puzzles →