r/ProgrammerHumor • • 2d ago

Other vibeCodeMasterClass

Post image
9.3k Upvotes

609 comments sorted by

View all comments

Show parent comments

14

u/monsoy 1d ago

I think it could be interesting to treat AI NPC’s context window as their memory. It makes sense that characters forget things you say to them after a while, so the game could be designed to make the context window less game breaking or immersion breaking

3

u/ShellTrajectory 1d ago

It's not a terrible idea, but I think what's likely is that the npc is supposed to know things like "hide that you're a spy", and suddenly they forget that they're supposed to hide it, but their historical prompts are full of messages about "You're a spy, but you didn't mention it."

Or "You know about X thing happening because you're a spy, but you ask about it anyways."

6

u/Whitestrake 1d ago

That's a real problem in AI and it was solved pretty early on in the piece.

When people say "context" what they mean is prompt + conversation history + user's latest message, fed as one big "model input" block.

Every single time you run the model it only "remembers" what you feed it, and the conversation history is the part that gets compacted. The model always has the full accurate prompt + message, so the NPC will never forget it is a spy and that it wants to try hide that from you. With respect to an actual currently-operating model there is no "historical prompt", there's only what it currently has been fed for this run.

REAL iteration on this front would involve doing some super smart stuff with progress gates and quest flags and stuff that modify the prompt component of the context so that if you discover they're a spy, their prompt changes to say "you're a spy, but you were uncovered (X ingame days ago) when the player accused you with the evidence they found (at Y location)" or something.

1

u/Ae3qe27u 1d ago

Janitor is a website with a script setup that I think could be conceptually adapted to something like that. And there are chatbot roleplay platforms (not j ai) that have chats that go on for pretty long durations. Small details get missed, but I feel like it could work. You'd have to figure out the computational power, though. Would have to be a subscription model or something.