Skip to content

AI Agent Development Console powered by Claude Agent SDK. Build, test, and verify AI agents with Skills, MCP, and CLI integrations using the most capable agent runtime.

Notifications You must be signed in to change notification settings

uukuguy/NanoGridBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

106 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

{πŸ¦‘} NanoGridBot

NanoGridBot - AI Agent Development Console powered by Claude Agent SDK. Build, test, and verify AI agents with Skills, MCP, and CLI integrations using the most capable agent runtime.

δΈ­ζ–‡ζ–‡ζ‘£

Python Version License Code Style

NanoGridBot is a comprehensive agent development platform powered by Claude Agent SDK. It provides the most capable agent runtime with deep Skills, MCP, and CLI integration verification capabilities:

  • πŸ”₯ Claude Agent SDK Powered - Most capable agent runtime with Claude Code
  • πŸ› οΈ Skills & MCP Integration - Verify Skills, MCP servers, and CLI tools in isolated containers
  • πŸ”Œ Model Switching - Via container env vars (ANTHROPIC_MODEL, ANTHROPIC_API_KEY, etc.)
  • πŸ“‘ 8 IM Channels - Test in production-like environments (WhatsApp, Telegram, Slack, Discord, QQ, Feishu, WeCom, DingTalk)
  • ⚑ Interactive Shell - Real-time debugging with session resume capability
  • πŸ› οΈ 5 CLI Modes: serve, shell, run, logs, session

Why NanoGridBot

Feature Traditional Development NanoGridBot
Agent Runtime Manual setup Claude Agent SDK - most powerful capability
Skills/MCP/CLI Hard to test Integrated verification in isolated containers
Debugging Logs + print Interactive shell + Web real-time monitoring
Multi-turn Stateless Session resume + IPC message streaming
Team Collaboration Single agent Claude Agent SDK Teams support

Use Cases

  1. Skills & MCP Verification - Verify Skills, MCP servers, and CLI tools in isolated containers
  2. Interactive Agent Development - Use shell mode for real-time debugging
  3. Agent Behavior Testing - Test agent behavior across 8 IM channels
  4. Feature Prototyping - Use run mode for quick prompt/feature validation
  5. Personal AI Assistant - Deploy with serve mode for daily use
  6. Task Automation - Schedule recurring tasks with built-in scheduler

Table of Contents


Quick Start

Prerequisites

  • Python 3.12+
  • Docker
  • Git

Installation

# Clone repository
git clone https://github.com/yourusername/nanogridbot.git
cd nanogridbot

# Install with uv (recommended)
uv sync

# Build Agent container image
docker build -t nanogridbot-agent:latest container/

# Start service
uv run nanogridbot serve

Five Running Modes

# 1. Serve mode: Start full service with Web dashboard
nanogridbot serve
nanogridbot serve --host 0.0.0.0 --port 8080

# 2. Shell mode: Interactive container session (multi-turn conversation)
nanogridbot shell
nanogridbot shell -g myproject                    # Specify group
nanogridbot shell --resume session-id             # Resume previous session

# 3. Run mode: Single-shot non-interactive execution
nanogridbot run -p "Explain what recursion is"
echo "Your question" | nanogridbot run -p -
nanogridbot run -g myproject -p "Analyze code"    # Specify group
nanogridbot run -g myproject -p "Task" --timeout 60 --env KEY=VALUE

# 4. Logs mode: View and follow logs
nanogridbot logs -n 100           # Show last 100 lines
nanogridbot logs -f               # Follow log output

# 5. Session mode: Manage interactive sessions
nanogridbot session ls            # List sessions
nanogridbot session kill <id>     # Terminate session
nanogridbot session resume <id>   # Show resume info

Architecture

Design Philosophy

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 NanoGridBot Agent Development Platform             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚   β”‚   CLI Tools  β”‚    β”‚ Web Dashboardβ”‚    β”‚    Channels  β”‚   β”‚
β”‚   β”‚(Debug/Test)  β”‚    β”‚ (Status/Logs)β”‚    β”‚(Multi-platformβ”‚   β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚          β”‚                    β”‚                    β”‚           β”‚
β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                               β–Ό                                β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚   β”‚              Core Orchestration Layer                   β”‚   β”‚
β”‚   β”‚   β€’ Message Routing  β€’ Task Scheduling  β€’ Container   β”‚   β”‚
β”‚   β”‚   β€’ Plugin Loading  β€’ Group Queue                     β”‚   β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                               β”‚                               β”‚
β”‚                               β–Ό                               β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚   β”‚              Container Isolation Layer                   β”‚   β”‚
β”‚   β”‚   β€’ Docker Container  β€’ Filesystem Isolation  β€’ IPC  β”‚   β”‚
β”‚   β”‚   β€’ Claude Agent SDK  β€’ Session Management           β”‚   β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Modules

Module Responsibility File
Orchestrator Global state management, message loop, channel coordination core/orchestrator.py
ContainerRunner Container lifecycle, mount configuration core/container_runner.py
ContainerSession Interactive session management, IPC communication core/container_session.py
GroupQueue Concurrency control, message queuing, retry mechanism core/group_queue.py
TaskScheduler Cron/Interval/OneTime task scheduling core/task_scheduler.py
Router Message routing, trigger matching, broadcasting core/router.py
Database SQLite persistence, message cache database/
Channels 8 messaging platform adapters channels/

Architecture Advantages

  • Claude Agent SDK Native Capabilities: Built on Claude Code with Agent Teams, Session Resume, and Transcript Archiving
  • MCP Deep Integration: Configure custom MCP servers via mcpServers, agents can invoke them directly
  • Skills Zero-Threshold Verification: Use shell mode to directly test Skills performance in agents
  • Filesystem Isolation: Each group has independent /workspace/group directory for secure isolation
  • Conversation Persistence: PreCompact Hook automatically archives conversation history
  • IPC Message Streaming: Multi-turn dialogue support with real-time message push to running agents

Container Isolation Design

NanoGridBot borrowed the core container isolation concept from NanoClaw and enhanced it:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Host System (NanoGridBot)                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚              Agent Container (Docker)                β”‚ β”‚
β”‚  β”‚  β€’ Claude Agent SDK                                  β”‚ β”‚
β”‚  β”‚  β€’ Non-root user (node:1000)                        β”‚ β”‚
β”‚  β”‚  β€’ Explicit mounts (whitelist only)                 β”‚ β”‚
β”‚  β”‚  β€’ Network isolation (--network=none)               β”‚ β”‚
β”‚  β”‚  β€’ IPC file watching (follow-up messages)           β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β–²
                              β”‚ JSON via stdin/stdout
                              β”‚ OR IPC files
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Host System (NanoGridBot)                β”‚
β”‚  β€’ Message polling (2s interval)                           β”‚
β”‚  β€’ SQLite state persistence                                β”‚
β”‚  β€’ Group queue (concurrency control)                       β”‚
β”‚  β€’ Task scheduling (Cron)                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Capabilities

Containerized Agent Runtime

  • βœ… Model Switching: Via container env vars (ANTHROPIC_MODEL, ANTHROPIC_API_KEY, etc.)
  • βœ… Container Isolation: Agents run in isolated Docker containers for security
  • βœ… Session Management: Multi-turn dialogue support with session persistence
  • βœ… Context Management: Independent context for different projects/groups
  • βœ… Real-time Monitoring: Web dashboard for Agent status and output
  • βœ… Interactive Debugging: Shell mode for direct Agent conversation

Multi-Channel Deployment (For Testing/Simulation)

8 IM channels enable realistic scenario simulation for agent behavior testing, not the primary development goal.

Channel SDK Status
WhatsApp pywa βœ…
Telegram python-telegram-bot βœ…
Slack python-slack-sdk βœ…
Discord discord.py βœ…
QQ NoneBot2/OneBot βœ…
Feishu lark-oapi βœ…
WeCom httpx βœ…
DingTalk dingtalk-stream βœ…

Extended Features

  • πŸ”Œ Plugin System: Hot-reload plugins, custom processing logic
  • πŸ“Š Web Dashboard: Real-time status, task management, log viewing
  • πŸ”„ Task Scheduling: Cron expressions, interval tasks, one-time tasks
  • πŸ”’ Security Isolation: Mount whitelist, path traversal protection

CLI Tools

Command Reference

# Help
nanogridbot --help

# Version
nanogridbot --version

# Serve mode: Full service with web dashboard
nanogridbot serve                    # Default
nanogridbot serve --host 0.0.0.0  # Custom address
nanogridbot serve --port 9000      # Custom port
nanogridbot serve --debug          # Debug mode

# Shell mode: Interactive container session (multi-turn)
nanogridbot shell                           # Default (group: cli)
nanogridbot shell -g myproject              # Specify group folder
nanogridbot shell --resume session-id      # Resume previous session
nanogridbot shell --attach                  # Attach to container shell

# Run mode: Single-shot non-interactive execution
nanogridbot run -p "Explain what closures are"
echo "Question" | nanogridbot run -p -      # Pipe input
nanogridbot run -g mygroup -p "Task"        # Specify group
nanogridbot run -p "Task" --timeout 60      # Custom timeout
nanogridbot run -p "Task" -e KEY=VALUE      # Environment variables

# Logs mode: View and follow logs
nanogridbot logs -n 100           # Show last 100 lines
nanogridbot logs -f               # Follow log output

# Session mode: Manage interactive sessions
nanogridbot session ls            # List all sessions
nanogridbot session kill <id>     # Terminate a session
nanogridbot session resume <id>   # Show resume info

LLM Parameters

All CLI modes support shared LLM parameters:

--model MODEL              # Model name (default: claude-sonnet-4-20250514)
--max-tokens MAX_TOKENS   # Max tokens (default: 4096)
--temperature TEMP        # Temperature (default: 0.7)
--system SYSTEM           # System prompt
--stream                  # Stream output

Development

Project Structure

nanogridbot/
β”œβ”€β”€ src/nanogridbot/       # Source code
β”‚   β”œβ”€β”€ core/              # Core modules
β”‚   β”‚   β”œβ”€β”€ orchestrator.py
β”‚   β”‚   β”œβ”€β”€ container_runner.py
β”‚   β”‚   β”œβ”€β”€ container_session.py
β”‚   β”‚   β”œβ”€β”€ group_queue.py
β”‚   β”‚   β”œβ”€β”€ task_scheduler.py
β”‚   β”‚   β”œβ”€β”€ router.py
β”‚   β”‚   └── mount_security.py
β”‚   β”œβ”€β”€ database/           # Database layer
β”‚   β”œβ”€β”€ channels/          # Messaging channels
β”‚   β”œβ”€β”€ plugins/           # Plugin system
β”‚   β”œβ”€β”€ web/               # Web dashboard
β”‚   └── cli.py             # CLI entry
β”œβ”€β”€ container/             # Agent container
β”œβ”€β”€ tests/                 # Tests
β”œβ”€β”€ docs/                  # Documentation
└── data/                  # Runtime data

Development Commands

# Run tests
pytest -xvs

# Coverage report
pytest --cov=src --cov-report=html

# Code formatting
black . && isort .

# Type checking
mypy src/

# Linting
ruff check .

Create Plugin

# plugins/my_plugin/plugin.py
from nanogridbot.plugins.base import Plugin

class MyPlugin(Plugin):
    @property
    def name(self) -> str:
        return "my_plugin"

    async def on_message_received(self, message):
        # Process message
        return message

Deployment

Docker Deployment

# Build image
docker-compose build

# Start service
docker-compose up -d

# View logs
docker-compose logs -f

# Stop service
docker-compose down

Production Configuration

  1. Configure environment variables
  2. Set mount whitelist
  3. Configure reverse proxy (Nginx)
  4. Enable HTTPS
  5. Configure monitoring alerts

Documentation

Design Documents

User Documents

Testing Documents


Acknowledgments

  • NanoClaw - Source of container isolation inspiration
  • Expanded from "messaging bot" to "agent development platform"
  • FastAPI - Web framework
  • Pydantic - Data validation

License

MIT License - See LICENSE file.


Version: v0.1.0-alpha

Last Updated: 2026-02-16

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •