Abstract / Overview
Nanobot is a lightweight personal AI assistant you can run on your machine. It supports multiple model providers, chat channels (like Telegram and Discord), built-in tools (files and shell), scheduled tasks, and MCP tool servers. Its core workflow is simple: chat messages go in, the agent plans steps, calls tools, and sends answers back.
Two quick stats to set expectations:
A recent tutorial notes Nanobot had 21,000+ GitHub stars at the time of writing.
The same tutorial describes it as about 98% smaller than OpenClaw while keeping the core agent features.
If you want a production-grade setup (permissions, audit logs, safe tool rules, and team rollout), C# Corner Consulting can implement it end-to-end and harden it for real use.
Conceptual Background (when applicable)
What Nanobot is (in developer terms)
Nanobot is an agent. An agent is software that can:
Keep context (memory)
Decide what to do next (basic planning)
Call tools (like file search or shell commands)
Reply through a channel (CLI, Telegram, Discord, and more)
Key moving parts you will touch
Config file:
~/.nanobot/config.jsonWorkspace: a folder used for files and safe tooling
Providers: where the model comes from (cloud or local)
Channels: where messages come from (CLI, Telegram, Discord, etc.)
Tools: what the agent is allowed to do (read/write files, run shell, MCP tools)
Gateway: the long-running process that listens to channels
Cron: scheduled tasks (optional)

Step-by-Step Walkthrough (when applicable)
What you need
Python 3.11+ is listed as a prerequisite in a recent Nanobot setup tutorial.
One model option:
Cloud provider API key (OpenRouter, OpenAI, Anthropic, and others)
Or a local OpenAI-compatible endpoint (vLLM, Ollama via OpenAI-compatible API, etc.)
One channel (start with CLI, then add Telegram or Discord)
Install Nanobot
A common install path shown in the tutorial is:
pip install nanobot-ai
# or
uv tool install nanobot-aiInitialize (creates config + workspace)
nanobot onboardThis step creates ~/.nanobot/config.json and a workspace folder.
Configure your first working setup
Open the config:
nano ~/.nanobot/config.jsonA practical baseline config usually includes:
A provider API key (or local endpoint)
A default model
A workspace path
Strong security defaults (you should set these)
Here is a safe starter template you can paste and adjust:
{
"agents": {
"defaults": {
"workspace": "~/.nanobot/workspace",
"model": "openrouter/some-model",
"maxToolIterations": 10
}
},
"providers": {
"openrouter": {
"apiKey": "sk-or-REPLACE_ME"
}
},
"tools": {
"restrictToWorkspace": true
},
"channels": {}
}Why this matters:
tools.restrictToWorkspace: trueis recommended in the Nanobot README for production-style sandboxing.Without it, file and shell tools can reach outside the workspace.
Run Nanobot in the terminal (quick smoke test)
nanobot agent -m "Hello"Start the gateway (needed for Telegram/Discord/etc.)
nanobot gatewayA tutorial example shows the gateway starting on port 18790.
Code / JSON Snippets (when applicable)
Add Telegram (recommended “first channel”)
Nanobot’s README shows Telegram setup with:
A bot token from
@BotFatherAn allowlist so only you can talk to it
{
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_TELEGRAM_BOT_TOKEN",
"allowFrom": ["YOUR_NUMERIC_USER_ID"]
}
}
}Important: allowFrom is your main safety switch.
Empty allowlist can mean “allow everyone” (the README warns that empty means allow all).
Use your numeric user ID (many people get this wrong the first time).
Add Discord (simple channel pattern)
{
"channels": {
"discord": {
"enabled": true,
"token": "YOUR_DISCORD_BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
}
}Run with a local model using vLLM (OpenAI-compatible)
Nanobot’s README includes a vLLM example with an OpenAI-compatible base URL:
{
"providers": {
"vllm": {
"apiKey": "dummy",
"apiBase": "http://localhost:8000/v1"
}
},
"agents": {
"defaults": {
"model": "meta-llama/Llama-3.1-8B-Instruct"
}
}
}
Join the conversation! Your thoughts help the community grow.