Skip to content

Telegram messaging adapter (Phase 0) — pull forward from v0.23.0 #889

@kovtcharov

Description

@kovtcharov

Goal

Ship a Telegram messaging adapter in v0.18.2 (May 22) — pulled forward from v0.23.0 (Jun 23). The "your agent lives in Telegram" experience is a category-defining consumer feature; competitors ship it day-one.

Why pull this forward (5+ weeks)

GAIA's current roadmap puts all messaging adapters in v0.23.0 (Autonomous Agent Infrastructure, Jun 23). The flagship comparator — Hermes Agent (Nous Research) — ships 15+ messaging gateways (Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Mattermost, Email, SMS, …) on day one. AMD's own April 2026 blog "Run Hermes Agent Locally on AMD Ryzen AI Max+" recommends Hermes specifically because of this.

For consumer positioning ("your agent meets you where you already chat"), the gap is 8+ weeks of competitive disadvantage. Telegram is the cheapest unlock — python-telegram-bot is mature, no business-account hoops (unlike WhatsApp), no enterprise SSO (unlike Slack). One adapter ships the pitch.

Scope (single PR for v0.18.2)

A. Telegram bot adapter

  • Create src/gaia/messaging/telegram.py — wraps python-telegram-bot
  • Subscribe to /start, /help, /clear slash commands + free-form text
  • Bridge to existing AgentSDK (gaia.chat.sdk) — every Telegram message becomes a chat turn
  • Stream agent response chunks back as Telegram message edits (matches Hermes UX)
  • Support file attachments (image upload → VLM, document → RAG ingest)

B. CLI integration

  • New CLI: gaia telegram start --token $TELEGRAM_BOT_TOKEN [--allowed-users ...]
  • Daemon mode (--background) with health check endpoint
  • Per-user session isolation — each Telegram user_id maps to a distinct GAIA session
  • Allowed-users gate (env GAIA_TELEGRAM_ALLOWED or --allowed-users 12345,67890) — privacy default

C. Security defaults

D. Documentation

  • docs/guides/telegram.mdx — setup walkthrough (BotFather → token → gaia telegram start)
  • Privacy section: tokens stay local, messages stay local (Lemonade), only Telegram's transit goes through Telegram servers
  • Add to docs/docs.json navigation

E. Tests

  • Unit tests with mocked python-telegram-bot Updater
  • Integration test gated behind GAIA_TELEGRAM_TEST_TOKEN env (skipped in default CI; runs nightly)

What this is NOT

Acceptance criteria

  • gaia telegram start --token $TOKEN boots and the bot responds to /start within 5 seconds
  • Free-form messages produce streaming agent responses with Telegram message edits
  • Image upload → VLM tool fires → response cites image
  • File upload (.pdf, .csv) → RAG ingest → subsequent question retrieves correctly
  • Allowed-users gate rejects messages from unlisted users with a polite error
  • Restricted tool set is enforced by default (verified via test that requests a shell command)

Attribution / prior art

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentconsumerBlocks consumer adoption — must ship for the v0.20.0 consumer launch windowdomain:surfacesAgent UI, Telegram, WhatsApp, Slack/Discord, mobileenhancementNew feature or requestp1medium prioritytrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions