One evening I wanted to see what happens when you let an LLM react to its own thoughts — whether the conversation drifts somewhere unexpected or just loops back on itself.
Alone is the result. A character walks around an empty HTML5 Canvas. Every now and then it generates a thought, then reacts to that thought, then reacts to the reaction. The full code is on GitHub.
What it does
The character moves through an empty space with no awareness of its environment — it just walks. What it does track is its own inner monologue. Each new thought is fed back as context for the next one, so the character keeps building on what it just said.
The question I was trying to answer: does it escalate, drift toward something unexpected, or just spiral into repetition? GPT-3.5 handles the generation, the Web Speech API reads each thought aloud, displayed in a dialogue bubble above the sprite.
You can also control the character with arrow keys, but the conversation runs independently.
Stack
- Frontend: HTML5 Canvas, JavaScript, sprite animation
- Backend: Node.js, Express
- AI: OpenAI GPT-3.5
- Voice: Web Speech API
Why I built it
The self-loop angle is the whole point. Watching a thought accumulate and mutate over several exchanges is more interesting than a single generation. And putting it inside a wandering character rather than a terminal gives it a different feel — the isolation of the empty space mirrors what the model is doing: talking to no one but itself.