Feishu Digital Twin Integration
Zeus supports deep integration with Feishu (Lark), creating your digital twin with auto-reply, message synchronization, and intelligent assistant capabilities.Overview
The Feishu digital twin is an AI agent running on Feishu that can:- Auto-reply to messages - Reply on your behalf in private chats and group chats
- Smart activation strategies - Support @ trigger or all-message reply
- SSE streaming updates - Real-time message card updates showing the thinking process
- Tool call visualization - Display tool execution status in message cards
- Reuse Zeus capabilities - Inherit full Agent capabilities and personality settings
Architecture Design
Quick Start
1. Create Feishu Application
- Visit Feishu Open Platform to create an application
- Add Bot capability
- Configure permissions:
im:message- Get and send messagesim:message.group_at_msg- Receive group @ messagesim:chat- Get chat information
- Obtain
App IDandApp Secret
2. Configure Event Subscription
Configure event subscription on the Feishu Open Platform:- Request URL:
https://your-domain.com/api/channels/feishu/webhook - Subscribe to events:
im.message.receive_v1(receive messages)
3. Environment Variables
Configure the following environment variables in your.env file:
FEISHU_APP_ID- Feishu App IDFEISHU_APP_SECRET- Feishu App SecretFEISHU_VERIFICATION_TOKEN- Verification TokenFEISHU_ENCRYPT_KEY- Message encryption key (optional)FEISHU_DM_ACTIVATION- Direct message activation strategy (alwaysormention)FEISHU_GROUP_ACTIVATION- Group chat activation strategy (alwaysormention)FEISHU_ALLOWED_USERS- User allowlist (optional, comma-separated)FEISHU_ALLOWED_CHATS- Chat allowlist (optional, comma-separated)
4. Publish Application
After configuration, publish the application on the Feishu Open Platform to start using it.Activation Strategies
Inspired by OpenClaw design, supporting flexible activation strategies:
Independent configuration per scenario:
- Direct message strategy - Default
always(always reply in DMs) - Group chat strategy - Default
mention(reply only when @ mentioned in groups) - Allowlist - Configurable user and chat allowlists; when empty, all are allowed
SSE Streaming Message Sync
Zeus supports synchronizing the complete SSE message stream to Feishu, delivering a real-time experience similar to the Web interface.Message Type Mapping
Implementation
Preview
Message cards update in real-time, showing the complete thinking and execution process:API Endpoints
Webhook Receiver
POST /api/channels/feishu/webhook
Handled event types:
url_verification- URL verification (initial setup)im.message.receive_v1- Receive messages
Message Card Templates
Recommended to use Feishu message cards for displaying AI replies, supporting:- Status indicators (thinking/replying/completed)
- Markdown content rendering
- Collapsible tool call display
- Error message alerts
Advanced Features
Planned Features
Integration with Other Channels
The Feishu channel design follows a generic Channel abstraction, extensible to support:- Slack
- Discord
- WeCom
- Telegram
- DingTalk
Security Considerations
Signature Verification
It is recommended to enable Feishu event signature verification using SHA-256 HMAC to verify request signatures, ensuring trusted message sources. Verification requires checking theX-Lark-Request-Timestamp and X-Lark-Request-Nonce request headers.
Allowlist Mechanism
- Supports user allowlist (
allowed_users) - Supports chat allowlist (
allowed_chats) - When not configured, all are allowed by default