{"slug": "genkit-dart-1-0-build-production-ready-agentic-apps-with-dart-and-flutter", "title": "Genkit Dart 1.0: Build production-ready agentic apps with Dart and Flutter", "summary": "Google released Genkit Dart 1.0, the first stable, production-ready version of its open-source framework for building AI-powered features and agentic workflows in Dart and Flutter, available by adding the `genkit` package via `dart pub add genkit`. The framework provides a unified API across Google Gemini, Anthropic Claude, OpenAI, and OpenAI-compatible models, plus strongly typed \"flows\" using the `schemantic` package that share schemas between backend and Flutter app, and an agent skill installable with `npx skills add genkit-ai/skills` for coding assistants including Antigravity, Claude Code, and Codex.", "body_md": "# Announcing Genkit Dart 1.0: Build production-ready agentic apps with Dart and Flutter\n\nAnnouncing the stable 1.0 release of Genkit Dart, an open-source framework for building AI-powered features and agentic workflows with Dart and Flutter.\n\n              Dart and Flutter let you build high-quality apps for mobile, web, and desktop\n              from a single codebase. With\n              [Genkit Dart](https://genkit.dev/docs/dart/get-started/), you can bring that\n              same productivity to full-stack, agentic apps.\n            \n\n              Today, we're announcing **Genkit Dart 1.0**, the first stable, production-ready\n              release of Google's open-source framework for building AI-powered features and\n              agents in Dart. Since our\n              [preview launch](https://dart.dev/blog/announcing-genkit-dart-build-full-stack-ai-apps-with-dart-and-flutter)\n              \n              earlier this year, feedback from the Dart and Flutter community has helped us\n              refine the APIs and expand the toolkit for production workloads.\n            \n\nTo get started, add `genkit` to your project:\n\n```\ndart pub add genkit\n```\n\nYou can also install the agent skill to give AI coding assistants like Antigravity, Claude Code, and Codex up-to-date knowledge of Genkit Dart APIs and best practices:\n\n```\nnpx skills add genkit-ai/skills\n```\n\n## Why Genkit Dart\n\nGenkit provides a unified API across model providers, end-to-end type safety between your server and client, and local tooling to test and debug your AI workflows.\n\n### Use any model with one API\n\nGenkit supports Google Gemini, Anthropic Claude, OpenAI, and OpenAI-compatible models through a single interface. You register model providers as plugins and can switch between models without rewriting your application logic:\n\n```\nfinal ai = Genkit(plugins: [googleAI(), anthropic()]);\nfinal prompt = 'Suggest a weekend getaway from San Francisco.';\n​\nfinal fromGemini = await ai.generate(\n  model: googleAI.gemini('gemini-flash-latest'),\n  prompt: prompt,\n);\n​\nfinal fromClaude = await ai.generate(\n  model: anthropic.model('claude-sonnet-5-5'),\n  prompt: prompt,\n);\n```\n\n### End-to-end type safety with flows\n\n              Genkit lets you wrap your AI logic into **flows**: strongly typed, observable\n              functions that are easy to test and deploy as HTTP endpoints. Using the\n              [`schemantic`](https://pub.dev/packages/schemantic) package, you can define\n              your data schemas once in Dart, generate structured output from the model, and\n              share those exact types between your backend and your Flutter app:\n            \n\n```\n// shared/lib/models.dart (used by both server and app)\n@Schema()\nabstract class $TripRequest {\n  String get destination;\n  int get days;\n}\n// ...plus an Itinerary schema for the result.\n​\n// server/bin/server.dart\nfinal planTrip = ai.defineFlow(\n  name: 'planTrip',\n  inputSchema: TripRequest.$schema,\n  outputSchema: Itinerary.$schema,\n  fn: (request, _) async {\n    final response = await ai.generate(\n      model: googleAI.gemini('gemini-flash-latest'),\n      prompt: 'Plan a ${request.days}-day trip to ${request.destination}.',\n      outputSchema: Itinerary.$schema,\n    );\n    return response.output!;\n  },\n);\nawait (GenkitRouter()..addAction(planTrip)).serve(port: 8080); // POST /planTrip\n​\n// app/lib/main.dart\nfinal planTrip = defineRemoteAction(\n  url: 'https://api.example.com/planTrip', // Your Genkit endpoint\n  inputSchema: TripRequest.$schema,\n  outputSchema: Itinerary.$schema,\n);\nfinal itinerary = await planTrip(\n  input: TripRequest(destination: 'Kyoto', days: 5),\n);\n```\n\n### Run anywhere Dart runs\n\nBecause your AI logic is written in standard Dart, you get fast iteration with hot reload and the flexibility to run your code wherever it fits your architecture:\n\n- \n**Directly in Flutter:** Call models straight from your app for rapid\n                prototyping or bring-your-own-key experiences (never embed private API keys\n                in a published client app).\n- \n**On a Dart server:** Run complex flows and keep sensitive prompts on the\n                backend, then call them from Flutter using`defineRemoteAction` as shown\n                above.\n- \n**In Flutter with remote models:** Keep your AI logic in the Flutter app\n                while routing model requests through a lightweight Genkit backend that\n                protects your API keys and enforces authorization:\n\n```\n// server/bin/server.dart\nfinal genkit = GenkitRouter()\n  ..addAction(\n    googleAI().model('gemini-flash-latest'),\n    path: '/gemini',\n    // Runs before the model; throw a GenkitException to reject the request.\n    contextProvider: (request) async =>\n        {'user': await verifyUser(request.headers['authorization'])},\n  );\nawait genkit.serve(port: 8080);\n​\n// app/lib/main.dart\nfinal ai = Genkit();\nfinal gemini = ai.defineRemoteModel(\n  name: 'gemini',\n  url: 'https://api.example.com/gemini',\n  headers: (context) async => {'Authorization': 'Bearer ${await getIdToken()}'},\n);\nfinal response = await ai.generate(\n  model: gemini,\n  prompt: 'Suggest a packing list for Kyoto in April.',\n);\n```\n\n### Test and debug with the Developer UI\n\nGenkit includes a local Developer UI for testing flows, experimenting with prompts, and inspecting execution traces step by step. Launch it alongside your Dart process using the Genkit CLI:\n\n```\ngenkit start -- dart run bin/server.dart\n```\n\n## Built for agentic workflows\n\nSince the preview launch, we've expanded Genkit Dart with capabilities designed for multi-step agentic workflows, including human-in-the-loop interrupts, generation middleware, prompt management, and production telemetry.\n\n### Give models tools with human-in-the-loop interrupts\n\n              Tools let models call your Dart functions to fetch data or trigger actions,\n              like searching for flights or booking a hotel. When an action requires user\n              confirmation, a tool can pause the generation loop by returning\n              `.interrupt(...)` instead of `.response(...)`:\n            \n\n```\nfinal bookHotel = ai.defineTool(\n  name: 'bookHotel',\n  description: 'Books a hotel room for the user.',\n  inputSchema: HotelBooking.$schema,\n  fn: (input, ctx) async {\n    // Ask the user to confirm before charging their card.\n    if (ctx.resumed == null) {\n      return .interrupt({'hotel': input.hotelName, 'total': input.totalPrice});\n    }\n    final confirmation = await hotels.book(input);\n    return .response(confirmation.id);\n  },\n);\n```\n\n              Putting the approval check inside the tool guarantees that the model can't\n              bypass it. When `generate` returns with `FinishReason.interrupted`, your\n              Flutter app can prompt the user for confirmation and resume execution from\n              where it paused.\n            \n\n### Extend generation with middleware\n\n              Middleware hooks directly into the `generate` loop to intercept model calls,\n              inject tools, or modify requests and responses. Using `genkit` and\n              [`genkit_middleware`](https://pub.dev/packages/genkit_middleware), you can\n              attach pre-packaged capabilities like automatic retries, dynamic `SKILL.md`\n              \n              loading, and tool approval rules to any `generate` call:\n            \n\n```\nfinal ai = Genkit(plugins: [googleAI(), SkillsPlugin(), ToolApprovalPlugin()]);\n​\nfinal response = await ai.generate(\n  model: googleAI.gemini('gemini-flash-latest'),\n  prompt: 'Move my Kyoto hotel check-in to Friday.',\n  tools: [findBookings, updateBooking],\n  use: [\n    retry(maxRetries: 3),\n    skills(skillPaths: ['./skills']),\n    toolApproval(approved: ['findBookings', 'use_skill']),\n  ],\n);\n```\n\n              You can also author custom middleware with `defineGenerateMiddleware` for\n              cross-cutting logic like logging, caching, or model fallbacks.\n            \n\n### Manage prompts with Dotprompt\n\n[Dotprompt](https://genkit.dev/docs/dart/dotprompt/) lets you manage prompt\n              templates, model configuration, and input/output schemas together in `.prompt`\n              \n              files. Genkit automatically loads prompts from your `prompts/` directory so you\n              can invoke them as callable functions in Dart:\n            \n\n```\n---\nmodel: googleai/gemini-flash-latest\ninput:\n  schema:\n    destination: string\n---\nWrite a friendly, two-sentence introduction to {{destination}} for a first-time visitor.\nfinal introPrompt = await ai.prompt('destinationIntro');\nfinal response = await introPrompt({'destination': 'Kyoto'});\n```\n\n### Monitor your app in production\n\n              When you're ready to deploy, the\n              [`genkit_otel`](https://pub.dev/packages/genkit_otel) package exports traces,\n              token usage, and latency metrics using the OpenTelemetry GenAI semantic\n              conventions, integrating directly with your existing observability backend:\n            \n\n```\nimport 'package:dartastic_opentelemetry/dartastic_opentelemetry.dart';\nimport 'package:genkit/telemetry.dart';\nimport 'package:genkit_otel/genkit_otel.dart';\n​\nawait OTel.initialize();\nconfigureInstrumentation(GenAiInstrumentation());\n```\n\n## What's next: stateful agents and generative UI\n\n              Alongside the stable 1.0 core, we're developing higher-level agentic APIs under\n              the `package:genkit/experimental.dart` import so you can try them early and\n              help shape their design.\n            \n\n**Stateful agents** combine a model, tools, system instructions, and state into\n              a single `defineAgent` call. Conversations persist across turns and app\n              restarts using session stores, and you can use `remoteAgent` to delegate tasks\n              to subagents or expose agents over HTTP to connect with your Flutter app:\n            \n\n```\nimport 'package:genkit/experimental.dart';\n​\nfinal travelAgent = ai.defineAgent(\n  name: 'travelAgent',\n  model: googleAI.gemini('gemini-flash-latest'),\n  system: 'You help users plan and book trips.',\n  tools: [searchFlights, bookHotel],\n  store: FirestoreSessionStore(collection: 'sessions'),\n);\n​\nfinal chat = travelAgent.chat(sessionId: 'user-123');\nfinal response = await chat.send(text: 'Find me a weekend in Lisbon.');\n```\n\n**Generative UI with A2UI** lets agents stream interactive UI surfaces instead\n              of plain text. With [`genkit_a2ui`](https://pub.dev/packages/genkit_a2ui), an\n              agent can emit components like date pickers, forms, and confirmation cards that\n              your Flutter app renders incrementally as native widgets. Check out the\n              [A2UI guide](https://genkit.dev/docs/dart/agents/a2ui/) to learn more.\n            \n\n## Get started\n\n              Genkit Dart 1.0 is available on [pub.dev](https://pub.dev/packages/genkit)\n              today. Thank you to everyone in the Dart and Flutter community who built with\n              the preview, reported issues, and contributed pull requests to help bring\n              Genkit Dart to 1.0.\n            \n\n- \n**Get started:** Follow the[quickstart guide](https://genkit.dev/docs/dart/get-started/) .\n- \n**Explore samples:** Browse the[sample apps on GitHub](https://github.com/genkit-ai/genkit-dart/tree/main/testapps) .\n- \n**Join the community:** Chat with the team on[Discord](https://discord.gg/qXt5zzQKpc) .\n- \n**Stay updated:** Follow Genkit on[X](https://x.com/genkitframework) and[LinkedIn](https://www.linkedin.com/company/genkit) .\n- \n**Give feedback:** Open an issue on the[GitHub repository](https://github.com/genkit-ai/genkit-dart) .\n\nWe can't wait to see what you build with Genkit Dart 1.0!", "url": "https://wpnews.pro/news/genkit-dart-1-0-build-production-ready-agentic-apps-with-dart-and-flutter", "canonical_source": "https://flutter.dev/blog/announcing-genkit-dart-1-0", "published_at": "2026-10-11 01:09:46+00:00", "updated_at": "2026-10-11 01:20:39.523871+00:00", "lang": "en", "topics": ["ai-products", "ai-agents", "developer-tools", "generative-ai", "ai-tools"], "entities": ["Google", "Genkit Dart", "Dart", "Flutter", "Google Gemini", "Anthropic Claude", "OpenAI", "schemantic"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/genkit-dart-1-0-build-production-ready-agentic-apps-with-dart-and-flutter", "markdown": "https://wpnews.pro/news/genkit-dart-1-0-build-production-ready-agentic-apps-with-dart-and-flutter.md", "text": "https://wpnews.pro/news/genkit-dart-1-0-build-production-ready-agentic-apps-with-dart-and-flutter.txt", "jsonld": "https://wpnews.pro/news/genkit-dart-1-0-build-production-ready-agentic-apps-with-dart-and-flutter.jsonld"}}