---
title: "AI Assistant for MAUI document SDK | Nutrient"
canonical_url: "https://www.nutrient.io/guides/maui/ai-assistant/"
md_url: "https://www.nutrient.io/guides/maui/ai-assistant.md"
last_updated: "2026-05-15T19:10:05.044Z"
description: "The exposed functionality from AI Assistant is designed to be integrated with Nutrient MAUI SDK. Discover how to connect the two to provide your users."
---

# AI Assistant

The exposed functionality from AI Assistant is designed to be integrated with [Nutrient MAUI SDK](https://www.nutrient.io/sdk/maui/). This guide explains how to connect the two to provide your users with an AI experience.

## Configuration

To show the AI Assistant user interface (UI) on Nutrient MAUI SDK, you first need to configure the [AI Assistant configuration](https://www.nutrient.io/api/maui/api/Nutrient.Api.AIAssistant.IAIAssistantConfiguration.html) with a [generated JSON Web Token (JWT)](https://www.nutrient.io/guides/ai-assistant/viewer-integration/client-authentication/generate-a-jwt.md) while [loading a document](https://www.nutrient.io/guides/maui/open-a-document.md) via the [`ViewerConfiguration`](https://www.nutrient.io/api/maui/api/PSPDFKit.Api.IViewerConfiguration.html) object:

```csharp

try
{
    var config = PSPDFKitController.CreateViewerConfiguration();
    config.SetAIAssistantConfiguration("<sessionId>", "<jwt>", "<backendUrl>");
    await PSPDFKitController.LoadDocumentFromAssetsAsync(
        DemoFile, config);
    PSPDFKitController.MainToolbar.ToolbarItems.Add(new AIAssistantButton());
}
catch (Exception ex)
{
    RaiseExceptionThrownEvent("Loading document failed", ex);
}

```

Replace the `<sessionId>` placeholder in the code above with an alphanumeric unique ID generated by your application. A new ID will open a new chat session, and an existing ID will reopen the session where the user left off.

Replace the `<jwt>` placeholder with a valid and signed JWT. See the guide on [generating a JWT](https://www.nutrient.io/guides/ai-assistant/viewer-integration/client-authentication/generate-a-jwt.md) for details.

Replace the `<backendUrl>` placeholder with the full URL where your AI Assistant service is served from. This will be the protocol and the IP address or domain you’re hosting your service from, followed by the port number, e.g. `http://localhost:4000`.

You can also pass an optional `userId` to the `aiAssistant` object, which will allow you to set a [request limit for the user in the JWT](https://www.nutrient.io/guides/ai-assistant/viewer-integration/client-authentication/generate-a-jwt.md), and to manage user data with the [server API](https://www.nutrient.io/guides/ai-assistant/api.md).

## Opening the AI Assistant UI

To allow a user to show/hide the AI Assistant UI, you can add a toolbar button that will open the AI Assistant UI when clicked:

```csharp

PSPDFKitController.MainToolbar.ToolbarItems.Add(new AIAssistantButton());

```

### Programmatic opening

It’s also possible to show/hide the AI Assistant UI programmatically using the [`PDFView.ShowAIAssistant`](https://www.nutrient.io/api/maui/sdk/PSPDFKit.Sdk.PDFView.html#PSPDFKit_Sdk_PDFView_ShowAIAssistant) dependency property:

```xml

<sdk:PDFView x:Name="PDFView" Initialized="OnPDFViewInitialized"
             ShowAIAssistant="true" />

```
---

## Related pages

- [PDF bookmarks in MAUI](/guides/maui/bookmarks.md)
- [Advanced access to APIs](/guides/maui/advanced-access-apis.md)
- [Changelog for .NET MAUI](/guides/maui/changelog.md)
- [Compare PDF files in MAUI](/guides/maui/comparison.md)
- [Demo: MAUI PDF library](/guides/maui/demo.md)
- [PDF document security in MAUI](/guides/maui/document-security.md)
- [Download our MAUI library](/guides/maui/downloads.md)
- [Edit PDFs in MAUI](/guides/maui/editor.md)
- [MAUI PDF form library](/guides/maui/forms.md)
- [MAUI PDF library](/guides/maui.md)
- [Nutrient guides: Integrate our PDF library](/guides/maui/intro.md)
- [Printing a PDF in MAUI](/guides/maui/print.md)
- [Redact PDF files in MAUI](/guides/maui/redaction.md)
- [MAUI PDF generation library](/guides/maui/pdf-generation.md)
- [PDF text search in MAUI](/guides/maui/search.md)
- [Troubleshooting](/guides/maui/troubleshoot.md)
- [Upgrade and migration guides](/guides/maui/upgrade.md)

