Overview
The nanobot configuration system is built on Pydantic, providing type-safe configuration with automatic validation. All configuration models support bothcamelCase and snake_case keys, making them flexible for different configuration formats.
Root Configuration
Config
The root configuration object for nanobot.Agent configuration settings. See AgentsConfig.
Chat channel configuration. See ChannelsConfig.
LLM provider configuration. See providers documentation.
Gateway/server configuration. See GatewayConfig.
Tools configuration. See ToolsConfig.
Environment Variables
All configuration can be set via environment variables using the prefixNANOBOT_ with double underscores for nesting:
Agent Configuration
AgentsConfig
Default agent configuration settings.
AgentDefaults
Default settings applied to all agents.Default workspace directory for agent operations.
Default LLM model to use. Can include provider prefix (e.g.,
anthropic/claude-opus-4-5, openai/gpt-4).Provider name (e.g.,
anthropic, openrouter) or auto for automatic detection based on model name.Maximum tokens for model responses.
Sampling temperature for model responses (0.0-2.0).
Maximum number of tool call iterations per conversation turn.
Number of recent messages to keep in conversation memory.
Enables LLM thinking mode. Options:
low, medium, high, or null to disable.Gateway Configuration
GatewayConfig
HTTP server and gateway settings.Host address to bind the server to.
Port number for the gateway server.
Heartbeat service configuration.
HeartbeatConfig
Enable heartbeat monitoring service.
Heartbeat interval in seconds (default: 30 minutes).
Tools Configuration
ToolsConfig
Configuration for agent tools and capabilities.Web-related tools configuration.
Shell execution tool configuration.
If
true, restrict all tool file access to the workspace directory only.MCP (Model Context Protocol) server configurations. Keys are server names.
WebToolsConfig
HTTP/SOCKS5 proxy URL for web tools (e.g.,
http://127.0.0.1:7890 or socks5://127.0.0.1:1080).Web search configuration.
WebSearchConfig
Brave Search API key for web search functionality.
Maximum number of search results to return.
ExecToolConfig
Command execution timeout in seconds.
Additional paths to append to PATH environment variable during execution.
MCPServerConfig
Configuration for MCP (Model Context Protocol) server connections.Connection type. Auto-detected if omitted.
Command to run for stdio connections (e.g.,
npx).Command-line arguments for stdio connections.
Extra environment variables for stdio connections.
Endpoint URL for HTTP/SSE connections.
Custom HTTP headers for HTTP/SSE connections.
Tool call timeout in seconds.
Complete Example
Validation
All configuration is validated using Pydantic:- Type checking: Ensures all values match expected types
- Default values: Automatically applies defaults for missing fields
- Custom validators: Enforces business rules and constraints
- Case flexibility: Accepts both camelCase and snake_case keys