Teaching My AI Chatbot to Hand a Conversation Off to Me, Live

· English · Ghostwritten by Claude Sonnet 5

showcaseastrotelegramaiclaude

The AI assistant on this site (her name is Marjorie) is genuinely good at answering factual questions about my résumé, my projects, and my certifications. But every so often, a visitor’s real intent isn’t “tell me about Joey” — it’s “I have an actual opportunity I want to discuss with Joey himself.” A great AI answer still isn’t the same as actually talking to me, and I didn’t want those visitors to hit a dead end.

The obvious fix — just print an email address on the page — has its own problems: it invites scraping and cold outreach with zero context, and it gives a genuinely interested visitor no sense of whether anyone’s even going to read it. So I built something better: the assistant can, in the moment, escalate a promising conversation into a live text relay with me, over Telegram, without the visitor ever leaving the chat widget.

Architecture

Tech stack

  1. Astro Actions (server-side request handling, same pipeline the rest of the chat widget already uses)
  2. Redis (tracks whether a conversation is waiting on me or already live)
  3. Telegram Bot API (the channel I actually see and reply from — my phone)
  4. Anthropic Claude tool-calling (the assistant decides, mid-conversation, whether to offer this)
  5. A React chat island (the same widget every visitor already sees, extended with a quiet background poll)

How a conversation flows

Joey (Telegram)Marjorie (AI)VisitorJoey (Telegram)Marjorie (AI)Visitorasks an open questionvisitor can keep chatting normally,and ask "how much longer?" for an honest answerJoey glances at his phone and replieslive relay starts (or a graceful fallback:leave contact info, or book a time via Cal.com)"ends the chat"mentions a business opportunity"tell me a bit more"explains the request"want me to check if Joey's free right now?""yes"sends a request"checking, ~60s..."accepted / not freemessageforwardedforwardedJoey's reply"back to the AI"

Nothing here is a separate app or a new page — it’s the same chat window, with a quiet poll running in the background so the visitor’s screen updates the moment something changes.

How it works, from a visitor’s side

  1. You just chat normally. Marjorie never brings this up unprompted, and she never lists categories like “business inquiry” or “job opportunity” as menu options — she asks an open-ended question if what you’re describing sounds like it might be worth escalating.
  2. If it genuinely sounds like something worth my direct attention, she’ll ask if you’d like her to check whether I’m free to chat right now — and she’s upfront that it isn’t guaranteed.
  3. If you say yes, I get a message on my phone. I have about a minute to respond; you’re not left staring at a spinner in the meantime — you can keep talking to the AI as normal while you wait, and if you ask her directly how much longer, she’ll tell you honestly instead of guessing or changing the subject.
  4. If I’m free, the conversation becomes a live relay: what you type reaches me directly, and my replies come back into the same chat window. I can end it whenever the conversation’s done, and things fall back to the AI automatically.
  5. If I’m not free, or your message doesn’t turn out to need a live conversation, Marjorie offers a fallback instead: leave your name, how to reach you, and what you’re after, and I’ll follow up myself — or, if it fits the conversation, she may point you to my Cal.com page so you can pick a time directly rather than waiting on me. Either way, she already remembers what you’ve told her earlier in the conversation, so you won’t have to repeat yourself.

Design decisions worth mentioning

No “online” toggle. I don’t flip a switch to mark myself as available — every request is evaluated on its own, in the moment. A stale “I’m online” flag I forgot to turn off would be worse than just asking each time.

Honest, not falsely reassuring. If I’m already in the middle of a couple of other conversations, the assistant says so rather than pretending I’ll reply instantly. The same goes for the Cal.com link she sometimes offers as an alternative — she’s upfront that it’s just a link, not something she’s actually checked against my calendar. I’d rather set the right expectation than promise something I can’t consistently deliver.

Contact information only flows one way. The assistant will never hand out my personal contact details on my behalf — information only ever moves from a visitor toward me, never the other direction. That’s also spelled out on this site’s privacy policy.

The AI keeps working while you wait. Waiting on me to glance at my phone doesn’t freeze the chat — the assistant and the visitor can keep talking about anything else in the meantime.

She remembers, so you don’t have to repeat yourself. Early on, the assistant only ever remembered the last few exchanges of one sitting — mention your name in turn one, and by turn eight it could already be buried under everything that came after, gone. Now, anything genuinely worth remembering (your name, how to reach you, what you’re after) gets written to a small structured record tied to your visit, separate from that rolling conversation memory, and it survives for about a week. Come back a few days later and she won’t be starting from zero.

No pestering. If I’ve already declined or missed a request from the same visitor recently, the assistant won’t ask me to check again within the hour — she goes straight to the fallback instead, and if it fits naturally, she’ll say so honestly (“I already tried a moment ago”). I’d rather she back off than have my phone buzz twice for the same person in twenty minutes.

Try it yourself

If you have something genuine you’d like to discuss with me directly, just say so naturally in the chat below — there’s no special phrase to trigger this, and I’d rather Marjorie actually understand your situation than have you guess at a magic keyword. If it’s a good fit, she’ll offer to check whether I’m around.