What problem does it solve? It defines how an AI agent should handle requests arriving from Telegram through the pi-telegram bridge, covering reply ownership, direct delivery, attachments, interactive buttons, voice messages, and multi-thread routing without breaking bridge transport rules. ## Core Features & Use Cases - Turn Recognition and Reply Ownership: Parses structured Telegram context markers like [telegram|thread:name|from:user], [reply], [attachments], and [voice] so the agent answers the current turn correctly without duplicating delivery. - Direct Delivery and Attachments: Uses telegram_message and telegram_attach for explicit cross-target delivery and file sending, with fail-closed behavior for unknown or unauthorized targets. - Assistant-Authored Buttons and Voice: Emits telegram_button and telegram_voice HTML comments to create prompt buttons and TTS voice messages, including JSON, matrix, and Compact Matrix Literal forms. - Threaded Mode and Diagnosis: Routes across live Pi Threads, configures inbound/outbound handlers in telegram.json, and diagnoses bridge health via telegram-status and state/log files. - Use Case: A user messages your Pi agent from Telegram asking for a generated report; the agent replies in phone-friendly Markdown, attaches the file with telegram_attach, and offers follow-up action buttons. ## Quick Start Ask the agent to reply to the incoming Telegram message and attach the generated report file to the current Telegram conversation.