How zaws77/nanobot works
Project Type & Purpose
• This is an open-source, CLI-based “ultra-lightweight personal AI assistant”
• Core functionality lives in a Python package (nanobot/), with a small TypeScript “bridge” (bridge/) for WhatsApp Web integration
• It provides:
• A CLI (nanobot gateway, nanobot agent, etc.)
• Pluggable channel adapters (Telegram, Discord, Slack, Email, QQ, Feishu, DingTalk, WhatsApp, etc.)
• A provider registry for LLM backends (OpenRouter, OpenAI, Claude, vLLM, etc.)
• Tools/skills (filesystem, shell, cron jobs, web search, GitHub, weather, tmux, etc.)
• Scheduling (cron), heartbeat (periodic wake-ups), memory & session management
File Structure Analysis
• Top level:
• Dockerfile, .dockerignore / .gitignore, CLI entry (pyproject.toml), tests, workspace docs
• bridge/: TypeScript service to connect WhatsApp → Python (Node.js ≥18, uses bridge/src/{index,server,whatsapp}.ts)
• nanobot/: Python package
• Inside nanobot/:
├── cli/ (Typer/argparse commands)
├── config/ (Pydantic schemas, loader)
├── session/ (Session manager)
├── bus/ (Event bus & queue)
├── channels/ (One module per chat platform + manager)
├── providers/ (Base classes + registry + built-in providers)
├── agent/ (Core agent logic: prompt context, loop, memory, subagents, tools)
├── skills/ (Bundled skill definitions)
├── cron/ (Scheduled jobs service)
├── heartbeat/ (Periodic wake-up service)
└── utils/ (Helpers)
• Config & workspace in ~/.nanobot/ (~/config.json, workspaces, memory)
• Tests validate channels, tools, Docker behavior
README Insights
• Emphasizes plug-in registry patterns (channels, providers, tools)
• Shows Docker and local vLLM support