Flint AI gives Flint Dart applications a complete AI layer: chat providers, agents, tools, workflows, memory, trace events, database persistence, and production tool policies.
Use it when you want AI features that are part of your real application, not a separate script. A support agent can read a ticket, call a safe tool, draft a reply, store the thread, and leave a trace that staff can review later.
What You Build
A typical Flint AI feature has these layers:
Providers connect to OpenAI, Gemini, Anthropic, or another chat API.
Agents receive a goal and create a plan.
Tools perform controlled work such as summarizing data, drafting content, creating reports, queueing email, or calling internal services.
Workflows run named reusable operations without needing a full agent plan.
Memory and repository adapters store runs, trace events, threads, and artifacts.
Flint Dart adapters expose everything through app.ai and ctx.ai.
Agents should not perform side effects directly. Put side effects inside tools so Flint can authorize and trace them.
Create A Tool
Tools are the side-effect boundary. They can read arguments, access the current user and tenant ids, use metadata, and return structured JSON-like data.
CodeBlockdart
class SupportSummaryTool extends AiTool {
@override
String get name => 'support.summary';
@override
String get description => 'Summarizes a support issue and drafts a reply.';
@override
Set<String> get requiredCapabilities => const {'support:write'};
@override
Future<Map<String, dynamic>> execute(AiToolContext context) async {
final issue = context.arguments['issue']?.toString().trim() ?? '';
final priority = context.arguments['priority']?.toString() ?? 'normal';
return {
'category': issue.toLowerCase().contains('login')
? 'account_access'
: 'general_support',
'summary': '[$priority] $issue',
'draft':
'Thank you for reaching out. We have reviewed this request and will follow up with the next steps.',
'recommendedActions': [
'review customer account',
'confirm details',
'send response',
],
};
}
}
AI agents should not be allowed to run every tool. Use production policy when tools can send messages, update records, publish content, delete data, charge money, issue refunds, or call external services.
The standalone flint_ai package defaults to in-memory stores. Flint Dart adds database-backed adapters and uses them for app.ai.
CodeBlockdart
final app = Flint();
app.ai.memoryStore; // FlintAutoAiMemoryStore
app.ai.repository; // FlintAutoAiRepository
The auto stores use the Flint database when it is connected. If the database is not connected, or the AI tables have not been migrated yet, they fall back to in-memory stores and log a warning.
For explicit production wiring:
CodeBlockdart
final ai = FlintAi.production(
memoryStore: FlintAutoAiMemoryStore(),
repository: FlintAutoAiRepository(),
);
Register AI Tables
Register the AI table definitions in lib/config/table_registry.dart:
The Flint Dart sample app includes real AI runtime examples:
POST /ai-demo/support
GET /ai-demo/reporting
POST /ai-demo/content-email
The Eulogia app uses the same pattern under:
POST /api/ai-agents/support
POST /api/ai-agents/reporting
POST /api/ai-agents/content-email
Those endpoints are staff-protected, use ctx.ai, pass role/capability metadata, and store run events through the Flint AI memory and repository adapters.
Flint EcosystemThe Unified Dart Technology Stack
One language powering Full-Stack Web, Cross-Platform Clients, Native AI, and Connected Robotics.