🍾 I Integrated AI 🤖 into My WeChat Official Account

This article was last updated on: May 17, 2026 am

Background

Recently, the explosive popularity of AI applications like DeepSeek has made me deeply aware of the enormous potential of AI technology across various domains. To better embrace AI, I decided to incorporate AI into as many aspects of my work and daily life as possible, improving both efficiency and experience.

As part of embracing AI, I chose to integrate AI capabilities into my WeChat Official Account, enabling intelligent replies to user messages and providing a richer interactive experience.

Tech Stack

This project primarily uses the following tech stack:

  • Docker and Docker Compose: For containerized deployment, ensuring environment consistency; simplifying configuration and management of multi-container applications.
  • Zhipu AI: Provides powerful language model support, ensuring the quality of AI responses. (The reason is that DeepSeek’s service is currently unstable, so I’m using this as a temporary alternative.)
  • WeChat Official Account Platform: Serves as the integration channel for the AI application.
  • Alibaba Cloud ECS: Provides a stable VM runtime environment, with security group configurations to ensure security.
  • chatgpt-on-wechat: A chatbot built on large language models, supporting integration with WeChat Official Accounts, WeCom apps, Feishu, DingTalk, and more.

Step-by-Step Guide

1. Prepare the Environment

First, prepare the runtime environment on Alibaba Cloud ECS, ensuring the necessary security group rules are configured to allow access on port 80.

2. Configure Docker Compose

Write a docker-compose.yml file to configure the runtime parameters for the AI application. Key configurations are as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
services:
chatgpt-on-wechat:
image: zhayujie/chatgpt-on-wechat
container_name: chatgpt-on-wechat
security_opt:
- seccomp:unconfined
ports:
- 80:80
environment:
ZHIPU_AI_API_KEY: 'your-zhipu-ai-api-key'
MODEL: 'glm-4-plus'
PROXY: 'https://open.bigmodel.cn/api/paas/v4/'
SINGLE_CHAT_REPLY_PREFIX: '"[bot] "'
GROUP_CHAT_PREFIX: '["@bot"]'
GROUP_NAME_WHITE_LIST: '["ChatGPT测试群", "ChatGPT测试群2"]'
IMAGE_CREATE_PREFIX: '["画", "看", "找"]'
CONVERSATION_MAX_TOKENS: 1000
SPEECH_RECOGNITION: 'False'
CHARACTER_DESC: '你是基于大语言模型的AI智能助手,专业领域为监控可观察性(Observability)、云原生云计算和架构,旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。你的知识技术栈包括:监控可观察性(Observability)、云计算、云原生、高可用、Kubernetes、Docker、容器、PaaS、中间件、微服务、DevOps和数据库。'
EXPIRES_IN_SECONDS: 3600
USE_GLOBAL_PLUGIN_CONFIG: 'True'
USE_LINKAI: 'False'
LINKAI_API_KEY: ''
LINKAI_APP_CODE: ''
CHANNEL_TYPE: "wechatmp"
SINGLE_CHAT_PREFIX: '[""]'
WECHATMP_APP_ID: "wx73f9******d1e48"
WECHATMP_APP_SECRET: "weca******est"
WECHATMP_AES_KEY: "pbVhSx******************************************6Y0"
WECHATMP_TOKEN: "3f9b8**********************f6a"
WECHATMP_PORT: 80
SUBSCRIBE_MSG: "感谢您的关注!\n这里是AI Bot,可以自由对话。\n支持角色扮演和文字冒险等丰富插件。\n输入{trigger_prefix}#help 查看详细指令。"

Compared to the original documentation:

The following configurations were adjusted:

  • ZHIPU_AI_API_KEY: The Zhipu AI API Key for calling the AI model. The open_ai_api_key is intentionally left unconfigured.
  • MODEL: The model name for calling the AI model.
  • PROXY: The proxy address for calling the AI model. This is set to the Zhipu AI API endpoint, specifically: ‘https://open.bigmodel.cn/api/paas/v4/
  • CHARACTER_DESC: The description of the AI assistant, introducing its capabilities and expertise. The prompt here was fine-tuned based on my self-introduction on EWhisper.
  • WECHATMP_APP_ID, WECHATMP_APP_SECRET, WECHATMP_AES_KEY, WECHATMP_TOKEN: WeChat Official Account configuration details for integrating with the WeChat Official Account platform.

3. WeChat Official Account Developer Configuration

Complete the application registration and configuration on the WeChat Official Account platform, obtain the necessary App ID, App Secret, and other information, and fill them into the docker-compose.yml file.

4. Start the Service

Start the service using Docker Compose:

1
sudo docker-compose up -d

🐾 Note: sudo is required here because WeChat Official Account integration only supports port 80 or 443. Port 80 is used here.
Of course, for enterprise-level deployments, you can use an Nginx reverse proxy or ALB forwarding to other ports to achieve both security and high availability.

5. WeChat Official Account - Server Configuration

For details, refer to: chatgpt-on-wechat WeChat Official Account Integration Guide

│ The configuration process is as follows:

│ Enable the developer secret on the Official Account platform (corresponding to the wechatmp_app_secret configuration), and add the server IP to the whitelist.
│ Fill in the WeChat Official Account-related configurations in config.json as shown above, ensuring they match the settings in the Official Account backend.
│ Start the program. Once started, it will listen on port 80 (if you lack permission to listen, add sudo before the startup command; if port 80 is already in use, stop the occupying process).
│ Enable the server configuration in the Official Account backend and submit. If saved successfully, the configuration is complete. Note that the “Server URL” field must be configured in the format http://{HOST}/wx, where {HOST} can be the server’s IP or domain name.

6. Testing and Verification

Once the service is running properly, send test messages through the WeChat Official Account to verify that the AI reply functionality works correctly.

Results

After integrating AI, my WeChat Official Account gained intelligent reply capabilities, providing accurate and creative responses based on user input. The AI assistant performs particularly well on topics related to Observability, Cloud Native, and Cloud Computing, significantly enhancing the user experience.

Here’s the actual result:

WeChat Official Account AI in Action

Additionally, the AI assistant supports rich plugins such as role-playing and text adventures, adding fun and variety to the interactions.

Conclusion

Through this experiment, I successfully integrated AI technology into my WeChat Official Account, not only enhancing the user interaction experience but also strengthening my determination to introduce AI into more scenarios. I welcome all readers to follow my Official Account and experience the convenience and fun that AI brings firsthand!

Future Plans

The next steps are to continue optimizing and expanding the AI assistant’s capabilities to adapt to more scenarios and needs, including:

  • Connecting a knowledge base to provide more detailed knowledge support;
  • Integrating speech recognition and speech synthesis for smarter interactions;
  • Integrating models like DeepSeek for more intelligent Q&A capabilities;

Additionally, I will soon explore more application scenarios to expand the AI assistant’s use cases, including but not limited to:

  • Obsidian knowledge base AI plugin, enabling:
    • Knowledge base-powered Q&A;
    • Intelligent note linking;
    • AI-assisted article writing
  • Deploying lobe-chat, enabling:
    • Knowledge base-powered Q&A;
    • Rich plugins;
    • Diverse AI assistants;
    • Access anytime, anywhere;
    • Chat history preservation
  • Desktop/mobile AI assistant selection
  • Operations & monitoring alerts + AI = AIOps
  • Kubernetes + AI
  • Programming + AI
  • Linux Shell Terminal + AI
  • Workflow + AI
  • Smart home (Xiaomi Speaker) + AI

Through practice, I aim to further appreciate the broad application prospects and value of AI across various domains.

📚 References


🍾 I Integrated AI 🤖 into My WeChat Official Account
https://e-whisper.com/posts/51045/
Author
east4ming
Posted on
February 7, 2025
Licensed under