Integration guide
Choose where people talk to your bot.
Every platform uses the same provider, memory, knowledge, safety limits, and AMT tool configuration. Only the message adapter and its platform credential change.
Terminal
The simplest development target. It needs no platform token and keeps one local session.
./start-linux.sh # Windows: start-windows.bat # Exit with /quit
Local web chat
The Waitress-backed Flask adapter binds to 127.0.0.1:8000 by default. Open http://127.0.0.1:8000. Set HOST=0.0.0.0 only inside a protected container/network or when a deployment provider requires it. The runtime refuses any non-loopback bind until BOT_ACCESS_TOKEN is configured; the browser sends it in a private request header and keeps it only in session storage.
HOST=127.0.0.1 PORT=8000 BOT_ACCESS_TOKEN=use-a-long-random-value-for-remote-hosts python bot.py
For public deployments, also use TLS, provider/platform limits, request-size controls, and upstream abuse protection. The app exposes an unauthenticated /healthz endpoint containing only status, bot name, and template version.
Discord
- Create an application in the Discord Developer Portal.
- Add a bot under the application’s Bot section.
- Reset and copy the bot token into private
.envasDISCORD_BOT_TOKEN. - Enable Message Content Intent because this template responds to message text.
- Use OAuth2 URL Generator with the
botscope and only the permissions it needs: View Channels, Send Messages, and Read Message History. - Invite it to a test server first, then run
python bot.py.
DISCORD_BOT_TOKEN=replace_with_private_token
The bot keeps memory per Discord channel and ignores its own messages. Rotate the Discord token immediately if it is ever pasted into chat, committed, or logged. Verify current requirements in Discord’s official bot quickstart and Message Content Intent reference.
Telegram
- Message
@BotFatherin Telegram. - Run
/newbot, select a display name and unique username. - Place the issued token in private
.envasTELEGRAM_BOT_TOKEN. - Optionally use BotFather privacy settings to control whether a group bot sees all messages.
- Run the bot; the template uses long polling and stores memory per chat.
TELEGRAM_BOT_TOKEN=replace_with_private_token
Telegram’s official bot introduction explains BotFather and token security; its Privacy Mode guide explains which group messages a bot receives.
Compatibility
| Platform | Credential | Default exposure | Memory scope |
|---|---|---|---|
| Terminal | None | Local process | One terminal session |
| Web | None in base template | Loopback | Browser-generated session ID |
| Discord | DISCORD_BOT_TOKEN | Discord gateway | Channel |
| Telegram | TELEGRAM_BOT_TOKEN | Telegram polling | Chat |