Edit

Microsoft.Maui.Essentials.AI overview

Microsoft.Maui.Essentials.AI is a cross-platform library that brings on-device AI capabilities to .NET MAUI applications through seamless integration with Microsoft.Extensions.AI. It surfaces native platform AI frameworks behind the standard IChatClient and IEmbeddingGenerator interfaces, so you can write portable AI code that runs entirely on-device without sending data to external servers.

Note

Microsoft.Maui.Essentials.AI is designed for all .NET MAUI platforms. Apple Intelligence (iOS, macOS, Mac Catalyst, tvOS) is the first implementation available. Android and Windows support are not yet available and will be added in future releases.

Important

This API is experimental and is subject to change. Using it produces diagnostic warning MAUIAI0001. You must suppress this warning to use the library.

To suppress the warning project-wide, add the following to your .csproj file:

<PropertyGroup>
  <NoWarn>$(NoWarn);MAUIAI0001</NoWarn>
</PropertyGroup>

To suppress the warning for a specific file or block of code, use a pragma:

#pragma warning disable MAUIAI0001
// Your code using Microsoft.Maui.Essentials.AI
#pragma warning restore MAUIAI0001

What is Microsoft.Maui.Essentials.AI?

Microsoft.Maui.Essentials.AI is a bridge between the Microsoft.Extensions.AI abstractions and native on-device AI frameworks. Rather than calling platform-specific APIs directly, you interact with well-known interfaces (IChatClient, IEmbeddingGenerator<string, Embedding<float>>) that the library implements on top of the underlying OS frameworks.

Currently available (Apple platforms)

  • Chat clientAppleIntelligenceChatClient implements IChatClient using Apple's Foundation Models framework (Apple Intelligence). Requires iOS 26.0+, macOS 26.0+, Mac Catalyst 26.0+, or tvOS 26.0+.
  • Embedding generatorNLEmbeddingGenerator implements IEmbeddingGenerator<string, Embedding<float>> using Apple's Natural Language framework. Available from iOS 13.0+, macOS 10.15+, Mac Catalyst 13.1+, and tvOS 13.0+.

Planned (not yet available)

  • Android — on-device AI support for Android is planned for a future release.
  • Windows — on-device AI support for Windows is planned for a future release.

Because all implementations conform to the standard Microsoft.Extensions.AI interfaces, you can substitute any IChatClient or IEmbeddingGenerator provider without changing your application logic. This makes it straightforward to switch between on-device models or cloud-backed providers.

Key benefits

  • Unified API: Program against IChatClient and IEmbeddingGenerator<string, Embedding<float>>—the same interfaces used across the .NET AI ecosystem.
  • On-device processing: AI inference runs locally on the device. No network call is required.
  • Privacy-first: Data never leaves the device and is never sent to external servers.
  • Platform-optimized: Each platform implementation is accelerated by native hardware-level ML capabilities.
  • Microsoft.Extensions.AI compatible: Works out-of-the-box with logging middleware, dependency injection, telemetry, and the full breadth of the .NET AI ecosystem.

What you can build

Microsoft.Maui.Essentials.AI provides the primitives for a wide range of on-device AI scenarios:

  • Chat assistants with tool calling — Build conversational experiences that call application functions using the standard IChatClient tool-calling API.
  • Semantic search with on-device text embeddings — Use IEmbeddingGenerator to embed strings and compare semantic similarity entirely on-device.
  • Multi-agent AI workflows — Compose multiple IChatClient instances using Microsoft.Extensions.AI middleware pipelines.
  • Structured data extraction with JSON schema — Request structured, strongly-typed responses by specifying a JSON schema in the chat options.

In this section

Article Description
Get started Install the package and register the chat client and embedding generator services.
Chat Use IChatClient for basic chat, streaming, multi-turn conversations, tool calling, and structured output.
Text embeddings Use IEmbeddingGenerator to generate on-device text embeddings for semantic search and similarity.
Agent framework integration Build multi-agent AI workflows with Microsoft.Agents.AI and Microsoft.Maui.Essentials.AI.
Feature comparison Feature availability across all platforms.
Requirements Supported OS versions and device requirements for iOS, macOS, Mac Catalyst, and tvOS.

See also