Skip to content

feat(integrations): add OneBot v11 adapter for NapCat/QQ bot integration#369

Open
h0ll0w-AkuZr0guY wants to merge 1 commit intoNevaMind-AI:mainfrom
h0ll0w-AkuZr0guY:feat/onebot-integration
Open

feat(integrations): add OneBot v11 adapter for NapCat/QQ bot integration#369
h0ll0w-AkuZr0guY wants to merge 1 commit intoNevaMind-AI:mainfrom
h0ll0w-AkuZr0guY:feat/onebot-integration

Conversation

@h0ll0w-AkuZr0guY
Copy link

📝 Pull Request Summary

Adds an integration adapter for the OneBot v11 protocol, enabling memU to act as the long-term memory engine for QQ bots (via implementations like NapCatQQ).

Fixes #367


✅ What does this PR do?

  • Introduces OneBotAdapter and OneBotConfig in src/memu/integrations/onebot.py.
  • Implements a resilient WebSocket client with automatic reconnection and heartbeat capabilities.
  • Handles Promise/Echo mechanisms for robust asynchronous message sending (_send_with_response).
  • Adds a comprehensive example script demonstrating how to connect NapCatQQ with memU's RAG pipeline (examples/onebot_demo.py).

🤔 Why is this change needed?

  • Platform Expansion: Expanding support to QQ (via OneBot) allows millions of users to utilize memU in highly active community groups and personal assistant scenarios.
  • Resilience: The native Python websockets implementation often clashes with CQHTTP/NapCat's heartbeat. This adapter correctly handles silent pings and auto-reconnects, ensuring 24/7 stability.

🔍 Type of Change

Please check what applies:

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / cleanup
  • Other (please explain)

✅ PR Quality Checklist

  • PR title follows the conventional format (feat:, fix:, docs:)
  • Changes are limited in scope and easy to review
  • Documentation updated where applicable
  • No breaking changes (or clearly documented)
  • Related issues or discussions linked

📌 Optional

  • Tested locally with a live NapCatQQ instance and Qwen/BGE-M3 models. User-specific long-term memory recall functions flawlessly across different QQ accounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add OpenClaw QQ Bot Integration Support

1 participant