dart_agent_core
2.1.9, released 3 weeks ago by an unverified publisher
Mobile-first Dart library for building stateful, tool-using AI agents with LLM and MCP support.
What it does
Provides a full agentic loop supporting tool usage, state persistence, multi-turn memory, context compression, and Model Context Protocol (MCP) connections. It coordinates mainstream LLM providers entirely in Dart without requiring a backend.
AI-written summary of version 2.1.9, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to build stateful AI agents directly inside a Flutter mobile, web, or desktop application.
- You need multi-provider LLM support with tool calling and context compression.
- You want to connect local or remote Model Context Protocol (MCP) servers.
Skip it when
- You only need a simple stateless text completion without tool calling or agentic loops.
- You prefer running agent orchestration entirely on a Python or Node.js backend rather than on-device.
Strengths
- Runs natively on all six Dart/Flutter platforms including Web and WASM.
- Unified LLMClient interface supporting OpenAI, Gemini, Anthropic Claude, Bedrock, and various compatible APIs.
- Comprehensive feature set including tool execution, sub-agents, planning, MCP, and agent evals.
Weaknesses
- Requires proper API key management on client platforms like the web.
- File system storage features require specific platform adapters when deployed on the web.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 8
Add the dependency to pubspec.yaml and configure your provider API keys or local base URLs.
import 'package:dart_agent_core/dart_agent_core.dart';
void main() async {
final client = OpenAIClient(apiKey: 'YOUR_API_KEY');
final agent = StatefulAgent(
name: 'assistant',
client: client,
modelConfig: ModelConfig(model: 'gpt-4o-mini'),
state: AgentState.empty(),
);
final responses = await agent.run([UserMessage.text('Hello!')]);
print((responses.last as ModelMessage).textOutput);
}Alternatives
Packages that do the same job and could replace dart_agent_core.
- agenix
Flutter framework for building AI agents with tools and multi-agent orchestration
60Compare - dart_mcp_server
An MCP server for Dart projects, exposing developer tools to AI models.
82Compare - genkit_llamadart
Genkit Dart plugin for local AI through llamadart: GGUF, LiteRT-LM, chat, tool calling, and embeddings
81Compare - nobodywho
Run local LLMs, vision, embeddings, RAG, tool calling, STT, and TTS on mobile and desktop.
80Compare
Works with
Packages commonly used together with dart_agent_core: ones it builds on, ones built on it, and its own family.
- cryptodart_agent_core depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- uuiddart_agent_core depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- loggingdart_agent_core depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- diodart_agent_core depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- mcp_dartdart_agent_core depends on itDart and Flutter SDK for building Model Context Protocol clients, servers, and AI tools.
- aws_signature_v4dart_agent_core depends on itDart implementation of AWS Signature Version 4 for signing HTTP requests.