π nanobot is an ultra-lightweight personal AI assistant inspired by Clawdbot
β‘οΈ Delivers core agent functionality in just ~7,600 lines of code β 98% smaller than Clawdbot's 430k+ lines.
- 2026-02-01 π nanobot launched! Welcome to try π nanobot!
πͺΆ Ultra-Lightweight: Just ~7,600 lines of code β 98% smaller than Clawdbot - core functionality.
π¬ Research-Ready: Clean, readable code that's easy to understand, modify, and extend for research.
β‘οΈ Lightning Fast: Minimal footprint means faster startup, lower resource usage, and quicker iterations.
π Easy-to-Use: One-click to depoly and you're ready to go.
π 24/7 Real-Time Market Analysis |
π Full-Stack Software Engineer |
π Smart Daily Routine Manager |
π Personal Knowledge Assistant |
|---|---|---|---|
| Discovery β’ Insights β’ Trends | Develop β’ Deploy β’ Scale | Schedule β’ Automate β’ Organize | Learn β’ Memory β’ Reasoning |
Install from source (latest features, recommended for development)
git clone https://github.com/HKUDS/nanobot.git
cd nanobot
pip install -e .Install with uv (stable, fast)
uv tool install nanobot-aiInstall from PyPI (stable)
pip install nanobot-aiTip
Set your API key in ~/.nanobot/config.json.
Get API keys: OpenRouter (LLM) Β· Brave Search (optional, for web search)
You can also change the model to minimax/minimax-m2 for lower cost.
1. Initialize
nanobot onboard2. Configure (~/.nanobot/config.json)
{
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-xxx"
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5"
}
},
"tools": {
"web": {
"search": {
"apiKey": "BSA-xxx"
}
}
}
}3. Chat
nanobot agent -m "What is 2+2?"That's it! You have a working AI assistant in 2 minutes.
Run nanobot with your own local models using vLLM or any OpenAI-compatible server.
1. Start your vLLM server
vllm serve meta-llama/Llama-3.1-8B-Instruct --port 80002. Configure (~/.nanobot/config.json)
{
"providers": {
"vllm": {
"apiKey": "dummy",
"apiBase": "http://localhost:8000/v1"
}
},
"agents": {
"defaults": {
"model": "meta-llama/Llama-3.1-8B-Instruct"
}
}
}3. Chat
nanobot agent -m "Hello from my local LLM!"Tip
The apiKey can be any non-empty string for local servers that don't require authentication.
Talk to your nanobot through Telegram, WhatsApp, Discord, or Feishu β anytime, anywhere.
| Channel | Setup |
|---|---|
| Telegram | Easy (just a token) |
| Discord | Easy (just a token) |
| Medium (scan QR) | |
| Feishu | Medium (app credentials) |
Telegram (Recommended)
1. Create a bot
- Open Telegram, search
@BotFather - Send
/newbot, follow prompts - Copy the token
2. Configure
{
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}Get your user ID from
@userinfoboton Telegram.
3. Run
nanobot gatewayDiscord
1. Create a bot
- Go to Discord Developer Portal
- Create a new application β Add a bot
- Enable Message Content Intent under Bot settings
- Copy the bot token
2. Invite the bot
- Go to OAuth2 β URL Generator
- Select
botscope with permissions: Send Messages, Read Message History - Use the generated URL to invite the bot to your server
3. Configure
{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"guildId": "YOUR_SERVER_ID",
"defaultChannelId": "CHANNEL_ID_FOR_NOTIFICATIONS",
"triggerWord": "nano",
"allowFrom": ["YOUR_USER_ID"]
}
}
}The bot responds to DMs and messages containing the
triggerWord. Get IDs by enabling Developer Mode in Discord settings.
4. Run
nanobot gatewayRequires Node.js β₯20.
1. Link device
nanobot channels login
# Scan QR with WhatsApp β Settings β Linked Devices2. Configure
{
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["+1234567890"]
}
}
}3. Run (two terminals)
# Terminal 1
nanobot channels login
# Terminal 2
nanobot gatewayFeishu (ι£δΉ¦)
Uses WebSocket long connection β no public IP required.
pip install nanobot-ai[feishu]1. Create a Feishu bot
- Visit Feishu Open Platform
- Create a new app β Enable Bot capability
- Permissions: Add
im:message(send messages) - Events: Add
im.message.receive_v1(receive messages)- Select Long Connection mode (requires running nanobot first to establish connection)
- Get App ID and App Secret from "Credentials & Basic Info"
- Publish the app
2. Configure
{
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_xxx",
"appSecret": "xxx",
"encryptKey": "",
"verificationToken": "",
"allowFrom": []
}
}
}
encryptKeyandverificationTokenare optional for Long Connection mode.allowFrom: Leave empty to allow all users, or add["ou_xxx"]to restrict access.
3. Run
nanobot gateway[!TIP] Feishu uses WebSocket to receive messages β no webhook or public IP needed!
Config file: ~/.nanobot/config.json
Note
Groq provides free voice transcription via Whisper. If configured, Telegram voice messages will be automatically transcribed.
| Provider | Purpose | Get API Key |
|---|---|---|
openrouter |
LLM (recommended, access to all models) | openrouter.ai |
anthropic |
LLM (Claude direct) | console.anthropic.com |
openai |
LLM (GPT direct) | platform.openai.com |
groq |
LLM + Voice transcription (Whisper) | console.groq.com |
gemini |
LLM (Gemini direct) | aistudio.google.com |
zhipu |
LLM (GLM models, China) | open.bigmodel.cn |
vllm |
Local models (OpenAI-compatible) | See Local Models |
Full config example
{
"agents": {
"defaults": {
"model": "anthropic/claude-opus-4-5"
}
},
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-xxx"
},
"groq": {
"apiKey": "gsk_xxx"
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "123456:ABC...",
"allowFrom": ["123456789"]
},
"whatsapp": {
"enabled": false
},
"discord": {
"enabled": false,
"token": "YOUR_BOT_TOKEN",
"guildId": "SERVER_ID",
"defaultChannelId": "CHANNEL_ID",
"triggerWord": "nano",
"allowFrom": []
},
"feishu": {
"enabled": false,
"appId": "cli_xxx",
"appSecret": "xxx",
"encryptKey": "",
"verificationToken": "",
"allowFrom": []
}
},
"tools": {
"web": {
"search": {
"apiKey": "BSA..."
}
}
}
}| Command | Description |
|---|---|
nanobot onboard |
Initialize config & workspace |
nanobot agent -m "..." |
Chat with the agent |
nanobot agent |
Interactive chat mode |
nanobot gateway |
Start the gateway |
nanobot status |
Show status |
nanobot channels login |
Link WhatsApp (scan QR) |
nanobot channels status |
Show channel status |
Scheduled Tasks (Cron)
# Add a job (three modes: cron expression, interval, or one-time)
nanobot cron add --name "daily" --message "Good morning!" --cron "0 9 * * *"
nanobot cron add --name "hourly" --message "Check status" --every 3600
nanobot cron add --name "reminder" --message "Meeting!" --at "2026-02-05T09:00:00"
# List jobs
nanobot cron list
nanobot cron list --all # Include disabled jobs
# Manage jobs
nanobot cron enable <job_id>
nanobot cron disable <job_id>
nanobot cron run <job_id> # Run immediately
nanobot cron remove <job_id>Tip
The -v ~/.nanobot:/root/.nanobot flag mounts your local config directory into the container, so your config and workspace persist across container restarts.
Build and run nanobot in a container:
# Build the image
docker build -t nanobot .
# Initialize config (first time only)
docker run -v ~/.nanobot:/root/.nanobot --rm nanobot onboard
# Edit config on host to add API keys
vim ~/.nanobot/config.json
# Run gateway (connects to chat channels)
docker run -v ~/.nanobot:/root/.nanobot -p 18790:18790 nanobot gateway
# Or run a single command
docker run -v ~/.nanobot:/root/.nanobot --rm nanobot agent -m "Hello!"
docker run -v ~/.nanobot:/root/.nanobot --rm nanobot statusnanobot/
βββ agent/ # π§ Core agent logic
β βββ loop.py # Agent loop (LLM β tool execution)
β βββ context.py # Prompt builder
β βββ memory.py # Persistent memory
β βββ skills.py # Skills loader
β βββ subagent.py # Background task execution
β βββ tools/ # Built-in tools (exec, web, files, spawn, cron...)
βββ skills/ # π― Bundled skills (github, weather, summarize, tmux...)
βββ channels/ # π± Chat integrations (Telegram, Discord, WhatsApp, Feishu)
βββ bus/ # π Message routing
βββ cron/ # β° Scheduled tasks
βββ heartbeat/ # π Proactive wake-up
βββ mcp/ # π Model Context Protocol support
βββ providers/ # π€ LLM providers (via LiteLLM)
βββ session/ # π¬ Conversation sessions
βββ config/ # βοΈ Configuration
βββ cli/ # π₯οΈ Commands
PRs welcome! The codebase is intentionally small and readable. π€
Roadmap β Pick an item and open a PR!
- Voice Transcription β Support for Groq Whisper
- Discord Integration β Full Discord bot support with typing indicators and reactions
- Scheduled Tasks β Cron service for periodic jobs
- MCP Support β Model Context Protocol for extensible capabilities
- Multi-modal β See and hear (images, voice, video)
- Long-term memory β Never forget important context
- Better reasoning β Multi-step planning and reflection
- More integrations β Slack, email, calendar
- Self-improvement β Learn from feedback and mistakes
Thanks for visiting β¨ nanobot!
nanobot is for educational, research, and technical exchange purposes only





