DingTalk — AI for Chinese Workplaces
DingTalk — AI for Chinese Workplaces — easy-to-understand guide based on official docs
Imagine walking into an office in Shanghai where the water cooler conversations happen inside a bright blue app icon—DingTalk. It’s part Slack, part Trello, part HR portal, and for hundreds of millions of users, it is the workplace. Now imagine your AI agent, Hermes, quietly living inside that app—answering queries, triaging tasks, and firing off follow-ups without ever leaving the chat thread. That’s the promise of DingTalk integration in Hermes Agent.
Why DingTalk Matters for AI Agents
Most AI agent tutorials assume English-speaking, Western tooling. But in China, DingTalk is the default operating system for business communication. If you’re building an open-source agent for a team in Shenzhen or a factory in Chengdu, you need a native bridge. Hermes Agent now provides exactly that—a clean, config-driven integration that turns any DingTalk group into a command center for your agent.
Setting Up the DingTalk Bot
You have two paths: webhook (simplest, one-way) or callback (full duplex, receives messages). For a real assistant, you’ll want callback. Here’s the flow:
- Create a bot in the DingTalk Developer Console.
- Get your
AppKeyandAppSecret. - Set up a public callback URL (HTTPS required) for incoming messages.
- Configure the bot’s outbound webhook for replies.
In Hermes, you define this in config.yaml:
channels:
dingtalk:
enabled: true
mode: callback # or "webhook" for one-way alerts
app_key: "your_app_key"
app_secret: "your_app_secret"
callback_url: "https://your-server.com/dingtalk/callback"
webhook_url: "https://oapi.dingtalk.com/robot/send?access_token=xxx" # for replies
agent_id: "your_agent_id"
verify_token: "random_string_for_signature"
Receiving Messages
Once the callback URL is live, DingTalk pushes every group message to Hermes. The agent parses the JSON payload, extracts the sender, chat ID, and text, then routes it to your skill pipeline. You can filter by keyword, mention, or even specific groups. For example, only respond when the bot is @mentioned:
channels:
dingtalk:
filters:
require_mention: true
allow_groups:
- "ops-alerts"
- "ai-assistant"
Sending Replies
Replies go back through the webhook URL. Hermes automatically wraps the response in the correct DingTalk message format—plain text, markdown, or interactive cards. Here’s a minimal skill that echoes back a greeting:
@agent.skill
async def greet(ctx, text):
return f"Hello from Hermes! You said: {text}"
No manual HTTP calls. Hermes handles the signature, timestamp, and JSON envelope for you.
Summary
DingTalk integration turns Hermes from a terminal-only toy into a workplace citizen for Chinese teams. With a few lines in config.yaml, you get bidirectional messaging, mention filtering, and automatic reply formatting. Whether you’re building a QA bot for a factory floor or a personal assistant for a busy manager, Hermes + DingTalk means your AI speaks the language of the modern Chinese office—fluently, reliably, and without a single Chinese character in your codebase.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › user-guide/messaging/dingtalk