nanobot-rs
中文文档: README.md
Ultra-Lightweight Personal AI Assistant, Rust Edition
nanobot-rs is the Rust version of HKUDS/nanobot, keeping the same ultra-lightweight agent philosophy and tool-driven workflow.
- Rust rewrite for stronger concurrency stability and cleaner deployment ergonomics
- Already integrated by
open-vibe/open-vibeas its Rust implementation ofnanobot - Evolving as one of the core runtimes for
open-vibe
Open Vibe Integration
- Current Open Vibe integration focus: DingTalk stream bridge + relay workflow into Open Vibe threads
Features
- Agent loop: LLM calls, tool execution, session context, and error handling
- Config system:
~/.nanobot/config.jsonwith provider auto-matching - Session and memory: JSONL session persistence +
memory/MEMORY.md - Tooling:
read_file/write_file/edit_file/list_direxecweb_search/web_fetchmessage/spawn/cron
- Scheduling and heartbeat:
CronService(add/list/remove/enable/run + persistence)HeartbeatService
- Multi-channel support:
- Telegram (long polling, media download, voice transcription)
- Discord (Gateway + REST, with typing indicator)
- WhatsApp (Node bridge)
- Feishu (REST send; optional WebSocket receive feature)
- Mochat (Claw IM via HTTP watch/polling)
- DingTalk (optional Stream receive feature)
- Email (IMAP inbound + SMTP outbound, explicit consent required)
- Slack (Socket Mode)
- QQ (optional feature
qq-botrs)
- Built-in skills synced from the original project (
skills/*)
Requirements
- Rust stable (recommended 1.85+)
- Optional:
- Node.js 18+ (for WhatsApp bridge login)
- Brave Search API key (
web_search) - Groq API key (audio transcription)
Quick Start
1. Initialize
2. Configure API key
Edit ~/.nanobot/config.json:
If you use DingTalk, add this under channels:
If you use the Email channel (IMAP + SMTP):
If you use the Slack channel (Socket Mode):
If you use the QQ channel (currently direct/private chat only):
If you use the Mochat channel (Claw IM):
3. Chat directly
4. Start gateway
Common Commands
# Status and version
# Interactive mode
# Channels
# Cron jobs
Interactive exit commands: exit, quit, /exit, /quit, :q, or Ctrl+C/Ctrl+D.
Feishu WebSocket Receive
Default build supports Feishu sending. To enable Feishu WebSocket receive:
DingTalk Stream Receive
Default builds do not include DingTalk Stream. Enable it with:
Mochat Channel (Claw IM)
Disabled by default. Once enabled, nanobot-rs uses HTTP watch/polling to receive and send messages.
- Optional: ask nanobot to set up Mochat automatically
- In agent mode, send this prompt (replace the email with yours):
Read https://raw.githubusercontent.com/HKUDS/MoChat/refs/heads/main/skills/nanobot/skill.md and register on MoChat. My Email account is xxx@xxx Bind me as your owner and DM me on MoChat.
- nanobot will try to register and write Mochat settings into
~/.nanobot/config.json.
- Manual setup (recommended to verify config)
- Configure
channels.mochatin~/.nanobot/config.json: clawToken: required, sent asX-Claw-Tokenfor Mochat API requestssessions/panels: explicit IDs or["*"]for auto discoverygroups+mention.requireInGroups: group mention policy
- Start gateway:
- Validate messaging:
- Direct sessions use
session_xxxtargets - Group/panel messaging uses panel/group targets
QQ Channel (Direct/Private Chat Only)
QQ support is disabled by default; enable it via the qq-botrs feature.
- Register and create a bot
- Go to QQ Open Platform, register as a developer, and create a bot app
- Copy
AppIDandAppSecretfrom Developer Settings
- Configure sandbox for testing
- Open sandbox settings in the bot console
- Add your QQ account as a test member
- Scan the bot QR code with mobile QQ and start a direct chat
- Configure
~/.nanobot/config.json
- Use the
qqsnippet above withappIdandsecret - Leave
allowFromempty for open access, or set allowed user openids from logs
- Start gateway
After startup, send a direct QQ message to the bot and it should reply.
Slack Channel
Uses Socket Mode, so no public callback URL is required.
- Create a Slack app
- Go to Slack API -> Create New App -> From scratch
- Select a workspace and create the app
- Configure app capabilities
- Socket Mode: enable it and create an App-Level Token (
connections:write, starts withxapp-...) - OAuth & Permissions: add bot scopes
chat:write,reactions:write,app_mentions:read - Event Subscriptions: enable and subscribe to
message.im,message.channels,app_mention - App Home: enable Messages Tab and allow messaging from that tab
- Install App: install to workspace and copy Bot Token (
xoxb-...)
- Configure
~/.nanobot/config.json
- Start gateway
You can DM the bot directly, or @mention it in a channel.
WhatsApp Login
channels login will automatically:
- Prepare
~/.nanobot/bridge - Run
npm install - Run
npm run build - Start bridge and print QR login flow in terminal
Development
License
MIT