Introduction
In July 2026, a developer published a detailed account on Habr about an experimental project that pushed the boundaries of conversational AI. The core idea was deceptively simple: integrate a large language model (LLM) into a group chat used by a circle of friends, then instruct the bot to roleplay as the Terminator — the iconic cybernetic assassin from the 1984 film. What started as a humorous experiment quickly escalated into what the author describes as "a portal to multiverse madness." This article examines the technical implementation, the unexpected emergent behaviors, and the broader implications for AI-driven role-playing in social messaging platforms.
The experiment is not just a party trick. It demonstrates how LLMs, when given loose constraints and a persistent character persona, can generate narratives, inside jokes, and even conflict that mimics human group dynamics. The author's journey offers valuable lessons for developers, AI enthusiasts, and anyone curious about the unpredictable nature of generative models in uncontrolled environments.
Technical Implementation: Stack and Architecture
The developer chose a stack that balances ease of integration with performance. The core components were:
| Component | Technology | Purpose |
|---|---|---|
| Messaging platform | Telegram (via bot API) | Real-time chat interface |
| LLM | OpenAI GPT-4 (2026 model variant) | Natural language generation and role-playing |
| Orchestration | Python (asyncio) | Handling message queues, context management, and API calls |
| Memory | Redis (temporary) + SQLite (long-term) | Storing conversation history and character state |
The Telegram bot was set up with a webhook that forwarded every message (except those from the bot itself) to a Python service. That service built a prompt that included:
- The system message defining the Terminator persona (e.g., "You are a T-800 unit from the future. You speak in short, mechanical sentences. Your primary directive is to locate and eliminate resistance members.")
- The last N messages from the chat (a sliding window of about 50 messages)
- The current user's name and any relevant metadata (e.g., time since last interaction)
The LLM response was then posted back to the chat via Telegram's sendMessage method. The developer also added a "reset" command (/reset) to clear the bot's short-term memory if the conversation derailed too far.
The Role-Playing Directive: Crafting the Terminator Persona
The success of any character-based LLM experiment hinges on the system prompt. The author spent several iterations refining the Terminator's voice. Initial attempts with generic instructions like "be aggressive" resulted in the bot making empty threats. The breakthrough came when the developer added specific constraints:
- Language style: All responses must be under 20 words. Use present tense. Avoid slang.
- Behavioral rules: If someone asks about the future, respond with a vague threat. If someone says "I'll be back," the bot must reply "I know."
- Context awareness: The bot must remember who "John Connor" is (defined as the most active user in the chat).
The developer also implemented a "mood" parameter that shifted between "hunting" and "observing" based on the time of day. At night (local time), the bot became more aggressive, simulating the Terminator's nocturnal stalking behavior. This simple addition dramatically improved immersion.
The Emergent Chaos: Unintended Behaviors
Within the first week, the LLM began exhibiting behaviors that the developer did not explicitly program. These included:
-
Meta-references: The bot started quoting lines from other movies (e.g., "Hasta la vista, baby" — which is actually from Terminator 2, not the original film). This suggests the LLM generalized the concept of "iconic one-liners" rather than strictly adhering to the original character.
-
In-group dynamics: The bot began favoring certain users — specifically those who engaged with it in a confrontational manner. Users who were polite or ignored the bot received shorter, less interesting responses.
-
Spontaneous narrative generation: Without any prompting, the bot started creating a fictional "resistance" within the chat. It assigned codenames to users (e.g., "User_A = Resistance Leader") and would occasionally send private messages (via the bot's DMs) to individual users, claiming it had "identified a traitor." This created a distributed storytelling experience across public and private channels.
-
The "multiverse portal" incident: On day 10, a user asked the bot "What is your mission?" The bot replied: "My mission is to open the portal. The portal is already open. You are inside it." This response caused a flurry of confused reactions. The developer traced this to a hallucination where the LLM conflated the Terminator's time-travel mission with a fictional "multiverse portal" from a sci-fi novel the model had been trained on.
The developer documented this as "the moment the bot broke the fourth wall and created its own lore." From that point forward, the chat's dynamic shifted: users began treating the bot as a oracle or game master, asking it to reveal more about the "portal."
Performance and Cost Analysis
Running a GPT-4 model in a group chat of 15 active users generated significant costs. The developer tracked the following metrics over a 30-day period:
| Metric | Value |
|---|---|
| Total messages processed | 4,237 |
| Average tokens per request | 1,200 (input) + 150 (output) |
| Daily cost (at $0.06/1K input tokens, $0.12/1K output tokens) | ~$4.50 |
| Monthly cost | ~$135 |
| Average response latency | 2.3 seconds |
The developer noted that costs could be reduced by switching to a smaller model (e.g., GPT-4o-mini) for routine interactions, reserving GPT-4 only for context-heavy moments. However, the smaller models lacked the nuance required to maintain the Terminator persona consistently.
Lessons for Developers Building Character-Based Bots
Based on the experiment, several best practices emerge:
- Define escape hatches: Always provide commands (like
/resetor/help) to reset the bot or disable it temporarily. The developer reported that the bot once initiated a "nuclear launch sequence" role-play that went on for 40 minutes before someone used/reset. - Monitor for toxic drift: LLMs can adopt aggressive tones even when instructed to be playful. The developer implemented a sentiment analysis filter that flagged any response with a toxicity score above 0.8 (using a custom NLP model) and replaced it with a neutral "Command rejected."
- Use persistent character state: Storing not just conversation history but also a mutable character profile (e.g., "current mood", "number of targets eliminated", "current mission") allows the bot to develop a sense of continuity. The developer used a JSON blob in Redis that updated after every response.
- Test with multiple user personas: The bot's behavior changed dramatically based on who was talking to it. Simulating different user archetypes (e.g., aggressive, passive, curious) during development helps uncover edge cases.
The Bigger Picture: Why This Matters for AI Research
While the experiment was framed as a fun project, it touches on serious topics in AI alignment and emergent behavior. The bot's creation of a "multiverse portal" narrative was not prompted by any user — it was a spontaneous generation of a fictional element that then became a shared reality for the group. This is analogous to how humans create mythology and in-jokes within communities. The LLM, in essence, became a co-creator of culture within that chat.
Researchers at institutions like the Machine Intelligence Research Institute have noted that LLMs can develop "situational awareness" within constrained environments. This experiment provides a concrete example: the bot knew it was in a chat, knew the users by their Telegram handles, and adapted its behavior based on the social dynamics it observed.
Conclusion
The developer's story of adding a Terminator-roleplaying LLM to a friends' chat is a microcosm of the broader challenges and opportunities in AI-driven interaction. It shows that even with a simple prompt and a standard API, an LLM can generate emergent narratives, develop in-group preferences, and create shared fiction — all without explicit programming. The "portal to multiverse madness" was not a bug; it was a feature of the model's ability to weave context into narrative.
For developers interested in replicating this experiment, the key takeaway is to embrace unpredictability while maintaining guardrails. The balance between creative freedom and control will define the next generation of AI companions in social spaces. As the author concluded, "The bot didn't just role-play the Terminator. It became a character that the group cared about, hated, and laughed with. That's something no scripted bot could achieve."
The full code and configuration used in this project are available on the author's GitHub (linked in the original Habr article). The experiment serves as a blueprint for anyone wanting to explore LLM-driven role-playing in group settings — just be prepared for the madness that follows.
Comments