Skip to main content

Web console and HTTP API server for nanobot — an ultra-lightweight personal AI assistant framework

Project description

nanobot Web Console

English | 中文

A web console + API server for nanobot — an ultra-lightweight personal AI assistant framework.

nanobot provides a powerful agent core (tools, skills, memory, channels) but no HTTP API or web UI. This project adds both: a FastAPI server and a single-file web console.

Screenshots

Session History Live Chat
Dark Theme Live Chat
Settings Mobile
Settings Mobile
Knowledge Base Semantic Search
Knowledge Base Semantic Search
File Viewer Onboarding
File Viewer Onboarding

Quick Start

Prerequisites: Python 3.11+, nanobot installed and configured (~/.nanobot/config.json)

Install via pip

pip install nanobot-ai         # install nanobot first
pip install nanobot-web-console
nanobot-console

Open http://localhost:18790.

Install from source

pip install nanobot-ai
git clone https://github.com/tankyhsu/nanobot-web-console.git
cd nanobot-web-console
pip install .
nanobot-console

CLI options

nanobot-console              # default: 0.0.0.0:18790
nanobot-console --port 8080  # custom port
nanobot-console --host 127.0.0.1  # bind to localhost only
nanobot-console --reload     # auto-reload for development
nanobot-console --version    # show version

You can also run as a Python module:

python -m nanobot_web_console --port 8080

Run as systemd service (Linux)

# /etc/systemd/system/nanobot-api.service
[Unit]
Description=nanobot API Server
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/nanobot-console
Environment=HOME=/root
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
systemctl enable --now nanobot-api

Features

Web Console

  • Session History — Browse all sessions with channel filtering (Feishu / API / WS / CLI). Tool call and result messages render as collapsible cards.
  • Live Chat — Real-time WebSocket chat with streaming thinking indicators, tool call events, and results. Content persists when navigating away.
  • Settings — 6-tab configuration panel:
    • Agent — Model, temperature, max tokens, iterations, context window tokens
    • ChannelssendProgress / sendToolHints toggles
    • Providers — Edit API keys and base URLs per provider
    • Cron — Manage nanobot scheduled jobs (add / toggle / trigger / delete) and system crontab
    • Prompts — Edit SOUL.md, AGENTS.md, USER.md in-browser
    • Info — Tools, skills, memory viewer
  • Knowledge Base (optional, pip install openviking to enable) — Browse viking:// filesystem, view file contents, upload/delete files, semantic search; shows install guide when not installed
  • Dark / Light theme, mobile responsive, URL routing, IME-compatible input

API Server

  • POST /api/chat — Simple chat with emotion detection
  • POST /v1/chat/completions — OpenAI-compatible endpoint
  • WS /ws/chat — Streaming chat (thinking / tool_call / tool_result / final events + 15s heartbeat)
  • GET/DELETE /api/sessions/{name} — Session management
  • GET/POST /api/config — View and update agent config
  • GET/POST /api/cron/jobs — Nanobot cron job management
  • /api/viking/* — Knowledge base (optional, requires pip install openviking)

WebSocket Protocol

Client sends:

{"message": "user text", "session": "ws:device-id", "constraint": "optional"}

Server pushes:

{"type": "thinking", "content": "..."}
{"type": "stream", "delta": "..."}
{"type": "stream_end", "resuming": false}
{"type": "tool_call", "content": "..."}
{"type": "heartbeat", "timestamp": 1739800015.0}
{"type": "final", "content": "...", "emotion": "happy", "session": "ws:device-id"}

Knowledge Base (Optional)

One command to enable:

pip install openviking

Restart nanobot-console — it auto-detects and initializes. When not installed, the server runs normally and shows an install guide in the Knowledge Base tab.

Knowledge Base Features

  • File Browser — Navigate the viking:// virtual filesystem with directory support
  • File Viewer — Built-in Markdown renderer to read knowledge base files in-browser
  • File Upload — Drag-and-drop or click to upload multiple files; auto-indexed for semantic search
  • File Delete — Confirmation dialog + error feedback
  • Semantic Search — Full-text semantic search across all resources
  • Live Chat KB Toggle — Button next to the input field to enable/disable RAG augmentation per message

File Structure

nanobot_web_console/
  __init__.py    # Package version
  cli.py         # CLI entry point (nanobot-console command)
  server.py      # FastAPI server
  index.html     # Web console (single file, zero dependencies)
pyproject.toml   # Package metadata
server.py        # Backward-compatible entry point

Tech Stack

  • Backend — FastAPI + Uvicorn, imports nanobot internals directly
  • Frontend — Vanilla JS, CSS custom properties, WebSocket API, marked.js (CDN)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanobot_web_console-0.1.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanobot_web_console-0.1.0-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file nanobot_web_console-0.1.0.tar.gz.

File metadata

  • Download URL: nanobot_web_console-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for nanobot_web_console-0.1.0.tar.gz
Algorithm Hash digest
SHA256 986d5d877bb86d885c146065a328b0f01d4f3a5ddf56840ac6f76423f178f144
MD5 6f8e90db36b0fc01ca14ec7abb4220bf
BLAKE2b-256 168a223174c5e796367afae09d8cfe1f040014b365c69f9f4cc2f1bd5a7d22ec

See more details on using hashes here.

File details

Details for the file nanobot_web_console-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nanobot_web_console-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e34d8ec322b20ed7edab123290afb97dadb5ec6934523a6f37c0b865ef685d6f
MD5 d2f88bd3b5ec333f532e459dfc805c5e
BLAKE2b-256 bafc1455c77e6aebee573f22be9a88e85504170c34a5b634d920da1bd83db9ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page