A standalone Dart port of NanoBot, an ultra-lightweight AI agent framework.
- π§ Universal Agent: Works with any LLM (Anthropic, OpenAI, OpenRouter, Local).
- π οΈ Tool System: Type-safe tool definitions and execution.
- πΎ Memory: Markdown-based daily notes and long-term memory.
- π Sessions: Persistent conversation history (JSONL).
- π Skills: Drop-in skill modules (
SKILL.md). - π± Cross-Platform: Designed for Flutter (Mobile/Desktop/Web) and Dart CLI.
Add to your pubspec.yaml:
# From local path (during development)
dependencies:
nanobot_dart:
path: ../nanobot_dart
# Or from Git
dependencies:
nanobot_dart:
git:
url: https://github.com/ChipCreates/nanobot_dart
ref: mainimport 'package:nanobot_dart/nanobot_dart.dart';
void main() async {
// 1. Configure
final config = Config(
agents: AgentsConfig(
defaults: AgentDefaults(
model: 'anthropic/claude-3.5-sonnet',
workspace: '~/.nanobot',
),
),
providers: ProvidersConfig(
anthropic: ProviderConfig(apiKey: 'your-api-key'),
),
);
// 2. Initialize Agent
final agent = NanoAgent(
config: config,
provider: AnthropicProvider(apiKey: config.apiKey!),
);
// 3. Process Message
final response = await agent.process(InboundMessage(
content: 'Hello, world!',
channel: 'cli',
chatId: 'general',
));
print(response.content);
}nanobot_dart follows the Python reference architecture:
lib/
βββ src/
β βββ agent/ # AgentLoop, NanoAgent, Tools
β βββ config/ # Configuration loading
β βββ bus/ # Message bus & events
β βββ providers/ # LLM provider implementations
β βββ session/ # Session management
β βββ skills/ # Skill loading & registry
βββ nanobot_dart.dart # Main exports
MIT License.
Based on NanoBot by the vLLM project.