{"id":45968612,"url":"https://github.com/yukihamada/nanobot","last_synced_at":"2026-02-28T14:32:33.015Z","repository":{"id":336974940,"uuid":"1151886301","full_name":"yukihamada/nanobot","owner":"yukihamada","description":"AI Agent Platform built in Rust — Multi-model, MCP tools, 14+ channel integrations. Self-host or use teai.io","archived":false,"fork":false,"pushed_at":"2026-02-22T16:05:35.000Z","size":28567,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-22T18:52:39.727Z","etag":null,"topics":["agent","ai","ai-agent","anthropic","chatbot","claude","lambda","line-bot","llm","mcp","openai","rust","serverless","telegram-bot"],"latest_commit_sha":null,"homepage":"https://teai.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yukihamada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-07T03:11:50.000Z","updated_at":"2026-02-22T16:05:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yukihamada/nanobot","commit_stats":null,"previous_names":["yukihamada/nanobot"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yukihamada/nanobot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukihamada%2Fnanobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukihamada%2Fnanobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukihamada%2Fnanobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukihamada%2Fnanobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yukihamada","download_url":"https://codeload.github.com/yukihamada/nanobot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukihamada%2Fnanobot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29937391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","ai-agent","anthropic","chatbot","claude","lambda","line-bot","llm","mcp","openai","rust","serverless","telegram-bot"],"created_at":"2026-02-28T14:32:32.527Z","updated_at":"2026-02-28T14:32:33.000Z","avatar_url":"https://github.com/yukihamada.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# nanobot\n\n**A production-grade AI agent platform written in pure Rust.**\n\nOne binary. Six channels. Fifty tools. Zero cold-start drama.\n\n[![CI](https://github.com/yukihamada/nanobot/actions/workflows/ci.yml/badge.svg)](https://github.com/yukihamada/nanobot/actions/workflows/ci.yml)\n[![Deploy](https://github.com/yukihamada/nanobot/actions/workflows/deploy.yml/badge.svg)](https://github.com/yukihamada/nanobot/actions/workflows/deploy.yml)\n[![Rust](https://img.shields.io/badge/Rust-1.75+-dea584?logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Release](https://img.shields.io/github/v/release/yukihamada/nanobot?color=green)](https://github.com/yukihamada/nanobot/releases)\n[![Stars](https://img.shields.io/github/stars/yukihamada/nanobot?style=social)](https://github.com/yukihamada/nanobot/stargazers)\n\n[Live Demo](https://chatweb.ai) \u0026middot; [API Docs](https://teai.io) \u0026middot; [Report Bug](https://github.com/yukihamada/nanobot/issues)\n\n\u003c/div\u003e\n\n---\n\nnanobot is a self-hostable, multi-channel AI assistant that ships as a single Rust binary. It connects to **8+ LLM providers** with automatic failover, exposes **50+ agentic tools**, and deploys to AWS Lambda for pennies. It powers [chatweb.ai](https://chatweb.ai) and [teai.io](https://teai.io) in production today.\n\n## Why nanobot?\n\n| | nanobot | Typical agent frameworks |\n|---|---|---|\n| **Language** | Rust (axum) | Python / TypeScript |\n| **Cold start** | \u003c 50 ms on Lambda ARM64 | 3-10 s |\n| **Binary** | ~9 MB stripped | Hundreds of MB + runtime |\n| **Channels** | Web, LINE, Telegram, Discord, Slack, Facebook | Usually 1-2 |\n| **LLM failover** | Automatic round-robin + circuit breaker | Manual config |\n| **Voice** | Built-in STT + TTS | External service required |\n| **Self-host** | Single binary, zero dependencies | Docker + DB + queue + ... |\n| **License** | MIT | Varies |\n\n---\n\n## Architecture\n\n```\n                         +------------------+\n                         |   Your users     |\n                         +--------+---------+\n                                  |\n            +----------+----------+----------+----------+\n            |          |          |          |          |\n          Web       LINE    Telegram    Discord    Slack ...\n            |          |          |          |          |\n            +----------+----------+----------+----------+\n                                  |\n                       +----------v----------+\n                       |   API Gateway /     |\n                       |   Reverse Proxy     |\n                       +----------+----------+\n                                  |\n                       +----------v----------+\n                       |     nanobot         |\n                       |  (single binary)    |\n                       |                     |\n                       |  +-- Auth \u0026 Credits |\n                       |  +-- Agentic Loop   |\n                       |  +-- Tool Runtime   |\n                       |  +-- STT / TTS      |\n                       |  +-- Memory Engine  |\n                       +----+------+----+----+\n                            |      |    |\n               +------------+   +--+    +------------+\n               |                |                    |\n        +------v------+  +-----v------+  +---------v---------+\n        | LLM Providers|  |  DynamoDB  |  |   External APIs   |\n        | (8+ w/ fail- |  | (sessions, |  | (Brave, Jina,     |\n        |  over)       |  |  memory,   |  |  OpenAI TTS, ...) |\n        +--------------+  |  credits)  |  +-------------------+\n                          +------------+\n```\n\n---\n\n## Features\n\n### Multi-LLM with Automatic Failover\n\nnanobot doesn't lock you into a single provider. Configure multiple API keys and it handles the rest -- round-robin load balancing, circuit breakers, and transparent failover across providers.\n\n| Provider | Models | Notes |\n|----------|--------|-------|\n| **OpenRouter** | 100+ models | Aggregator -- single key, all models |\n| **Anthropic** | Claude Opus / Sonnet / Haiku | Recommended for reasoning |\n| **OpenAI** | GPT-4o, o4-mini | Broad tool support |\n| **Google** | Gemini 2.5 Pro / Flash | Free tier available |\n| **DeepSeek** | DeepSeek-V3 | Strong at code |\n| **Moonshot** | Kimi-K2.5 | Long context |\n| **Qwen** | Qwen-Max, Qwen-Plus | Alibaba Cloud |\n| **MiniMax** | MiniMax-M2.5 | Fast inference |\n\nTiered model selection (economy / normal / powerful) lets you balance cost and quality per request.\n\n### 50+ Built-in Tools\n\nAgentic mode executes multi-step tool chains automatically. Free users get 1 iteration; Pro users get up to 5 with parallel tool execution.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCore (always available)\u003c/strong\u003e\u003c/summary\u003e\n\n| Tool | Description |\n|------|-------------|\n| `web_search` | Brave / Bing / Jina 3-tier fallback |\n| `web_fetch` | Jina Reader for JS-heavy pages |\n| `browser` | CSS selector queries, screenshots, forms |\n| `code_execute` | Sandboxed shell execution |\n| `calculator` | Arbitrary math expressions |\n| `weather` | Global weather data |\n| `wikipedia` | Encyclopedia lookup |\n| `translation` | Multi-language translation |\n| `datetime` | Time zones, date math |\n| `qr_code` | QR code generation |\n| `file_read` / `file_write` / `file_list` | Workspace file operations |\n| `filesystem` | Glob find + regex grep |\n| `csv_analysis` | Summary, filter, aggregate |\n| `image_generate` | DALL-E image generation |\n| `music_generate` | Suno API |\n| `video_generate` | Kling API |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eIntegrations (API key required)\u003c/strong\u003e\u003c/summary\u003e\n\n| Tool | Description |\n|------|-------------|\n| `github` | Read/write files, create PRs |\n| `gmail` | Send and search email |\n| `google_calendar` | Event management |\n| `slack` | Post and search messages |\n| `discord` | Channel messaging |\n| `notion` | Page and database queries |\n| `spotify` | Playback control, search |\n| `postgresql` | Direct SQL queries |\n| `youtube_transcript` | Video transcript extraction |\n| `arxiv_search` | Academic paper search |\n| `news_search` | News aggregation |\n| `webhook` | Trigger arbitrary webhooks |\n| `phone_call` | Amazon Connect integration |\n| `web_deploy` | One-click static site deploy |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDeveloper tools (CLI / workspace mode)\u003c/strong\u003e\u003c/summary\u003e\n\n| Tool | Description |\n|------|-------------|\n| `git_status` | Working tree status |\n| `git_diff` | Staged/unstaged diffs |\n| `git_commit` | Commit with message |\n| `run_linter` | Clippy / ESLint / etc. |\n| `run_tests` | Run project test suite |\n\n\u003c/details\u003e\n\n### Skill Marketplace\n\nUsers can publish and install custom skills:\n\n- **Prompt skills** -- inject system prompts for specialized personas or domain knowledge\n- **Tool skills** -- expose any HTTPS endpoint as an LLM-callable tool via webhook\n\nSkills are stored in DynamoDB and loaded at chat time. No redeploy required.\n\n### Multi-Channel\n\nOne codebase serves all channels. Conversations sync across them.\n\n| Channel | Status | Optimizations |\n|---------|--------|---------------|\n| **Web** (SPA) | Production | Voice-first UI, SSE streaming, auto-TTS |\n| **LINE** | Production | 200-char responses, emoji, bullet points |\n| **Telegram** | Production | 300-char responses, Markdown formatting |\n| **Facebook Messenger** | Production | 300-char concise replies |\n| **Discord** | Production | Webhook integration |\n| **Slack** | Production | Bot token integration |\n\n### Voice-First\n\n- **STT**: Web Speech API (browser-side, zero server cost)\n- **TTS**: OpenAI `tts-1` with response caching\n- **Auto-TTS**: Voice input triggers automatic voice output\n- Push-to-talk UI with visual feedback\n\n### Long-Term Memory\n\nTwo-layer auto-consolidation inspired by [OpenClaw](https://github.com/openclaw/openclaw):\n\n```\nSession context (20 messages)\n        |\n        v\nDaily log (auto-appended after each conversation)\n        |\n        v\nLong-term memory (consolidated summaries)\n```\n\nMemory persists across channels and sessions via DynamoDB.\n\n### A/B Testing Framework\n\nBuilt-in CRO experimentation:\n\n- Deterministic variant assignment (`hash(uid + testId) % N`)\n- Event tracking via `POST /api/v1/ab/event`\n- Aggregated stats with 90-day TTL\n- No external analytics dependency\n\n---\n\n## Quick Start\n\n### Try the hosted API (no setup)\n\n```bash\ncurl -X POST https://chatweb.ai/api/v1/chat \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"message\": \"What can you do?\", \"session_id\": \"demo\"}'\n```\n\n### Run locally\n\n```bash\ngit clone https://github.com/yukihamada/nanobot.git\ncd nanobot\n\n# Set at least one provider key\nexport ANTHROPIC_API_KEY=sk-ant-...\n# or: export OPENAI_API_KEY=sk-...\n# or: export OPENROUTER_API_KEY=sk-or-...\n\n# Build and run the web gateway\ncargo build --bin chatweb\n./target/debug/chatweb gateway --http --http-port 3000\n# Open http://localhost:3000\n```\n\n### Docker\n\n```bash\ndocker run -p 3000:3000 \\\n  -e OPENAI_API_KEY=sk-... \\\n  ghcr.io/yukihamada/nanobot\n```\n\n### CLI usage\n\n```bash\n# Interactive agent mode (uses your local API keys directly)\n./target/debug/chatweb agent\n\n# Single-shot message\n./target/debug/chatweb agent -m \"Summarize today's tech news\"\n\n# Check configuration\n./target/debug/chatweb status\n\n# Install globally\ncargo install --path .\nchatweb agent\n```\n\n### Deploy to AWS Lambda\n\n```bash\n# Prerequisites\nbrew install zig \u0026\u0026 cargo install cargo-zigbuild\nrustup target add aarch64-unknown-linux-musl\n\n# Build for Lambda ARM64 (must use musl, not gnu)\ncargo zigbuild --manifest-path crates/nanobot-lambda/Cargo.toml \\\n  --release --target aarch64-unknown-linux-musl\n\n# Or use the deploy script\nLAMBDA_FUNCTION_NAME=nanobot-prod ./infra/deploy-fast.sh\n```\n\n---\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `ANTHROPIC_API_KEY` | One of these | Claude models |\n| `OPENAI_API_KEY` | | GPT-4o and TTS |\n| `OPENROUTER_API_KEY` | | 100+ models via single key |\n| `GOOGLE_API_KEY` | | Gemini models |\n| `DEEPSEEK_API_KEY` | | DeepSeek-V3 |\n| `LINE_CHANNEL_SECRET` | For LINE | LINE Messaging API |\n| `TELEGRAM_BOT_TOKEN` | For Telegram | Telegram Bot API |\n| `STRIPE_SECRET_KEY` | For billing | Stripe integration |\n| `NANOBOT_WORKSPACE` | No | Workspace directory (default: `~/.nanobot/workspace`) |\n\n---\n\n## API Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `POST` | `/api/v1/chat` | Send a message, get a response |\n| `POST` | `/api/v1/chat/stream` | SSE streaming response |\n| `POST` | `/api/v1/chat/race` | Multi-model race (economy/normal/powerful) |\n| `POST` | `/api/v1/chat/explore` | Parallel execution across all models |\n| `POST` | `/api/v1/speech/synthesize` | Text-to-speech |\n| `GET`  | `/api/v1/auth/me` | Current user info |\n| `GET`  | `/api/v1/skills` | Browse skill marketplace |\n| `POST` | `/api/v1/skills/publish` | Publish a custom skill |\n| `POST` | `/api/v1/coupon/redeem` | Apply coupon code |\n| `POST` | `/webhooks/line` | LINE webhook |\n| `POST` | `/webhooks/telegram` | Telegram webhook |\n| `POST` | `/webhooks/stripe` | Stripe webhook |\n\n---\n\n## System Requirements\n\n| | Minimum | Recommended |\n|---|---------|-------------|\n| **CPU** | 1 core | 2+ cores |\n| **RAM** | 128 MB | 512 MB |\n| **Disk** | 20 MB | 100 MB |\n\n**Platforms**: Linux (x86_64, ARM64), macOS (Apple Silicon, Intel), Windows (WSL2), AWS Lambda (ARM64)\n\n---\n\n## Security\n\n- **Sandboxed execution** -- tool code runs in isolated `/tmp/sandbox/{session_id}/`\n- **HMAC-SHA256 password hashing** with configurable keys\n- **Rate limiting** -- 5 login attempts/min, 3 registrations/min\n- **Webhook signature verification** -- Telegram, Facebook, Stripe\n- **Audit logging** -- 90-day TTL in DynamoDB\n- **CORS whitelist** -- only configured origins allowed\n\nSee [SECURITY.md](SECURITY.md) for vulnerability reporting.\n\n---\n\n## Roadmap\n\n- [x] Multi-model failover with circuit breakers\n- [x] Voice-first UI (STT + TTS)\n- [x] 6 channel integrations (Web, LINE, Telegram, Discord, Slack, Facebook)\n- [x] 50+ built-in tools with agentic loop\n- [x] Skill marketplace (publish and install custom tools)\n- [x] A/B testing framework\n- [x] Stripe billing integration\n- [x] Long-term memory engine\n- [x] SSE streaming\n- [ ] WebSocket transport (Q2 2026)\n- [ ] Multi-agent orchestration (Q2 2026)\n- [ ] On-device LLM inference via GGUF (Q3 2026)\n\n---\n\n## Project Structure\n\n```\nnanobot/\n  crates/\n    nanobot-core/         Core library: handlers, tools, providers, memory\n    nanobot-lambda/       AWS Lambda entrypoint\n  nanobot-cli/            CLI binary\n  web/\n    index.html            Web SPA (embedded into binary via include_str!)\n    skill.html            Skill marketplace UI\n    pricing.html          Pricing page\n  infra/\n    deploy-fast.sh        One-command Lambda deploy\n    template.yaml         SAM template\n```\n\n---\n\n## Contributing\n\n```bash\ngit clone https://github.com/YOUR_USERNAME/nanobot.git\ncd nanobot\ncargo test --all\ncargo clippy --all-targets\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n---\n\n## License\n\n[MIT](LICENSE) -- Copyright (c) 2025-2026 nanobot contributors\n\n---\n\n## Acknowledgments\n\n- [HKUDS/nanobot](https://github.com/HKUDS/nanobot) -- original Python nanobot (this project is a complete Rust rewrite)\n- [axum](https://github.com/tokio-rs/axum), [tokio](https://tokio.rs/), [serde](https://serde.rs/) -- the Rust ecosystem that makes this possible\n- Anthropic, OpenAI, Google -- LLM providers\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**[chatweb.ai](https://chatweb.ai)** -- voice-first AI assistant \u0026middot; **[teai.io](https://teai.io)** -- developer API\n\nBoth powered by nanobot.\n\n[![Star History Chart](https://api.star-history.com/svg?repos=yukihamada/nanobot\u0026type=Date)](https://star-history.com/#yukihamada/nanobot\u0026Date)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukihamada%2Fnanobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyukihamada%2Fnanobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukihamada%2Fnanobot/lists"}