# nanobot
🐈 **nanobot** is a lightweight, open-source, self-hosted personal AI agent written in Python. Chat with it from your browser, terminal, or favorite chat app to work with files, remember preferences, use tools, and run scheduled tasks—powered by any supported cloud or local AI model.
## 💡 Why nanobot
- **Lightweight & low footprint:** Small Python core with fast startup and low memory usage—runs comfortably on a personal laptop or a modest VPS without heavyweight infrastructure.
- **Polished WebUI & native TUI out of the box:** Includes a clean, responsive browser workbench (multi-pane topics, live tool activity, inline file diffs, context usage, themes, and custom backgrounds) plus a matching terminal UI—no separate frontend build needed.
- **Works where you already chat:** Connect seamlessly to 15+ chat apps including Telegram, Discord, Slack, Feishu, WeChat, WhatsApp, Email, Mattermost, and Linear.
- **Real tools, memory & automations:** Reads images, PDFs, and Office files (`.docx`, `.xlsx`, `.pptx`), edits files, connects to MCP servers and plugins, builds long-term memory with [Dream](./docs/memory.md), and runs [scheduled tasks, local triggers, and sustained goals](./docs/automations.md).
- **Model freedom & full control:** Use any cloud API (OpenRouter, Anthropic, OpenAI, Gemini, DeepSeek), OAuth subscription (OpenAI Codex, GitHub Copilot, xAI Grok), or local server (Ollama, vLLM, LM Studio)—self-hosted on your own machine.
## Start Here
| What you want to do | Where to go |
|---|---|
| Install nanobot with no terminal or config experience | [Start Without Technical Background](./docs/start-without-technical-background.md) |
| Install quickly and get your first reply | [Install](#-install) → [Quick Start](#-quick-start) |
| Explore the browser workbench | [WebUI](#-webui) |
| Connect Telegram, Discord, Slack, Feishu, WeChat, Email, Linear, or others | [Chat Apps Guide](./docs/guides/chat-app-ai-agent.md) |
| Configure models, MCP tools, memory, or security | [Documentation](./docs/README.md) · [Configuration](./docs/configuration.md) |
| Run nanobot continuously or on a server | [Deploy](#-deploy) · [Deployment Guide](./docs/deployment.md) |
| Embed nanobot in Python | [Python SDK](./docs/python-sdk.md) |
| Contribute or extend nanobot | [Architecture](./docs/architecture.md) · [Contributing](./CONTRIBUTING.md) |
## 📦 Install
Requires **Python 3.11 or newer** and an account on a [supported AI provider or local model server](./docs/providers.md). Packaged installs include both the WebUI and terminal UI—no frontend build tools required.
> [!NOTE]
> This README tracks the latest development branch; the installer below installs the latest stable release. For published release docs, visit [nanobot.wiki](https://nanobot.wiki/docs/latest/getting-started/nanobot-overview).
**Recommended: one-command installer** (installs into an isolated environment and opens the WebUI automatically on desktop)
**macOS / Linux**
```bash
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
```
**Windows PowerShell**
```powershell
irm https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.ps1 | iex
```
Preview the installer or inspect the scripts first
Preview what the installer will do without changing anything:
```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh -s -- --dry-run
```
```powershell
# Windows PowerShell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.ps1))) --dry-run
```
Or read [`scripts/install.sh`](./scripts/install.sh) and [`scripts/install.ps1`](./scripts/install.ps1) directly.
Other install methods: uv, pip, or from source
**uv**
```bash
uv tool install nanobot-ai
nanobot webui
```
**pip (inside a virtual environment)**
```bash
python -m pip install nanobot-ai
nanobot webui
```
**From source (latest `main`, requires Git)**
```bash
git clone https://github.com/HKUDS/nanobot.git
cd nanobot
python3 -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -e .
nanobot webui
```
For full install options, troubleshooting `nanobot: command not found`, or updating an existing install, see [Install and Quick Start](./docs/quick-start.md) and [Updating nanobot](./docs/updating.md).
## 🚀 Quick Start
If the installer already opened the WebUI in your browser, continue right there. Otherwise run:
```bash
nanobot webui
```
**Your first three steps:**
1. Open **Settings → Models**, create a preset, and add your provider API key (or sign in with OAuth). See [Configure Your Model](./docs/quick-start.md#2-configure-your-model).
2. Start a new topic and send `Hello!` to verify your model connection.
3. Try a file task: pick a practice folder with **Restricted** access and ask *"Read notes.txt and write a short summary to summary.md."* See [Your first file task](./docs/start-without-technical-background.md#your-first-file-task).
Once that works, you can ask nanobot right in chat to help configure your next feature—for example: *"I am using the WebUI. Help me connect Telegram and allow only my account."* (See [Continue with nanobot](./docs/quick-start.md#continue-with-nanobot).)
Terminal-only setup and interactive TUI
Configure a model without a browser:
```bash
nanobot onboard --wizard
```
Send a single test message or launch the interactive terminal UI (shares history and gateway with the WebUI):
```bash
nanobot agent -m "Hello!"
nanobot
```
Useful TUI shortcuts: type `/` for commands, `@` for apps/topics, `$` for skills, `Ctrl+V` / `Alt+V` to paste images, `/diff` to view edits, `/context` to inspect usage, and `/detach` to keep the gateway running in the background after closing the TUI. See [CLI Reference](./docs/cli-reference.md#agent-cli).
Open a remote server's WebUI over SSH
On the remote server:
```bash
nanobot webui --no-open
```
On your computer, forward port `8765`:
```bash
ssh -N -L 127.0.0.1:8765:127.0.0.1:8765 user@SERVER
```
Then open the **complete login link** printed on the server (including everything after `#`) in your local browser. You can also connect to existing remote servers directly from your local WebUI via **Manage connections…**—see [Connect to an Existing Remote nanobot](./docs/guides/remote-instances.md).
Keep nanobot running in the background
With the official installer, nanobot already stays running in the background after you close the browser or terminal. For other installs, run:
```bash
nanobot gateway --background
```
Manage the background gateway anytime:
```bash
nanobot gateway status
nanobot gateway logs
nanobot gateway restart
nanobot gateway stop
```
For automatic startup across reboots, see [Deployment](./docs/deployment.md).
If nanobot is helpful to you, giving the repo a star on GitHub is the simplest way to support the project!
## ☁️ Deploy
**One-click on Render**
Deploy the gateway and bundled WebUI with persistent storage (requires a paid Render Starter plan for the persistent disk):
[](https://render.com/deploy?repo=https://github.com/HKUDS/nanobot)
**Self-host**
See the [Deployment Guide](./docs/deployment.md) for Docker Compose, Docker, Linux `systemd`, and macOS LaunchAgent setup.
## 🌐 WebUI
The WebUI is included out of the box—just run `nanobot webui`.
Mobile WebUI · dark theme
### Keep related work side by side
Group up to four topics in resizable panes, fork any conversation from an earlier reply, or mention another topic with `@` to pull in its context. Pick a project folder and access mode per topic—and use [Temporary chats](./docs/webui.md#temporary-chats) for throwaway questions outside saved history and memory. [Explore topics and panes →](./docs/webui.md#conversation-groups-and-panes)
### Inspect every step and token
Expand agent activity to inspect reasoning, tool calls, inline file diffs, and read-only file previews. Click the context indicator to review token usage, cache reuse, and the file graph across turns.
[Explore activity and context →](./docs/webui.md#activity-and-context-usage)
### Connect tools, skills, and chat apps
Use **Apps** to add MCP servers (with built-in OAuth and keyless presets), Agent Plugins, and CLI Apps, then attach them in chat with `@`. Manage built-in and marketplace skills in **Skills**, and connect chat platforms with guided setup in **Channels**.
[Explore Apps →](./docs/webui.md#apps) · [Discover Skills →](./docs/webui.md#skills) · [Connect chat apps →](./docs/guides/chat-app-ai-agent.md)
### Automate recurring work
Ask nanobot in any topic to schedule reminders or recurring reports, or create local triggers (`/trigger`) for scripts and CI jobs. Manage everything from **Automations** with list and calendar views.
A single Python gateway powers the WebUI, terminal UI, and all chat apps—handling sessions, tools, memory, automations, and security policy in one place. Use the [Python SDK](./docs/python-sdk.md) to embed nanobot in your own Python applications, or read [Architecture](./docs/architecture.md) for source-level details.
## Docs
Browse the [documentation index](./docs/README.md) (or [nanobot.wiki](https://nanobot.wiki/docs/latest/getting-started/nanobot-overview) for the latest stable release):
- **Get started:** [Beginner walkthrough](./docs/start-without-technical-background.md) · [Install and Quick Start](./docs/quick-start.md)
- **Models & providers:** [Providers and Models](./docs/providers.md) · [Provider Cookbook](./docs/provider-cookbook.md)
- **Chat apps & tools:** [Chat Apps Guide](./docs/guides/chat-app-ai-agent.md) · [MCP Presets](./docs/mcp-presets.md) · [Image Generation](./docs/image-generation.md)
- **Memory & automations:** [Memory](./docs/memory.md) · [Automations](./docs/automations.md) · [Deployment](./docs/deployment.md)
- **Reference & help:** [Concepts](./docs/concepts.md) · [Configuration](./docs/configuration.md) · [Troubleshooting](./docs/troubleshooting.md) · [Task Guides](./docs/guides/README.md)
## Releases
**Latest release: [v0.4.1](https://github.com/HKUDS/nanobot/releases/tag/v0.4.1)** — improves workspace permissions, sandboxed commands, connection recovery, file-context previews, and navigation. See [release notes](https://github.com/HKUDS/nanobot/releases/tag/v0.4.1), [Updating nanobot](./docs/updating.md), and the [release archive](./docs/release-archive.md).
## Open Source Partners
## 🤝 Contribute
Everyone is welcome to [open an issue](https://github.com/HKUDS/nanobot/issues) with a bug, reproduction, use case, or suggestion. Discuss the problem first; pull requests are currently limited to repository collaborators. See [CONTRIBUTING.md](./CONTRIBUTING.md) for the contribution process and recognition.
## Maintainers