@FakeMaidenMaker: 体量小而可读性高的轻量个人 AI agent 现有 agent 框架把核心 loop 包成黑盒,想改一个细节要扒好几层抽象,读起来都费劲,更别说二次开发了。 我给大家安利一个超轻量开源 AI agent — nanobot。专门为「想读懂…

X AI KOLs Timeline 工具

摘要

介绍了开源超轻量AI agent nanobot,其核心loop设计极简可读,易于二次开发,支持Telegram、Discord、飞书等10+聊天平台及多个AI provider,并集成长期记忆与MCP工具扩展。

体量小而可读性高的轻量个人 AI agent 现有 agent 框架把核心 loop 包成黑盒,想改一个细节要扒好几层抽象,读起来都费劲,更别说二次开发了。 我给大家安利一个超轻量开源 AI agent — nanobot。专门为「想读懂、想扩展」而设计的个人 agent,灵感来自 Claude Code / Codex,代码保持最小可读。 GitHub:https://github.com/HKUDS/nanobot 它的核心 loop 故意写得小而清晰,任何人都能看懂改动。内置 Telegram、Discord、飞书、WeChat 等 10+ 聊天平台接入,WebUI 直接打包进 wheel 里开 WebSocket 就能用,不需要单独起前端服务。多 provider 支持覆盖 OpenAI、Anthropic、DeepSeek、Gemini、Qwen 以及本地 Ollama / vLLM,随时切换不锁厂商。 主要功能: 核心 agent loop 极简可读,方便研究和二次开发 内置 memory + MCP,长期记忆与工具扩展开箱即用 /goal 指令支持跨多轮维持长期目标,可跑长任务 接入 Telegram、Discord、飞书、WeChat 等主流聊天平台 支持 OpenAI、Anthropic、DeepSeek、本地 Ollama 等多 provider 随意切换 这个项目部署也很简单,pip install nanobot-ai 然后 nanobot onboard 就行了。 适合正在搭建个人 AI 助理、或者想从源码层面研究 agent 架构的朋友收藏使用。
查看原文
查看缓存全文

缓存时间: 2026/05/26 15:14

体量小而可读性高的轻量个人 AI agent

现有 agent 框架把核心 loop 包成黑盒,想改一个细节要扒好几层抽象,读起来都费劲,更别说二次开发了。

我给大家安利一个超轻量开源 AI agent — nanobot。专门为「想读懂、想扩展」而设计的个人 agent,灵感来自 Claude Code / Codex,代码保持最小可读。

GitHub:https://github.com/HKUDS/nanobot

它的核心 loop 故意写得小而清晰,任何人都能看懂改动。内置 Telegram、Discord、飞书、WeChat 等 10+ 聊天平台接入,WebUI 直接打包进 wheel 里开 WebSocket 就能用,不需要单独起前端服务。多 provider 支持覆盖 OpenAI、Anthropic、DeepSeek、Gemini、Qwen 以及本地 Ollama / vLLM,随时切换不锁厂商。

主要功能: 核心 agent loop 极简可读,方便研究和二次开发 内置 memory + MCP,长期记忆与工具扩展开箱即用 /goal 指令支持跨多轮维持长期目标,可跑长任务 接入 Telegram、Discord、飞书、WeChat 等主流聊天平台 支持 OpenAI、Anthropic、DeepSeek、本地 Ollama 等多 provider 随意切换

这个项目部署也很简单,pip install nanobot-ai 然后 nanobot onboard 就行了。

适合正在搭建个人 AI 助理、或者想从源码层面研究 agent 架构的朋友收藏使用。


HKUDS/nanobot

Source: https://github.com/HKUDS/nanobot

cover-v5-optimized

English | 简体中文 | 繁體中文 | Español | Français | Bahasa Indonesia | 日本語 | 한국어 | Русский | Tiếng Việt

PyPI Downloads Python License Commits last month Issues closed follow on X(Twitter) Docs Feishu WeChat Discord

🐈 nanobot is an open-source and ultra-lightweight AI agent in the spirit of OpenClaw, Claude Code, and Codex. It keeps the core agent loop small and readable while still supporting chat channels, memory, MCP and practical deployment paths, so you can go from local setup to a long-running personal agent with minimal overhead.

📢 News

  • 2026-05-15 🚀 Released v0.2.0/goal holds sustained objectives across turns, WebUI now ships inside the wheel, image generation end to end, 5 new providers with fallback_models, and a real agent-loop refactor. Please see release notes for details.
  • 2026-05-14 🎯 /goal for long-term objectives, visible multi-step progress, long-horizon missions in chat.
  • 2026-05-13 🧠 Streaming reasoning before answers, automatic backup models, smoother plug-in reconnects.
  • 2026-05-12 🎛️ Saved model presets with WebUI badge, simpler plug-in tools, quieter Feishu topic threads.
  • 2026-05-11 🖥️ NVIDIA NIM support, terminal bot name and icon, streamed reasoning and MiMo toggle clarity.
  • 2026-05-09 🖼️ Sharper image replay, BYO web-search keys in Settings, Feishu threads routed cleanly.
  • 2026-05-08 ✨ Inline chat image, redesigned Settings and keys, Dream memory aligned with visible history.
  • 2026-05-07 📜 Locale-aware slash palette in WebUI, LAN login, faithful HTTP streaming responses.
  • 2026-05-06 🧩 Tunable tool hint, steadier voice and plug-in startups, schedules and reminders that stick.
  • 2026-05-05 🛡️ Quiet deny for unknown Telegram chats, Dream cleanup, fuller automation summaries.
Earlier news
  • 2026-05-04 🔐 Safer DingTalk outbound media links, durable cron persistence, DeepSeek polish.
  • 2026-05-03 ⚙️ Predictable shell allow-list behavior, isolated chats mid-reply, cleaner interactive retries.
  • 2026-05-02 🐈 LongCat support, smarter token sizing hints, clearer bundled upgrade guidance.
  • 2026-05-01 ☁️ Native AWS Bedrock provider, tighter helper handoffs and scoped session files.
  • 2026-04-30 💬 Feishu threads that honor replies and topics, WhatsApp bridge refresh on source edits.
  • 2026-04-29 🚀 Released v0.1.5.post3 — Smarter threads on Feishu, Discord, Slack, and Teams; DeepSeek-V4; Hugging Face & Olostep; choices, /history, and steadier long chats. Please see release notes for details.
  • 2026-04-28 🌐 Olostep web search, Hugging Face provider, safer workspace-tool interruptions.
  • 2026-04-27 💬 /history command, smarter session replay caps, smoother Discord / Slack threads.
  • 2026-04-26 🧭 Natural cron reminders, thread-aware restarts, safer local provider and shell behavior.
  • 2026-04-25 🧩 ask_user choices, macOS LaunchAgent deployment, MSTeams stale-reference cleanup.
  • 2026-04-24 🎥 Video attachments for channels, DeepSeek thinking control, faster document startup.
  • 2026-04-23 🧵 Discord thread sessions, Telegram inline buttons, structured tool progress updates.
  • 2026-04-22 🔎 GitHub Copilot GPT-5 / o-series support, configurable web fetch, WebUI image uploads.
  • 2026-04-21 🚀 Released v0.1.5.post2 — Windows & Python 3.14 support, Office document reading, SSE streaming for the OpenAI-compatible API, and stronger reliability across sessions, memory, and channels. Please see release notes for details.
  • 2026-04-20 🎨 Kimi K2.6 support, Telegram long-message split, WebUI typography & dark-mode polish.
  • 2026-04-19 🌐 WebUI i18n locale switcher, atomic session writes with auto-repair.
  • 2026-04-18 🧪 Initial WebUI chat, smarter setup wizard menus, WebSocket multi-chat multiplexing.
  • 2026-04-17 🪟 Windows & Python 3.14 CI, Dream line-age memory, email self-loop guard.
  • 2026-04-16 📡 SSE streaming for OpenAI-compatible API, Discord channel allow-list.
  • 2026-04-15 🎛️ LM Studio & nullable API keys, MiniMax thinking endpoint, runtime SelfTool.
  • 2026-04-14 🚀 Released v0.1.5.post1 — Dream skill discovery, mid-turn follow-up injection, WebSocket channel, and deeper channel integrations. Please see release notes for details.
  • 2026-04-13 🛡️ Agent turn hardened — user messages persisted early, auto-compact skips active tasks.
  • 2026-04-12 🔒 Lark global domain support, Dream learns discovered skills, shell sandbox tightened.
  • 2026-04-11 ⚡ Context compact shrinks sessions on the fly; Kagi web search; QQ & WeCom full media.
  • 2026-04-10 📓 Multiple MCP servers, Feishu streaming & done-emoji.
  • 2026-04-09 🔌 WebSocket channel, unified cross-channel session, disabled_skills config.
  • 2026-04-08 📤 API file uploads, OpenAI reasoning auto-routing with Responses fallback.
  • 2026-04-07 🧠 Anthropic adaptive thinking, MCP resources & prompts exposed as tools.
  • 2026-04-06 🛰️ Langfuse observability, unified Whisper transcription, email attachments.
  • 2026-04-05 🚀 Released v0.1.5 — sturdier long-running tasks, Dream two-stage memory, production-ready sandboxing and programming Agent SDK. Please see release notes for details.
  • 2026-04-04 🚀 Jinja2 response templates, Dream memory hardened, smarter retry handling.
  • 2026-04-03 🧠 Xiaomi MiMo provider, chain-of-thought reasoning visible, Telegram UX polish.
  • 2026-04-02 🧱 Long-running tasks run more reliably — core runtime hardening.
  • 2026-04-01 🔑 GitHub Copilot auth restored; stricter workspace paths; OpenRouter Claude caching fix.
  • 2026-03-31 🛰️ WeChat multimodal alignment, Discord/Matrix polish, Python SDK facade, MCP and tool fixes.
  • 2026-03-30 🧩 OpenAI-compatible API tightened; composable agent lifecycle hooks.
  • 2026-03-29 💬 WeChat voice, typing, QR/media resilience; fixed-session OpenAI-compatible API.
  • 2026-03-28 📚 Provider docs refresh; skill template wording fix.
  • 2026-03-27 🚀 Released v0.1.4.post6 — architecture decoupling, litellm removal, end-to-end streaming, WeChat channel, and a security fix. Please see release notes for details.
  • 2026-03-26 🏗️ Agent runner extracted and lifecycle hooks unified; stream delta coalescing at boundaries.
  • 2026-03-25 🌏 StepFun provider, configurable timezone, Gemini thought signatures.
  • 2026-03-24 🔧 WeChat compatibility, Feishu CardKit streaming, test suite restructured.
  • 2026-03-23 🔧 Command routing refactored for plugins, WhatsApp/WeChat media, unified channel login CLI.
  • 2026-03-22 ⚡ End-to-end streaming, WeChat channel, Anthropic cache optimization, /status command.
  • 2026-03-21 🔒 Replace litellm with native openai + anthropic SDKs. Please see commit.
  • 2026-03-20 🧙 Interactive setup wizard — pick your provider, model autocomplete, and you’re good to go.
  • 2026-03-19 💬 Telegram gets more resilient under load; Feishu now renders code blocks properly.
  • 2026-03-18 📷 Telegram can now send media via URL. Cron schedules show human-readable details.
  • 2026-03-17 ✨ Feishu formatting glow-up, Slack reacts when done, custom endpoints support extra headers, and image handling is more reliable.
  • 2026-03-16 🚀 Released v0.1.4.post5 — a refinement-focused release with stronger reliability and channel support, and a more dependable day-to-day experience. Please see release notes for details.
  • 2026-03-15 🧩 DingTalk rich media, smarter built-in skills, and cleaner model compatibility.
  • 2026-03-14 💬 Channel plugins, Feishu replies, and steadier MCP, QQ, and media handling.
  • 2026-03-13 🌐 Multi-provider web search, LangSmith, and broader reliability improvements.
  • 2026-03-12 🚀 VolcEngine support, Telegram reply context, /restart, and sturdier memory.
  • 2026-03-11 🔌 WeCom, Ollama, cleaner discovery, and safer tool behavior.
  • 2026-03-10 🧠 Token-based memory, shared retries, and cleaner gateway and Telegram behavior.
  • 2026-03-09 💬 Slack thread polish and better Feishu audio compatibility.
  • 2026-03-08 🚀 Released v0.1.4.post4 — a reliability-packed release with safer defaults, better multi-instance support, sturdier MCP, and major channel and provider improvements. Please see release notes for details.
  • 2026-03-07 🚀 Azure OpenAI provider, WhatsApp media, QQ group chats, and more Telegram/Feishu polish.
  • 2026-03-06 🪄 Lighter providers, smarter media handling, and sturdier memory and CLI compatibility.
  • 2026-03-05 ⚡️ Telegram draft streaming, MCP SSE support, and broader channel reliability fixes.
  • 2026-03-04 🛠️ Dependency cleanup, safer file reads, and another round of test and Cron fixes.
  • 2026-03-03 🧠 Cleaner user-message merging, safer multimodal saves, and stronger Cron guards.
  • 2026-03-02 🛡️ Safer default access control, sturdier Cron reloads, and cleaner Matrix media handling.
  • 2026-03-01 🌐 Web proxy support, smarter Cron reminders, and Feishu rich-text parsing improvements.
  • 2026-02-28 🚀 Released v0.1.4.post3 — cleaner context, hardened session history, and smarter agent. Please see release notes for details.
  • 2026-02-27 🧠 Experimental thinking mode support, DingTalk media messages, Feishu and QQ channel fixes.
  • 2026-02-26 🛡️ Session poisoning fix, WhatsApp dedup, Windows path guard, Mistral compatibility.
  • 2026-02-25 🧹 New Matrix channel, cleaner session context, auto workspace template sync.
  • 2026-02-24 🚀 Released v0.1.4.post2 — a reliability-focused release with a redesigned heartbeat, prompt cache optimization, and hardened provider & channel stability. See release notes for details.
  • 2026-02-23 🔧 Virtual tool-call heartbeat, prompt cache optimization, Slack mrkdwn fixes.
  • 2026-02-22 🛡️ Slack thread isolation, Discord typing fix, agent reliability improvements.
  • 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!
  • 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!

💡 Key Features of nanobot

  • Ultra-lightweight: stable long-running agent behavior with a small, readable core.
  • Research-ready: the codebase is intentionally simple enough to study, modify, and extend.
  • Practical: chat channels, API, memory, MCP, and deployment paths are already built in.
  • Hackable: you can start fast, then go deeper through repo docs instead of a monolithic landing page.

📦 Install

If you want the newest features and experiments, install from source.

If you want the most stable day-to-day experience, install from PyPI or with uv.

Install from source

git clone https://github.com/HKUDS/nanobot.git
cd nanobot
pip install -e .

Install with uv

uv tool install nanobot-ai

Install from PyPI

pip install nanobot-ai

🚀 Quick Start

1. Initialize

nanobot onboard

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

Configure these two parts in your config (other options have defaults). Add or merge the following blocks into your existing config instead of replacing the whole file.

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

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

Set your model (optionally pin a provider — defaults to auto-detection):

{
  "agents": {
    "defaults": {
      "provider": "openrouter",
      "model": "anthropic/claude-opus-4-6"
    }
  }
}

3. Chat

nanobot agent
  • Want different LLM providers, web search, MCP, security settings, or more config options? See Configuration
  • Want to run locally? Use Atomic Chat, vLLM, Ollama, and others.
  • Want to run nanobot in chat apps like Telegram, Discord, WeChat or Feishu? See Chat Apps
  • Want Docker or Linux service deployment? See Deployment

🌐 WebUI

The WebUI ships inside the published wheel — no extra build step. Just enable the WebSocket channel and open it in your browser.

nanobot webui preview

1. Enable the WebSocket channel in ~/.nanobot/config.json

{ "channels": { "websocket": { "enabled": true } } }

2. Start the gateway

nanobot gateway

3. Open the WebUI

Visit http://127.0.0.1:8765 in your browser. To open it from another device on your LAN, see WebUI docs → LAN access.

Working on the WebUI itself? Check out webui/README.md for the Vite dev server (HMR) workflow.

🏗️ Architecture

nanobot architecture

🐈 nanobot stays lightweight by centering everything around a small agent loop: messages come in from chat apps, the LLM decides when tools are needed, and memory or skills are pulled in only as context instead of becoming a heavy orchestration layer. That keeps the core path readable and easy to extend, while still letting you add channels, tools, memory, and deployment options without turning the system into a monolith.

✨ Features

📈 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

📚 Docs

Browse the repo docs for the latest features and GitHub development version, or visit nanobot.wiki for the stable release documentation.

🤝 Contribute & Roadmap

PRs welcome! The codebase is intentionally small and readable. 🤗

Branching Strategy

BranchPurpose
mainStable releases — bug fixes and minor improvements
nightlyExperimental features — new features and breaking changes

Unsure which branch to target? See CONTRIBUTING.md for details.

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

Contact

This project was started by Xubin Ren as a personal open-source project and continues to be maintained in an individual capacity using personal resources, with contributions from the open-source community. Feel free to contact [email protected] for questions, ideas, or collaboration.

Contributors

Contributors

⭐ Star History

Star History Chart

Thanks for visiting ✨ nanobot!

Views

相似文章

@seclink: 最近这个开源工具挺火的。 看起来像是 钉钉悟空 、 字节 aily的开源版本。 你可以基于它来实现自己的agent 并且接入到上述的 即时通讯平台之中。 有的哥们基于这个改吧改吧,就能给投资人演示,拿到了不小规模的估值 。 让投资人记忆深…

X AI KOLs Following

CowAgent 是一个基于大模型的开源 AI 助理框架,支持自主任务规划、长期记忆、知识库、多模型切换和多渠道接入(微信、飞书、钉钉等),可快速构建和部署个性化 AI agent。

本文系统梳理了AI Agent架构与工程实践,涵盖控制流、上下文工程、工具设计、记忆、多Agent组织、评测、追踪和安全,基于OpenClaw实现展开,强调Harness(测试验证基础设施)对系统稳定性的关键作用。

X AI KOLs

本文系统梳理了AI Agent架构与工程实践,涵盖控制流、上下文工程、工具设计、记忆、多Agent组织、评测、追踪和安全,基于OpenClaw实现展开,强调Harness(测试验证基础设施)对系统稳定性的关键作用。

@wsl8297: 用 AI Agent 跑复杂任务,最难受的往往不是模型不够强,而是对话一变长,上下文就开始爆仓。 你还得一遍遍补背景、重讲流程,再加上工具调用吐出来的冗余日志,Token 像开了口子一样往外流。 最近看到腾讯开源的 TencentDB A…

X AI KOLs Timeline

腾讯开源了 TencentDB Agent Memory,通过分层记忆管理(符号化短期记忆+分层长期记忆)解决AI Agent长对话上下文爆仓问题,实测Token消耗最高降低61%,任务通过率提升超50%。