Skip to content
pubscout

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.

WASM-ready
$ flutter pub add dart_agent_core
Source repository

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

  • dart_mcp_server

    An MCP server for Dart projects, exposing developer tools to AI models.

  • genkit_llamadart

    Genkit Dart plugin for local AI through llamadart: GGUF, LiteRT-LM, chat, tool calling, and embeddings

  • nobodywho

    Run local LLMs, vision, embeddings, RAG, tool calling, STT, and TTS on mobile and desktop.

Works with

Packages commonly used together with dart_agent_core: ones it builds on, ones built on it, and its own family.