# Repository Briefing: HKUDS/nanobot
> Source: https://repoforai.com/repo/HKUDS/nanobot (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/HKUDS/nanobot
- **Official Docs / Website**: https://nanobot.wiki
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (100/100 · Maintenance 35/35 · Adoption 25/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.4.2 (2026-11-21) — https://github.com/HKUDS/nanobot/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, Local AI, MCP, CLI, API
- **Momentum**: 50,538 ★ total (+10 24h / +157 7d) · 8,799 forks
- **Topics**: `agent-framework`, `ai-agent`, `ai-agents`, `chatbot`, `chatops`, `discord-bot`, `llm-agents`, `llms`, `local-llm`, `mcp`, `model-context-protocol`, `multi-agent`
- **When to Use**: Best for: Individuals or small teams that want a self-hosted personal agent for file work, tool calls and recurring tasks across browser, terminal and chat, with a choice of model providers. Skip if: You only need a chat interface, want a managed service that takes care of updates and integrations, or require verified offline operation and cannot vet every configured dependency and connection.

## Overview
```text
### Architecture & Core Mechanics
Nanobot is a self-hosted agent application built around a single Python gateway. The bundled WebUI, native TUI and chat integrations use the gateway to manage sessions and call configured model providers and tools. The same gateway handles memory, automations and security policy. Since v0.4.0, it stores model history and browser transcripts in SQLite, with support for importing existing conversations.

The `nanobot-ai` package requires Python 3.11+ and declares Typer, Pydantic, pydantic-settings, the Anthropic SDK and websockets. The packaged interfaces do not need a separate frontend build. MCP servers, Agent Plugins and CLI Apps extend the workbench and can be attached to topics; the Python SDK is a separate integration path for embedding nanobot in another application.

### Key Capabilities & Differentiators
Nanobot can use cloud APIs such as OpenRouter, Anthropic and OpenAI, OAuth subscriptions such as OpenAI Codex and GitHub Copilot, or model servers such as Ollama, vLLM and LM Studio. More than 15 chat integrations include Telegram, Discord, Slack, Feishu and Email. The agent can read images, PDFs and Office files (`.docx`, `.xlsx`, `.pptx`), and edit files within the access granted to the topic.

The browser workbench can group up to four topics in resizable panes, fork a conversation from an earlier reply and reference another topic with `@`. Tool activity, inline diffs and context usage are inspectable in the UI. Dream provides long-term memory; temporary chats stay outside saved history and memory. Scheduled jobs, local triggers and sustained goals cover recurring work beyond interactive chat.

### Trade-offs & Limitations
A chat-only model UI is simpler when all you need is conversation; a single-platform bot is simpler when one channel is enough. Nanobot trades that simplicity for a shared workbench with file access, tool integrations, memory and scheduling. Centralizing those functions also concentrates access: start with a Restricted workspace, limit who can talk to the agent on each channel, and review what an MCP server, plugin or scheduled task can access before enabling it.

A cloud endpoint shifts inference hardware off the gateway host but introduces provider charges, network dependence and external data handling. A local endpoint gives you more control but moves inference capacity and maintenance onto infrastructure you operate. The package metadata still classifies the project as Alpha; test upgrades against your chosen providers, channels and persistent state. MIT licensing permits commercial use, but connected models and services may have separate terms.

### Hardware & Deployment Guide
For a packaged install, use `uv tool install nanobot-ai` and launch `nanobot webui`; configure a model preset before sending a test message. For terminal-only setup, use `nanobot onboard --wizard`. On a server, Compose runs `gateway` and mounts `~/.nanobot` at `/home/nanobot/.nanobot`. It binds port `18790` to loopback but publishes `8765` without a loopback-only host binding. Review that exposure and configure authentication before allowing network access. An alternative is `nanobot webui --no-open` with port `8765` forwarded over SSH.

A self-hosted gateway still needs a supported model endpoint; put inference on a local server if you want to avoid a cloud model API. Review chat and tool connections separately if offline operation is required. v0.4.0 introduced SQLite persistence, v0.4.1 addressed TLS certificate verification, sandboxed shell execution and workspace permissions, and v0.4.2 expanded SSH support. SSH quick pairing remains Linux-only, and gateway-native TLS and `trustedProxyAuth` are not supported over SSH.
```

## Key Capabilities
```text
- Gateway: One Python service manages sessions, tools, memory, automation and security policy for browser, terminal and chat clients.
- Persistence: v0.4.0 adds SQLite storage for gateway model history and browser transcripts, with import of existing conversations.
- Workbench: Group up to four topics, fork conversations and inspect tool activity, inline file diffs and context usage.
- Model connectivity: Mix supported cloud APIs, OAuth subscriptions and local endpoints such as Ollama, vLLM and LM Studio.
- Extensions and automation: Attach MCP servers, plugins or CLI Apps to topics; manage scheduled work and local script or CI triggers.
- Container defaults: Persist state under ~/.nanobot, drop capabilities except the three needed for bootstrap, and apply no-new-privileges.
```

## Quick Start / Clone
```bash
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
```
