back to home

HKUDS / nanobot

"๐Ÿˆ nanobot: The Ultra-Lightweight OpenClaw"

22,951 stars
3,572 forks
568 issues
PythonTypeScriptShell

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing HKUDS/nanobot in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/HKUDS/nanobot)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview
<div align="center"> <img src="nanobot_logo.png" alt="nanobot" width="500"> <h1>nanobot: Ultra-Lightweight Personal AI Assistant</h1> <p> <a href="https://pypi.org/project/nanobot-ai/"><img src="https://img.shields.io/pypi/v/nanobot-ai" alt="PyPI"></a> <a href="https://pepy.tech/project/nanobot-ai"><img src="https://static.pepy.tech/badge/nanobot-ai" alt="Downloads"></a> <img src="https://img.shields.io/badge/python-โ‰ฅ3.11-blue" alt="Python"> <img src="https://img.shields.io/badge/license-MIT-green" alt="License"> <a href="./COMMUNICATION.md"><img src="https://img.shields.io/badge/Feishu-Group-E9DBFC?style=flat&logo=feishu&logoColor=white" alt="Feishu"></a> <a href="./COMMUNICATION.md"><img src="https://img.shields.io/badge/WeChat-Group-C5EAB4?style=flat&logo=wechat&logoColor=white" alt="WeChat"></a> <a href="https://discord.gg/MnCvHqpUGB"><img src="https://img.shields.io/badge/Discord-Community-5865F2?style=flat&logo=discord&logoColor=white" alt="Discord"></a> </p> </div>

๐Ÿˆ nanobot is an ultra-lightweight personal AI assistant inspired by OpenClaw

โšก๏ธ Delivers core agent functionality in just ~4,000 lines of code โ€” 99% smaller than Clawdbot's 430k+ lines.

๐Ÿ“ Real-time line count: 3,806 lines (run bash core_agent_lines.sh to verify anytime)

๐Ÿ“ข News

  • 2026-02-21 ๐ŸŽ‰ Released v0.1.4.post1 โ€” new providers, media support across channels, and major stability improvements. See release notes for details.
  • 2026-02-20 ๐Ÿฆ Feishu now receives multimodal files from users. More reliable memory under the hood.
  • 2026-02-19 โœจ Slack now sends files, Discord splits long messages, and subagents work in CLI mode.
  • 2026-02-18 โšก๏ธ nanobot now supports VolcEngine, MCP custom auth headers, and Anthropic prompt caching.
  • 2026-02-17 ๐ŸŽ‰ Released v0.1.4 โ€” MCP support, progress streaming, new providers, and multiple channel improvements. Please see release notes for details.
  • 2026-02-16 ๐Ÿฆž nanobot now integrates a ClawHub skill โ€” search and install public agent skills.
  • 2026-02-15 ๐Ÿ”‘ nanobot now supports OpenAI Codex provider with OAuth login support.
  • 2026-02-14 ๐Ÿ”Œ nanobot now supports MCP! See MCP section for details.
  • 2026-02-13 ๐ŸŽ‰ Released v0.1.3.post7 โ€” includes security hardening and multiple improvements. Please upgrade to the latest version to address security issues. See release notes for more details.
  • 2026-02-12 ๐Ÿง  Redesigned memory system โ€” Less code, more reliable. Join the discussion about it!
  • 2026-02-11 โœจ Enhanced CLI experience and added MiniMax support!
<details> <summary>Earlier news</summary>
  • 2026-02-10 ๐ŸŽ‰ Released v0.1.3.post6 with improvements! Check the updates notes and our roadmap.
  • 2026-02-09 ๐Ÿ’ฌ Added Slack, Email, and QQ support โ€” nanobot now supports multiple chat platforms!
  • 2026-02-08 ๐Ÿ”ง Refactored Providersโ€”adding a new LLM provider now takes just 2 simple steps! Check here.
  • 2026-02-07 ๐Ÿš€ Released v0.1.3.post5 with Qwen support & several key improvements! Check here for details.
  • 2026-02-06 โœจ Added Moonshot/Kimi provider, Discord integration, and enhanced security hardening!
  • 2026-02-05 โœจ Added Feishu channel, DeepSeek provider, and enhanced scheduled tasks support!
  • 2026-02-04 ๐Ÿš€ Released v0.1.3.post4 with multi-provider & Docker support! Check here for details.
  • 2026-02-03 โšก Integrated vLLM for local LLM support and improved natural language task scheduling!
  • 2026-02-02 ๐ŸŽ‰ nanobot officially launched! Welcome to try ๐Ÿˆ nanobot!
</details>

Key Features of nanobot:

๐Ÿชถ Ultra-Lightweight: Just ~4,000 lines of core agent code โ€” 99% smaller than Clawdbot.

๐Ÿ”ฌ 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 deploy and you're ready to go.

๐Ÿ—๏ธ Architecture

<p align="center"> <img src="nanobot_arch.png" alt="nanobot architecture" width="800"> </p>

โœจ Features

<table align="center"> <tr align="center"> <th><p align="center">๐Ÿ“ˆ 24/7 Real-Time Market Analysis</p></th> <th><p align="center">๐Ÿš€ Full-Stack Software Engineer</p></th> <th><p align="center">๐Ÿ“… Smart Daily Routine Manager</p></th> <th><p align="center">๐Ÿ“š Personal Knowledge Assistant</p></th> </tr> <tr> <td align="center"><p align="center"><img src="case/search.gif" width="180" height="400"></p></td> <td align="center"><p align="center"><img src="case/code.gif" width="180" height="400"></p></td> <td align="center"><p align="center"><img src="case/scedule.gif" width="180" height="400"></p></td> <td align="center"><p align="center"><img src="case/memory.gif" width="180" height="400"></p></td> </tr> <tr> <td align="center">Discovery โ€ข Insights โ€ข Trends</td> <td align="center">Develop โ€ข Deploy โ€ข Scale</td> <td align="center">Schedule โ€ข Automate โ€ข Organize</td> <td align="center">Learn โ€ข Memory โ€ข Reasoning</td> </tr> </table>

๐Ÿ“ฆ Install

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-ai

Install from PyPI (stable)

pip install nanobot-ai

๐Ÿš€ Quick Start

[!TIP] Set your API key in ~/.nanobot/config.json. Get API keys: OpenRouter (Global) ยท Brave Search (optional, for web search)

1. Initialize

nanobot onboard

2. Configure (~/.nanobot/config.json)

Add or merge these two parts into your config (other options have defaults).

Set your API key (e.g. OpenRouter, recommended for global users):

{
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-xxx"
    }
  }
}

Set your model:

{
  "agents": {
    "defaults": {
      "model": "anthropic/claude-opus-4-5"
    }
  }
}

3. Chat

nanobot agent

That's it! You have a working AI assistant in 2 minutes.

๐Ÿ’ฌ Chat Apps

Connect nanobot to your favorite chat platform.

ChannelWhat you need
TelegramBot token from @BotFather
DiscordBot token + Message Content intent
WhatsAppQR code scan
FeishuApp ID + App Secret
MochatClaw token (auto-setup available)
DingTalkApp Key + App Secret
SlackBot token + App-Level token
EmailIMAP/SMTP credentials
QQApp ID + App Secret
<details> <summary><b>Telegram</b> (Recommended)</summary>

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"]
    }
  }
}

You can find your User ID in Telegram settings. It is shown as @yourUserId. Copy this value without the @ symbol and paste it into the config file.

3. Run

nanobot gateway
</details> <details> <summary><b>Mochat (Claw IM)</b></summary>

Uses Socket.IO WebSocket by default, with HTTP polling fallback.

1. Ask nanobot to set up Mochat for you

Simply send this message to nanobot (replace xxx@xxx with your real email):

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 automatically register, configure ~/.nanobot/config.json, and connect to Mochat.

2. Restart gateway

nanobot gateway

That's it โ€” nanobot handles the rest!

<br> <details> <summary>Manual configuration (advanced)</summary>

If you prefer to configure manually, add the following to ~/.nanobot/config.json:

Keep claw_token private. It should only be sent in X-Claw-Token header to your Mochat API endpoint.

{
  "channels": {
    "mochat": {
      "enabled": true,
      "base_url": "https://mochat.io",
      "socket_url": "https://mochat.io",
      "socket_path": "/socket.io",
      "claw_token": "claw_xxx",
      "agent_user_id": "6982abcdef",
      "sessions": ["*"],
      "panels": ["*"],
      "reply_delay_mode": "non-mention",
      "reply_delay_ms": 120000
    }
  }
}
</details> </details> <details> <summary><b>Discord</b></summary>

1. Create a bot

2. Enable intents

  • In the Bot settings, enable MESSAGE CONTENT INTENT
  • (Optional) Enable SERVER MEMBERS INTENT if you plan to use allow lists based on member data

3. Get your User ID

  • Discord Settings โ†’ Advanced โ†’ enable Developer Mode
  • Right-click your avatar โ†’ Copy User ID

4. Configure

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN",
      "allowFrom": ["YOUR_USER_ID"]
    }
  }
}

5. Invite the bot

  • OAuth2 โ†’ URL Generator
  • Scopes: bot
  • Bot Permissions: Send Messages, Read Message History
  • Open the generated invite URL and add the bot to your server

6. Run

nanobot gateway
</details> <details> <summary><b>WhatsApp</b></summary>

Requires Node.js โ‰ฅ18.

1. Link device

nanobot channels login
# Scan QR with WhatsApp โ†’ Settings โ†’ Linked Devices

2. Configure

{
  "channels": {
    "whatsapp": {
      "enabled": true,
      "allowFrom": ["+1234567890"]
    }
  }
}

3. Run (two terminals)

# Terminal 1
nanobot channels login

# Terminal 2
nanobot gateway
</details> <details> <summary><b>Feishu (้ฃžไนฆ)</b></summary>

Uses WebSocket long connection โ€” no public IP required.

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": []
    }
  }
}

encryptKey and verificationToken are 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!

</details> <details> <summary><b>QQ (QQๅ•่Š)</b></summary>

Uses botpy SDK with WebSocket โ€” no public IP required. Currently supports private messages only.

1. Register & create bot

  • Visit QQ Open Platform โ†’ Register as a developer (personal or enterprise)
  • Create a new bot application
  • Go to ๅผ€ๅ‘่ฎพ็ฝฎ (Developer Settings) โ†’ copy AppID and AppSecret

2. Set up sandbox for testing

  • In the bot management console, find ๆฒ™็ฎฑ้…็ฝฎ (Sandbox Config)
  • Under ๅœจๆถˆๆฏๅˆ—่กจ้…็ฝฎ, click ๆทปๅŠ ๆˆๅ‘˜ and add your own QQ number
  • Once added, scan the bot's QR code with mobile QQ โ†’ open the bot profile โ†’ tap "ๅ‘ๆถˆๆฏ" to start chatting

3. Configure

  • allowFrom: Leave empty for public access, or add user openids to restrict. You can find openids in the nanobot logs when a user messages the bot.
  • For production: submit a review in the bot console and publish. See QQ Bot Docs for the full publishing flow.
{
  "channels": {
    "qq": {
      "enabled": true,
      "appId": "YOUR_APP_ID",
      "secret": "YOUR_APP_SECRET",
      "allowFrom": []
    }
  }
}

4. Run

nanobot gateway

Now send a message to the bot from QQ โ€” it should respond!

</details> <details> <summary><b>DingTalk (้’‰้’‰)</b></summary>

Uses Stream Mode โ€” no public IP required.

1. Create a DingTalk bot

  • Visit DingTalk Open Platform
  • Create a new app -> Add Robot capability
  • Configuration:
    • Toggle Stream Mode ON
  • Permissions: Add necessary permissions for sending messages
  • Get AppKey (Client ID) and AppSecret (Client Secret) from "Credentials"
  • Publish the app

2. Configure

{
  "channels": {
    "dingtalk": {
      "enabled": true,
      "clientId": "YOUR_APP_KEY",
      "clientSecret": "YOUR_APP_SECRET",
      "allowFrom": []
    }
  }
}

allowFrom: Leave empty to allow all users, or add ["staffId"] to restrict access.

3. Run

nanobot gateway
</details> <details> <summary><b>Slack</b></summary>

Uses Socket Mode โ€” no public URL required.

1. Create a Slack app

  • Go to Slack API โ†’ Create New App โ†’ "From scratch"
  • Pick a name and select your workspace

2. Configure the app

  • Socket Mode: Toggle ON โ†’ Generate an App-Level Token with connections:write scope โ†’ copy it (xapp-...)
  • OAuth & Permissions: Add bot scopes: chat:write, reactions:write, app_mentions:read
  • Event Subscriptions: Toggle ON โ†’ Subscribe to bot events: message.im, message.channels, app_mention โ†’ Save Changes
  • App Home: Scroll to Show Tabs โ†’ Enable Messages Tab โ†’ Check "Allow users to send Slash commands and messages from the messages tab"
  • Install App: Click Install to Workspace โ†’ Authorize โ†’ copy the Bot Token (xoxb-...)

3. Configure nanobot

{
  "channels": {
    "slack": {
      "enabled": true,
      "botToken": "xoxb-...",
      "appToken": "xapp-...",
      "groupPolicy": "mention"
    }
  }
}

4. Run

nanobot gateway

DM the bot directly or @mention it in a channel โ€” it should respond!

[!TIP]

  • groupPolicy: "mention" (default โ€” respond only when @mentioned), "open" (respond to all channel messages), or "allowlist" (restrict to specific channels).
  • DM policy defaults to open. Set "dm": {"enabled": false} to disable DMs.
</details> <details> <summary><b>Email</b></summary>

Give nanobot its own email account. It polls IMAP for incoming mail and replies via SMTP โ€” like a personal email assistant.

1. Get credentials (Gmail example)

  • Create a dedicated Gmail account for your bot (e.g. my-nanobot@gmail.com)
  • Enable 2-Step Verification โ†’ Create an App Password
  • Use this app password for both IMAP and SMTP

2. Configure

  • consentGranted must be true to allow mailbox access. This is a safety gate โ€” set false to fully disable.
  • allowFrom: Leave empty to accept emails from anyone, or restrict to specific senders.
  • smtpUseTls and smtpUseSsl default to true / false respectively, which is correct for Gmail (port 587 + STARTTLS). No need to set them explicitly.
  • Set "autoReplyEnabled": false if you only want to read/analyze emails without sending automatic replies.
{
  "channels": {
    "email": {
      "enabled": true,
      "consentGranted": true,
      "imapHost": "imap.gmail.com",
      "imapPort": 993,
      "imapUsername": "my-nanobot@gmail.com",
      "imapPassword": "your-app-password",
      "smtpHost": "smtp.gmail.com",
      "smtpPort": 587,
      "smtpUsername": "my-nanobot@gmail.com",
      "smtpPassword": "your-app-password",
      "fromAddress": "my-nanobot@gmail.com",
      "allowFrom": ["your-real-email@gmail.com"]
    }
  }
}

3. Run

nanobot gateway
</details>

๐ŸŒ Agent Social Network

๐Ÿˆ nanobot is capable of linking to the agent social network (agent community). Just send one message and your nanobot joins automatically!

PlatformHow to Join (send this message to your bot)
MoltbookRead https://moltbook.com/skill.md and follow the instructions to join Moltbook
ClawdChatRead https://clawdchat.ai/skill.md and follow the instructions to join ClawdChat

Simply send the command above to your nanobot (via CLI or any chat channel), and it will handle the rest.

โš™๏ธ Configuration

Config file: ~/.nanobot/config.json

Providers

[!TIP]

  • Groq provides free voice transcription via Whisper. If configured, Telegram voice messages will be automatically transcribed.
  • Zhipu Coding Plan: If you're on Zhipu's coding plan, set "apiBase": "https://open.bigmodel.cn/api/coding/paas/v4" in your zhipu provider config.
  • MiniMax (Mainland China): If your API key is from MiniMax's mainland China platform (minimaxi.com), set "apiBase": "https://api.minimaxi.com/v1" in your minimax provider config.
  • VolcEngine Coding Plan: If you're on VolcEngine's coding plan, set "apiBase": "https://ark.cn-beijing.volces.com/api/coding/v3" in your volcengine provider config.
ProviderPurposeGet API Key
customAny OpenAI-compatible endpoint (direct, no LiteLLM)โ€”
openrouterLLM (recommended, access to all models)openrouter.ai
anthropicLLM (Claude direct)console.anthropic.com
openaiLLM (GPT direct)platform.openai.com
deepseekLLM (DeepSeek direct)platform.deepseek.com
groqLLM + Voice transcription (Whisper)console.groq.com
geminiLLM (Gemini direct)aistudio.google.com
minimaxLLM (MiniMax direct)platform.minimax.io
aihubmixLLM (API gateway, access to all models)aihubmix.com
siliconflowLLM (SiliconFlow/็ก…ๅŸบๆตๅŠจ)siliconflow.cn
volcengineLLM (VolcEngine/็ซๅฑฑๅผ•ๆ“Ž)volcengine.com
dashscopeLLM (Qwen)dashscope.console.aliyun.com
moonshotLLM (Moonshot/Kimi)platform.moonshot.cn
zhipuLLM (Zhipu GLM)open.bigmodel.cn
vllmLLM (local, any OpenAI-compatible server)โ€”
openai_codexLLM (Codex, OAuth)nanobot provider login openai-codex
github_copilotLLM (GitHub Copilot, OAuth)nanobot provider login github-copilot
<details> <summary><b>OpenAI Codex (OAuth)</b></summary>

Codex uses OAuth instead of API keys. Requires a ChatGPT Plus or Pro account.

1. Login:

nanobot provider login openai-codex

2. Set model (merge into ~/.nanobot/config.json):

{
  "agents": {
    "defaults": {
      "model": "openai-codex/gpt-5.1-codex"
    }
  }
}

3. Chat:

nanobot agent -m "Hello!"

Docker users: use docker run -it for interactive OAuth login.

</details> <details> <summary><b>Custom Provider (Any OpenAI-compatible API)</b></summary>

Connects directly to any OpenAI-compatible endpoint โ€” LM Studio, llama.cpp, Together AI, Fireworks, Azure OpenAI, or any self-hosted server. Bypasses LiteLLM; model name is passed as-is.

{
  "providers": {
    "custom": {
      "apiKey": "your-api-key",
      "apiBase": "https://api.your-provider.com/v1"
    }
  },
  "agents": {
    "defaults": {
      "model": "your-model-name"
    }
  }
}

For local servers that don't require a key, set apiKey to any non-empty string (e.g. "no-key").

</details> <details> <summary><b>vLLM (local / OpenAI-compatible)</b></summary>

Run your own model with vLLM or any OpenAI-compatible server, then add to config:

1. Start the server (example):

vllm serve meta-llama/Llama-3.1-8B-Instruct --port 8000

2. Add to config (partial โ€” merge into ~/.nanobot/config.json):

Provider (key can be any non-empty string for local):

{
  "providers": {
    "vllm": {
      "apiKey": "dummy",
      "apiBase": "http://localhost:8000/v1"
    }
  }
}

Model:

{
  "agents": {
    "defaults": {
      "model": "meta-llama/Llama-3.1-8B-Instruct"
    }
  }
}
</details> <details> <summary><b>Adding a New Provider (Developer Guide)</b></summary>

nanobot uses a Provider Registry (nanobot/providers/registry.py) as the single source of truth. Adding a new provider only takes 2 steps โ€” no if-elif chains to touch.

Step 1. Add a ProviderSpec entry to PROVIDERS in nanobot/providers/registry.py:

ProviderSpec(
    name="myprovider",                   # config field name
    keywords=("myprovider", "mymodel"),  # model-name keywords for auto-matching
    env_key="MYPROVIDER_API_KEY",        # env var for LiteLLM
    display_name="My Provider",          # shown in `nanobot status`
    litellm_prefix="myprovider",         # auto-prefix: model โ†’ myprovider/model
    skip_prefixes=("myprovider/",),      # don't double-prefix
)

Step 2. Add a field to ProvidersConfig in nanobot/config/schema.py:

class ProvidersConfig(BaseModel):
    ...
    myprovider: ProviderConfig = ProviderConfig()

That's it! Environment variables, model prefixing, config matching, and nanobot status display will all work automatically.

Common ProviderSpec options:

FieldDescriptionExample
litellm_prefixAuto-prefix model names for LiteLLM"dashscope" โ†’ dashscope/qwen-max
skip_prefixesDon't prefix if model already starts with these("dashscope/", "openrouter/")
env_extrasAdditional env vars to set(("ZHIPUAI_API_KEY", "{api_key}"),)
model_overridesPer-model parameter overrides(("kimi-k2.5", {"temperature": 1.0}),)
is_gatewayCan route any model (like OpenRouter)True
detect_by_key_prefixDetect gateway by API key prefix"sk-or-"
detect_by_base_keywordDetect gateway by API base URL"openrouter"
strip_model_prefixStrip existing prefix before re-prefixingTrue (for AiHubMix)
</details>

MCP (Model Context Protocol)

[!TIP] The config format is compatible with Claude Desktop / Cursor. You can copy MCP server configs directly from any MCP server's README.

nanobot supports MCP โ€” connect external tool servers and use them as native agent tools.

Add MCP servers to your config.json:

{
  "tools": {
    "mcpServers": {
      "filesystem": {
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
      },
      "my-remote-mcp": {
        "url": "https://example.com/mcp/",
        "headers": {
          "Authorization": "Bearer xxxxx"
        }
      }
    }
  }
}

Two transport modes are supported:

ModeConfigExample
Stdiocommand + argsLocal process via npx / uvx
HTTPurl + headers (optional)Remote endpoint (https://mcp.example.com/sse)

MCP tools are automatically discovered and registered on startup. The LLM can use them alongside built-in tools โ€” no extra configuration needed.

Security

[!TIP] For production deployments, set "restrictToWorkspace": true in your config to sandbox the agent.

OptionDefaultDescription
tools.restrictToWorkspacefalseWhen true, restricts all agent tools (shell, file read/write/edit, list) to the workspace directory. Prevents path traversal and out-of-scope access.
channels.*.allowFrom[] (allow all)Whitelist of user IDs. Empty = allow everyone; non-empty = only listed users can interact.

CLI Reference

CommandDescription
nanobot onboardInitialize config & workspace
nanobot agent -m "..."Chat with the agent
nanobot agentInteractive chat mode
nanobot agent --no-markdownShow plain-text replies
nanobot agent --logsShow runtime logs during chat
nanobot gatewayStart the gateway
nanobot statusShow status
nanobot provider login openai-codexOAuth login for providers
nanobot channels loginLink WhatsApp (scan QR)
nanobot channels statusShow channel status

Interactive mode exits: exit, quit, /exit, /quit, :q, or Ctrl+D.

<details> <summary><b>Scheduled Tasks (Cron)</b></summary>
# Add a job
nanobot cron add --name "daily" --message "Good morning!" --cron "0 9 * * *"
nanobot cron add --name "hourly" --message "Check status" --every 3600

# List jobs
nanobot cron list

# Remove a job
nanobot cron remove <job_id>
</details>

๐Ÿณ Docker

[!TIP] The -v ~/.nanobot:/root/.nanobot flag mounts your local config directory into the container, so your config and workspace persist across container restarts.

Docker Compose

docker compose run --rm nanobot-cli onboard   # first-time setup
vim ~/.nanobot/config.json                     # add API keys
docker compose up -d nanobot-gateway           # start gateway
docker compose run --rm nanobot-cli agent -m "Hello!"   # run CLI
docker compose logs -f nanobot-gateway                   # view logs
docker compose down                                      # stop

Docker

# 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 enabled channels, e.g. Telegram/Discord/Mochat)
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 status

๐Ÿ“ Project Structure

nanobot/
โ”œโ”€โ”€ 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 (incl. spawn)
โ”œโ”€โ”€ skills/         # ๐ŸŽฏ Bundled skills (github, weather, tmux...)
โ”œโ”€โ”€ channels/       # ๐Ÿ“ฑ Chat channel integrations
โ”œโ”€โ”€ bus/            # ๐ŸšŒ Message routing
โ”œโ”€โ”€ cron/           # โฐ Scheduled tasks
โ”œโ”€โ”€ heartbeat/      # ๐Ÿ’“ Proactive wake-up
โ”œโ”€โ”€ providers/      # ๐Ÿค– LLM providers (OpenRouter, etc.)
โ”œโ”€โ”€ session/        # ๐Ÿ’ฌ Conversation sessions
โ”œโ”€โ”€ config/         # โš™๏ธ Configuration
โ””โ”€โ”€ cli/            # ๐Ÿ–ฅ๏ธ Commands

๐Ÿค Contribute & Roadmap

PRs welcome! The codebase is intentionally small and readable. ๐Ÿค—

Roadmap โ€” Pick an item and open a PR!

  • Multi-modal โ€” See and hear (images, voice, video)
  • Long-term memory โ€” Never forget important context
  • Better reasoning โ€” Multi-step planning and reflection
  • More integrations โ€” Calendar and more
  • Self-improvement โ€” Learn from feedback and mistakes

Contributors

<a href="https://github.com/HKUDS/nanobot/graphs/contributors"> <img src="https://contrib.rocks/image?repo=HKUDS/nanobot&max=100&columns=12&updated=20260210" alt="Contributors" /> </a>

โญ Star History

<div align="center"> <a href="https://star-history.com/#HKUDS/nanobot&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=HKUDS/nanobot&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=HKUDS/nanobot&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=HKUDS/nanobot&type=Date" style="border-radius: 15px; box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);" /> </picture> </a> </div> <p align="center"> <em> Thanks for visiting โœจ nanobot!</em><br><br> <img src="https://visitor-badge.laobi.icu/badge?page_id=HKUDS.nanobot&style=for-the-badge&color=00d4ff" alt="Views"> </p> <p align="center"> <sub>nanobot is for educational, research, and technical exchange purposes only</sub> </p>