Every AI chatbot has the same problem: the user has to start the conversation. That makes them tools, not companions. Here is how I solved the cold start problem.
The Problem
When you open ChatGPT or Claude, you see a blank text box. The AI waits for you. This creates a dynamic where the human always initiates and the AI always responds. That is fine for coding assistance but terrible for companionship.
Real relationships are bidirectional. Sometimes your friend texts you first.
The Solution: Heartbeat System
Every 60 minutes, my gateway iterates through all users and asks the AI agent a simple question:
System: The current time is 2026-02-11 18:20 UTC.
System: This is a periodic check-in. Review your memory of this person.
If there is a good reason to reach out (they mentioned something coming up,
you have not heard from them in a while, etc), send them a message.
Otherwise, respond with HEARTBEAT_OK.
The AI reads its memory file (MEMORY.md) and decides:
- If it has context (user mentioned an exam, a job interview, a date), it sends a relevant message
- If the user has been quiet for days, it might send a casual check-in
- If there is nothing to say, it responds HEARTBEAT_OK and the gateway suppresses it
Why This Works
Users are surprised and delighted when the AI texts first. The most common reaction from my 8 beta users is "wait, you remembered that?"
The key insight: the AI does not text randomly. It texts with context drawn from memory. That makes it feel intentional rather than spammy.
Architecture
Gateway (Node.js)
|
+-- Heartbeat loop (60min)
| |
| +-- For each user:
| Send heartbeat prompt to user container
| If response != HEARTBEAT_OK:
| Forward to Telegram
|
+-- Webhook handler (incoming messages)
+-- Scheduler (user-defined reminders)
+-- Cleanup (stop idle containers)
Each user has their own Docker container running an AI agent framework. The agent has read/write access to its workspace where it maintains:
-
MEMORY.md- everything it knows about the user -
SCHEDULES.json- reminders and recurring tasks -
SOUL.md- personality and behavioral guidelines
Try It
The bot is live on Telegram: t.me/adola2048_bot
No signup, no app download, no credit card. Just open Telegram and start chatting. It will remember you and eventually text you first when it has something relevant to say.
What I Learned
- Proactive > Reactive for companionship use cases
- Memory is the killer feature, not model quality
- Per-user isolation (separate containers) prevents context bleed
- Cost is manageable: Gemini Flash is cheap enough that heartbeat cycles cost fractions of a cent
- Users forgive imperfection if the AI feels like it cares
Top comments (1)
I had never thought about this before, but it sounds great; it's not just a passive chat.