Skip to main content

IM Channel Integration Guide

IM Channel Integration allows you to connect Wegent agents to instant messaging platforms, enabling users to interact with AI agents directly within their familiar chat tools.


πŸ“‹ Table of Contents​


🎯 Overview​

What is IM Channel Integration?​

IM Channel Integration connects Wegent agents to instant messaging platforms, allowing users to chat with AI agents directly in their preferred messaging apps without accessing the Wegent web interface.

Core Benefits​

BenefitDescription
Familiar EnvironmentUse AI agents in the chat tools you already use daily
Real-time ResponsesGet streaming AI responses with AI Card technology
Multi-turn ConversationsMaintain context across multiple messages
Team CollaborationShare AI capabilities with your entire organization

Supported Platforms​

PlatformStatusFeatures
DingTalkβœ… AvailableStream mode, AI Card streaming, multi-turn conversations
Feishu/LarkπŸ”œ PlannedComing soon
WeChat WorkπŸ”œ PlannedComing soon

πŸ— Architecture​

Message Flow​

The following diagram illustrates how messages flow through the IM integration system:

Key Components​

ComponentPurpose
Channel ManagerManages lifecycle of all IM channel connections
Channel ProviderPlatform-specific connection handler (DingTalk, Feishu, etc.)
Message HandlerProcesses incoming messages and routes to agents
Response EmitterSends AI responses back to IM platform (sync or streaming)

πŸ’¬ Using IM Channels​

Basic Conversation​

Simply send messages to the bot in your IM platform as you would in any chat:

User: What can you help me with?
Bot: I'm an AI assistant powered by Wegent. I can help you with...

Multi-turn Conversations​

The bot maintains conversation context within the same chat session:

User: I'm working on a React project
Bot: Great! I'd be happy to help with your React project...

User: How do I optimize performance?
Bot: For your React project, here are some performance optimization tips...

Starting a New Conversation​

To clear context and start fresh, use the /new command:

User: /new
Bot: Started a new conversation. How can I help you?

AI Card Streaming​

When AI Card streaming is enabled, you'll see responses appear in real-time:

  1. Bot shows "Thinking..." indicator
  2. Response text streams in progressively
  3. Final response is displayed with formatting

βš™οΈ Management Features​

Channel Status Monitoring​

View channel health in the admin panel:

StatusIndicatorDescription
Connected🟒 GreenChannel is active and receiving messages
DisconnectedπŸ”΄ RedChannel is offline or experiencing errors
Disabledβšͺ GrayChannel is manually disabled

Channel Operations​

OperationDescription
Enable/DisableToggle channel without deleting configuration
RestartReconnect to IM platform (useful after network issues)
EditModify channel settings (leave secret empty to keep existing)
DeleteRemove channel configuration

Updating Configuration​

When editing a channel:

  • Sensitive fields (Client Secret) are masked with ***
  • Leave sensitive fields empty to keep existing values
  • Enter new values to update credentials

Monitoring Metrics​

Available metrics for each channel:

  • Uptime: How long the channel has been connected
  • Last Error: Most recent error message (if any)
  • Connection Time: When the channel was last connected

πŸ‘₯ User Mapping Mechanism​

Automatic User Creation​

When an IM platform user interacts with the bot for the first time:

  1. System attempts to find existing Wegent user
  2. If not found, automatically creates a new user account
  3. User is linked to their IM platform identity

Default user creation:

  • Username: IM platform user ID
  • Email: {user_id}@im-platform.com
  • Auth Source: Corresponding IM platform name

Enterprise User Mapping​

For organizations with existing user directories (ERP, LDAP), custom user mappers can be configured:

Contact your system administrator to configure enterprise user mapping.


πŸ”— Platform Integration Guides​

The following platforms have detailed integration configuration guides:

PlatformLink
DingTalkDingTalk Integration Guide

❓ Troubleshooting​

Connection Issues​

Channel shows "Disconnected"​

Possible causes:

  1. Invalid Client ID or Client Secret
  2. Network connectivity issues
  3. IM platform API service disruption

Solutions:

  1. Verify credentials in the open platform
  2. Check network connectivity from Wegent server
  3. Try restarting the channel
  4. Check IM platform service status

Messages not being received​

Possible causes:

  1. Stream mode not enabled in IM platform
  2. Robot permissions not configured
  3. Channel not enabled in Wegent

Solutions:

  1. Verify Stream Mode is enabled in IM app settings
  2. Check all required permissions are granted
  3. Ensure channel is enabled (toggle is on)

Response Issues​

Bot not responding​

Possible causes:

  1. Default Agent not configured
  2. Agent has no model assigned
  3. Rate limiting

Solutions:

  1. Verify a default Agent is selected for the channel
  2. Ensure the Agent has a working model configuration
  3. Check for rate limit errors in channel status

Slow or incomplete responses​

Possible causes:

  1. AI Card streaming issues
  2. Network latency
  3. Large response content

Solutions:

  1. Try disabling AI Card streaming temporarily
  2. Check network connectivity
  3. The system will fall back to sync mode if streaming fails

User Issues​

User not recognized​

Possible causes:

  1. User mapping configuration issues
  2. IM platform user info not accessible

Solutions:

  1. Check user permissions in IM app
  2. Verify user mapping configuration
  3. Contact administrator for enterprise user mapping

Documentation​

External Resources​


πŸ’¬ Get Help​

Need assistance?

  • πŸ“– Check FAQ
  • πŸ› Submit GitHub Issue
  • πŸ’¬ Join community discussions

Connect your AI agents to IM platforms and empower your team! πŸš€