Skip to content

Card 2: Research desk, always on

The same desk, alive 24/7 in your Telegram. Card 1's agent is one of its tools.

LazyPulse keeps a lead agent running. Message your bot any question and get a cited answer back in the chat. Every weekday at 08:00 UTC it also sends you a morning brief on its own.

Research desk, always on research_pulse is an always-on LazyPulse PulseAgent powered by Claude Code Opus. Owner-only Telegram messages arrive through TelegramInbox with TelegramPolicy. A Cron schedule requests a morning brief on weekdays at 08:00 UTC. Its tools are research_desk, the whole Card 1 agent containing the lead and research_brief pipeline, plus deep_research and fact_check. research_pulse replies in the same Telegram chat. Card 1's agent becomes one tool. Research desk, always on LazyPulse Telegram message TelegramInbox Owner only TelegramPolicy Cron schedule Weekdays · 08:00 UTC Morning brief LazyPulse · PulseAgent research_pulse Claude Code · Opus · always on tools Choose a tool research_desk lead + research_brief pipeline The whole Card 1 agent deep_research Claude Code Sonnet · web fact_check Codex Terra · web Telegram reply Back to the same Telegram chat Card 1's agent becomes one tool Claude Code Codex

How it is built

  1. Import Card 1. from research_desk import desk, sonnet, terra: the whole desk is one object, and it becomes a tool.
  2. A PulseAgent is an Agent that never stops. Same engine= and tools=, plus where work comes from (adapters=, calendar=) and who may ask (policy=).
  3. Telegram in, Telegram out. TelegramInbox polls your bot and replies in the same chat; TelegramPolicy lets only you talk to it.
  4. A calendar. Cron("morning", ...) fires a task on schedule; notify=True sends the result to you.

The code

"""Card 2: the same research desk, always on, in your Telegram.

LazyPulse keeps a lead agent (Claude Code, Opus) running. Its tools are the
research desk from Card 1 plus the two specialists. Message your bot any
research question; every weekday at 08:00 UTC it also sends a morning brief.

    export TELEGRAM_TOKEN=123456:ABC...   # from @BotFather
    export TELEGRAM_OWNER_ID=123456789    # your numeric Telegram id
    python research_desk_pulse.py
"""

import os

from lazypulse import Calendar, Cron, PulseAgent
from lazypulse.adapters.telegram import TelegramInbox, TelegramInboxConfig, TelegramPolicy
from lazytools.connectors.telegram import TelegramClient
from research_desk import desk, sonnet, terra

from lazybridge import ClaudeCodeEngine, Store

# Prompts
LEAD = (
    "You are an always-on research assistant. For a research question call "
    "research_desk. For a quick lookup call deep_research or fact_check. "
    "Reply in a few lines, with sources."
)
MORNING = "Brief me on the most important AI developer-tools news of the last 24 hours."

# Telegram: only the owner can talk to the bot
owner = int(os.environ["TELEGRAM_OWNER_ID"])
telegram = TelegramClient.from_token(os.environ["TELEGRAM_TOKEN"])

# Lead: Card 1's desk and the two specialists are all tools
pulse = PulseAgent(
    name="research_pulse",
    engine=ClaudeCodeEngine(model="opus", system=LEAD, web=False),
    tools=[desk, sonnet, terra],
    store=Store(db="research_pulse.db"),
    adapters=[TelegramInbox(telegram, TelegramInboxConfig(bot_id="research_pulse"))],
    policy=TelegramPolicy(owner_ids=[owner]),
    calendar=Calendar([Cron("morning", MORNING, "0 8 * * MON-FRI", notify=True)]),
    scheduled_responder=lambda text, *_: telegram.send_message(chat_id=owner, text=text[:4000]),
    max_concurrent_inbound=1,
)

if __name__ == "__main__":
    print("Always on. Message your bot; Ctrl-C to stop.")
    pulse.serve()

Run it

  1. Create the bot and find your owner id: see Set up the Telegram bot.
  2. Start it:
export TELEGRAM_TOKEN=123456:ABC...
export TELEGRAM_OWNER_ID=123456789
python research_desk_pulse.py

It runs in the foreground; stop it with Ctrl-C.