纳米机器人:OpenClaw的超轻量级替代方案
Nanobot: Ultra-Lightweight Alternative to OpenClaw

原始链接: https://github.com/HKUDS/nanobot

## nanobot:轻量级AI助手 nanobot是一款超轻量级的个人AI助手,核心功能仅约4000行代码,相比Clawdbot等类似项目减少了99%。它于2026年2月4日发布(v0.1.3.post4),提供实时市场分析、日常事务管理和个人知识辅助等功能。 主要特点包括体积小、性能快,易于部署(一键安装),以及代码友好、易于阅读。用户可以通过`uv`或PyPI从源代码安装它,并配置OpenRouter和Brave Search等提供商的API密钥。 nanobot支持通过vLLM使用本地模型,并与Telegram、WhatsApp和Feishu等通信平台集成。它还包含通过Cron执行的计划任务,并可以使用Groq转录Telegram语音消息。该项目欢迎贡献,并拥有清晰的未来发展路线图,优先考虑简洁性和可读性。 在GitHub上找到它:[https://github.com/HKUDS/nanobot](https://github.com/HKUDS/nanobot)

## Nanobot:极简代理框架 - 摘要 一个名为Nanobot的新项目在Hacker News上受到关注,它被宣传为OpenClaw的超轻量级替代方案,代码行数减少了99%(从40万行到4千行)。讨论的中心在于这类框架的价值,以及与“氛围编码”——借助Claude Code等AI工具快速创建定制解决方案——相比如何。 许多评论者认为Nanobot(和OpenClaw)的核心优势在于其极简的结构:循环、提供者抽象、工具分发和聊天网关。然而,他们质疑在可以快速构建定制解决方案时,它的实用性。 一个关键点是控制权与利用协作项目中的“实际经验”之间的权衡。虽然“氛围编码”项目启动迅速,但如果没有更广泛的经验,可能会停滞不前。最终,共识倾向于认为这些项目是有价值的*个人*工具,而不是广泛适用的产品。有些人认为这类框架有潜力管理小型自动化任务的集合,但质疑依赖他人实现的需求。
相关文章

原文

🐈 nanobot is an ultra-lightweight personal AI assistant inspired by Clawdbot

⚡️ Delivers core agent functionality in just ~4,000 lines of code — 99% smaller than Clawdbot's 430k+ lines.

  • 2026-02-04 🚀 v0.1.3.post4 released with multi-provider & Docker support! Check release notes for details.
  • 2026-02-01 🎉 nanobot launched! Welcome to try 🐈 nanobot!

🪶 Ultra-Lightweight: Just ~4,000 lines of code — 99% 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.

nanobot architecture

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

Install from PyPI (stable)

Tip

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

2. 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.

🖥️ Local Models (vLLM)

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 8000

2. 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, or Feishu — anytime, anywhere.

Channel Setup
Telegram Easy (just a token)
WhatsApp 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 @userinfobot on Telegram.

3. Run

WhatsApp

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
Feishu (飞书)

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

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

[!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.

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

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 Telegram/WhatsApp)
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
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/       # 📱 WhatsApp integration
├── 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!

Thanks for visiting ✨ nanobot!

Views

nanobot is for educational, research, and technical exchange purposes only

联系我们 contact @ memedata.com