Back
AI Agents

HKUDS/nanobot

HKUDS/nanobot is a lightweight, self-hosted Python framework for personal AI agents. It combines a WebUI, tool registration, persistent memory, an MCP layer, multi-agent workflows, automation scripts and pluggable chat adapters.

The project is most useful for developers who want to inspect and control the system around a model. A local deployment can support focused assistants, such as a grammar checker or research aide, without outsourcing the entire workflow to a hosted agent platform.


What self-hosting changes

  1. Data stays yours – No API keys, no third‑party servers. Sensitive context lives on your machine.
  2. Zero vendor lock‑in – You own the code, the model, the upgrade path.
  3. Extensibility by design – Add a new tool by dropping a Python function into the MCP registry; the framework auto‑wires it to every agent that needs it.
  4. Lightweight footprint – A few megabytes of dependencies, no Docker daemon required, and it runs on any OS that supports Python 3.9+.

Those properties make nanobot relevant to researchers, independent developers and small teams that need direct control over an assistant’s data and tools.


A workshop implementation

Last week I ran a full‑scale, hands‑on workshop titled “Agentic AI Engineering: MCP, CrewAI, OpenAI Agent SDK.” The session walked participants through:

  • Model‑Control‑Protocol (MCP) – a simple JSON‑over‑HTTP contract for exposing any Python function as a callable tool.
  • CrewAI – a lightweight orchestration layer that lets you declare a hierarchy of agents, assign them roles, and let them pass state via shared memory.
  • OpenAI Agent SDK – for those who still want to tap into GPT‑4‑level reasoning while keeping the surrounding workflow fully self‑hosted.

The workshop culminated in a live demo where each participant deployed a custom “Catbot” into nanobot’s WebUI. Catbot was entered in DEV’s Summer Bug Smash (a Sentry‑powered bug‑fixing competition) and solved a subtle grammar‑parsing edge case that had tripped up larger language models. Within nanobot, Catbot:

  1. Registered its check_grammar function as an MCP tool.
  2. Gained a persistent memory slot to store user‑specific style guides.
  3. Started a chat session through the WebUI, where it could ask clarifying questions, call external spell‑checking APIs, and even hand off to a “Proofreader” agent when confidence was low.

The exercise showed how a single Python tool can become part of an interactive, memory-aware workflow without requiring a large application scaffold.


Where the framework is useful

If you’re looking to move beyond “chat‑only” AI experiences and into real‑world automation, nanobot gives you the scaffolding to:

  • Create modular agents that can be swapped, versioned, and tested independently.
  • Compose workflows where one agent’s output becomes another’s input, enabling planning‑execution‑reflection loops.
  • Expose any Python library (from Selenium to Pandas) as a first‑class tool without writing wrapper code.

Because the entire stack is open source and community‑driven, you can fork it, add features, or contribute bug‑fixes back, turning a personal experiment into a collaborative platform.


Trying the project

  • Grab the repo: git clone https://github.com/HKUDS/nanobot.git
  • Spin up the WebUI: python -m nanobot.ui – you’ll see a minimal chat window ready for your first tool.
  • Join the community: We have a Discord channel and a weekly “Agent‑Design” livestream where developers share patterns and troubleshoot together.
  • Check workshop dates in the repository README if the guided MCP, CrewAI and OpenAI Agent SDK material is useful to you.

Nanobot is best evaluated as an orchestration framework rather than as another model. Its value depends on whether local control, modular tools and inspectable workflows justify maintaining the surrounding infrastructure yourself.

Published
Sources recorded
None recorded
Tags
HKUDS, nanobot, MCP