Open source connectors for Google ADK
Put your ADK agent in every chat.
ADK Connectors runs any Google ADK agent as a Telegram, Discord or WhatsApp bot. You keep your agent. The package handles the messaging.
Scroll to take the logo apart and see how each piece works
adk_connectors.telegram
Three lines from agent to bot.
Import a connector, give it your agent and a bot token, and call start(). Your agent code stays exactly as it is.
from adk_connectors.telegram import TelegramConnector
connector = TelegramConnector(token=token, agent=assistant)
connector.start()
Supported platforms
Telegram, Discord and WhatsApp.
Each connector follows the same pattern, so moving your agent to another platform is a one-line change.
- Telegram
- Long polling by default, webhooks when you need them. Markdown becomes Telegram HTML, and inline buttons work.
- Discord
- Built on discord.py, with typing indicators, attachments and interactive buttons.
- Pairs with your account by QR code through a local Node.js bridge that installs itself on first run.
Building in TypeScript? adk-connector-js brings the Telegram connector to Node.js.
ConnectorManager
One agent on every platform at once.
Hand your platforms to a single manager. They share one event loop, one agent and one place to configure sessions.
manager = ConnectorManager(
agent=root_agent,
platforms=[
TelegramConnector(token=telegram_token),
DiscordConnector(token=discord_token),
WhatsAppConnector(),
],
)
manager.start_sync()
Streaming and formatting
Replies appear as they are written.
The bot edits its message about every 1.5 seconds while your agent works. Long answers are split into chunks of up to 4,096 characters by default, and only the root agent's words reach the chat.
Summarize today's release notes
Version 0.5.0 adds Telegram voice messages. Users can send voice notes, and your agent can answer out loud with any speech provider you connect.
144 / 4096 characters
Telegram voice New in 0.5.0
Talk to your agent. Hear it answer.
Voice notes and audio files can reach your agent as text, and its replies can come back as voice notes. Connect any speech provider with plain async functions.
- voice_transcriber
- Turns incoming audio into the text your agent reads.
- voice_synthesizer
- Turns the reply into OGG/Opus audio, or returns
Nonefor text only. - on_turn_completed
- Runs after every reply, ready for logging or storage.
If speech fails, the conversation carries on as text.
Cross-device session sync
Start on your phone. Continue in adk web.
Turn on session sync and your chats are saved to a local SQLite database. Open adk web to read the same conversation, inspect every tool call and reply from there.
TelegramConnector(
token=token,
agent=assistant,
session_management_across_device=True,
dev_user_id=os.getenv("TELEGRAM_USER_ID"),
)
Sessions are kept in .adk/session.db and .adk/connector_sessions.json, so restarting the bot keeps every chat. Requires google-adk[db].
adk_connectors.tunnel
A public webhook from your laptop.
Set tunnel=True. The connector starts a local server, opens a Cloudflare tunnel and points your bot's webhook at it. It downloads cloudflared if it is missing and picks a free port if yours is taken.
connector = TelegramConnector(
token=token, agent=assistant, tunnel=True,
)
connector.start()
# https://<random-name>.trycloudflare.com/webhooks/telegram
Prefer ngrok? Set it as the tunnel provider in ConnectorConfig.
Multi-agent support
Sub-agents work from the first message.
Sub-agents often expect state such as {seminal_paper} before anything has set it. The connector scans the instructions in your agent tree and fills in what is missing, which prevents KeyError crashes.
- interactive_blogger_agent
- robust_blog_planner
- robust_blog_writer
- blog_editor
- social_media_writer
This is the agent tree from the blog-writer example in the repository.
Inside the package
What happens to every message.
- AdapterReceives the platform update and parses it into an
IncomingMessage. - SessionManagerLocks the user and maps them to their ADK session.
- MessageProcessorBuilds the content your agent receives, including photos, documents and voice labels.
- ADK RunnerRuns your agent, its tools and its sub-agents.
- ResponseFormatterSplits the final reply into chunks that fit the message limit.
- AdapterDelivers the reply in the platform's own format.
adk_connectors.base_adapter
Add a platform in five methods.
Every connector implements the same small interface. Write these five methods and the sessions, streaming and formatting come with them.
class SlackAdapter(BaseAdapter):
platform = "slack"
async def start(self): ...
async def stop(self): ...
async def send_message(self, chat_id, message): ...
async def edit_message(
self, chat_id, message_id, new_content
): ...
async def set_typing_indicator(self, chat_id): ...
Sessions can live in memory or a JSON file. Implement get, set and delete on SessionStorage to use your own database. An official Slack connector is planned.
Get started
Ship your agent today.
Set GOOGLE_API_KEY and your bot token, wrap your agent, and start it. Python 3.10+ is required, or Node.js 18+ for TypeScript.