weixin-agent-sdk  by wong2

WeChat AI Agent bridging framework

Created 5 days ago

New!

917 stars

Top 39.7% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a framework for bridging arbitrary AI backends to WeChat, enabling developers to integrate AI capabilities into the WeChat platform through a simplified Agent interface. It targets developers seeking to leverage AI within WeChat without needing deep knowledge of WeChat's internal APIs, offering a flexible and extensible solution via the Agent Client Protocol (ACP).

How It Works

The core of the system comprises the weixin-agent-sdk (Node.js) for WeChat interaction and the Agent Client Protocol (ACP) for AI backend communication. The SDK uses long polling (getUpdates) to receive messages, eliminating the need for a public server. AI agents compatible with ACP can be seamlessly integrated; the weixin-acp CLI tool acts as an adapter, capable of launching ACP agents as subprocesses and communicating with them via JSON-RPC over standard input/output. Media files are handled through WeChat's CDN, encrypted using AES-128-ECB.

Quick Start & Requirements

  • Primary Install/Run:
    • Install the ACP adapter globally: npm install -g weixin-acp
    • Login to WeChat: npx weixin-acp login
    • Start an agent (e.g., Claude Code): npx weixin-acp start -- claude-agent-acp
    • For OpenAI example: pnpm install, pnpm run login -w packages/example-openai, OPENAI_API_KEY=sk-xxx pnpm run start -w packages/example-openai
  • Prerequisites: Node.js >= 22. For audio processing, silk-wasm may be required. OpenAI example requires an OPENAI_API_KEY.
  • Links:
    • ACP Agent List: [Referenced in README, link not provided]
    • OpenAI Example: packages/example-openai/

Highlighted Details

  • Agent Client Protocol (ACP): An open protocol allowing direct integration of any ACP-compatible agent.
  • Media Handling: Supports text, image, audio (auto-converts SILK to WAV), video, and file attachments, with automatic decryption and CDN transfer.
  • Communication: Utilizes long polling (getUpdates) for message reception and JSON-RPC over stdio for agent communication.
  • Features: Includes built-in slash commands (/echo, /toggle-debug) and handles session expiry with automatic reconnection.

Maintenance & Community

This project is noted as a modification of @tencent-weixin/openclaw-weixin and explicitly states it is "for learning and exchange only," suggesting it is not an officially maintained project. No specific community channels (like Discord/Slack) or roadmap links are provided in the README.

Licensing & Compatibility

The README does not explicitly state a license. The phrase "仅供学习交流使用" (for learning and exchange only) strongly implies a restrictive, non-commercial license, potentially prohibiting commercial use or integration into closed-source products.

Limitations & Caveats

The project is explicitly "not an official WeChat project" and is intended "for learning and exchange only," indicating potential limitations regarding commercial application and support. It operates in a single-account mode where new logins overwrite previous sessions.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
8
Issues (30d)
11
Star History
924 stars in the last 5 days

Explore Similar Projects

Feedback? Help us improve.