Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arivu.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

What the backend needs

The Telegram adapter in integrations/telegram_adapter.py is the most feature-rich chat adapter:
  • TELEGRAM_BOT_TOKEN or token
  • Optional admin_user_ids for approval control
  • Optional voice support dependencies for transcription
  • Optional OCR dependencies for image queries

What Telegram users can do

Text Queries

Send a normal message and Arivu will answer with a natural language result.

Voice Messages

Send voice messages and Arivu will transcribe them before running the pipeline.

Image Messages

Send screenshots or photos and Arivu will OCR the text before querying.

Approval Buttons

Destructive SQL gets inline Approve / Reject buttons for admins.

Setup steps

1

Create a bot

Create a Telegram bot with BotFather and copy the token.
2

Set environment variables

Export TELEGRAM_BOT_TOKEN or pass the token directly to the adapter.
3

Add admin users

Pass Telegram user IDs in admin_user_ids so approvals only go to trusted admins.
4

Install optional extras

Install speech and OCR packages if you want voice and image support.
5

Start polling

Call adapter.start() to begin polling for Telegram updates.

Example

from arivu.integrations.telegram_adapter import TelegramIntegration

adapter = TelegramIntegration(
        db=db,
        token="123456:ABC-DEF...",
        admin_user_ids=[123456789, 987654321],
)

adapter.start()

Backend behavior

  • Session IDs are mapped as telegram:{user_id}.
  • /start, /help, /refresh, /approve, and /reject are supported.
  • Text messages go directly through the pipeline.
  • Approved SQL is executed after admin confirmation.
  • Successful responses include inline 👍 / 👎 RLHF buttons.
Telegram is the best choice if you want text plus voice and image input without webhooks or public endpoints.