SuperAPI AI Directory

Nanobot - The University of Hong Kong Data Science Lab's open-source personal AI assistant

Author: AI小集 · Original source: AI工具集

What is Nanobot

Nanobot is an ultra-lightweight personal AI assistant open-sourced by the University of Hong Kong Data Intelligence Lab, faithfully replicating the core functionality of an agent with only about 4,000 lines of code.OpenClaw Nanobot has web search, file operations, scheduled tasks, memory mechanisms, and other capabilities, and supports scenarios such as 24-hour real-time market analysis, full-stack development, schedule management, and personal knowledge bases. Compared with the original version's 430,000 lines of code, Nanobot achieves equivalent productivity with 99% code simplification. Developers can read through the source code in just a few hours and quickly understand the underlying logic of how AI calls tools and manages memory, making it an ideal choice for learning and customizing Agents.

Nanobot

Nanobot's main features

  • Agent core: Based on large language models, it implements a complete closed loop of autonomous task planning, tool calling, and multi-turn dialogue.
  • Information retrieval: Integrates a web search interface and supports real-time retrieval of external information for analysis and processing.
  • File operations: Provides code reading/writing and file system management capabilities, enabling the construction of localized personal knowledge bases.
  • Communication integration: Natively supports Telegram and WhatsApp, enabling cross-platform message sending and receiving and remote interaction.
  • Scheduled tasks: Built-in Cron-like scheduling system that can automatically execute reminders and tasks at preset intervals.
  • Memory mechanism: Uses a persistent storage solution to save dialogue context and support long-term memory recall.
  • Voice interaction: Integrates the Groq Whisper service to enable automatic recognition and transcription of voice messages.
  • Scenario templates: Presets four ready-to-use application templates: financial analysis, development assistant, schedule management, and knowledge Q&A.

Nanobot's technical principles

  • Minimalist architecture design: Nanobot breaks the system down into four core modules—the Agent loop is responsible for coordinating interactive execution between the large language model and tools, the memory module implements persistent storage and retrieval of dialogue context, the skill loader supports dynamic expansion of functional components, and the message bus uniformly handles internal and external communication routing. Overall, it replaces complex abstraction layers with explicit dependency injection.
  • Agent execution flow: User input first goes through the Prompt builder to assemble context, then is sent to the large language model for reasoning and decision-making. The model autonomously determines the tools that need to be called and generates execution instructions. After tool execution is completed, the results are fed back to the model, and the memory state is finally updated, forming a complete closed loop of "perception-decision-action-learning."
  • Multi-source LLM access: The system uses OpenRouter for unified routing, can seamlessly switch between cloud models such as Claude, GPT, and Gemini, and is also compatible with local vLLM deployment solutions, meeting flexible model selection needs and supporting data security requirements in privatization scenarios.
  • Dynamic tool system: All functions are placed in the form of skill modules under the skills/ directory and automatically loaded at runtime. It includes commonly used tools covering code operations, network requests, system commands, and more. Developers can quickly extend custom capabilities by following a unified interface specification.
  • Cross-platform communication layer: Telegram implements message sending and receiving based on the official Bot API, while WhatsApp uses a Web protocol bridging solution. Messages from all channels are standardized through the internal bus and then distributed to the Agent for processing, ensuring a consistent multi-platform experience.

Nanobot's project address

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

Nanobot's application scenarios

  • Real-time financial analysis: Nanobot can monitor market conditions 24/7, automatically capture data, and generate investment insight reports.
  • Full-stack development assistance: Supports executing coding, debugging, and deployment tasks at any time, acting as a portable technical partner.
  • Smart schedule management: Nanobot can automatically arrange meetings, send reminders, handle to-dos, and coordinate personal time planning.
  • Personal knowledge base: Nanobot supports integrating private documents such as PDFs and notes, and supports natural language question answering and knowledge retrieval.
  • Remote portable assistant: Interact anytime and anywhere via Telegram or WhatsApp, with no need to stay in front of a computer.