---
title: "AI Assistant on Flutter | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/flutter/ai/ai-assistant/"
md_url: "https://www.nutrient.io/guides/flutter/ai/ai-assistant.md"
last_updated: "2026-05-18T12:22:04.618Z"
description: "Integrate Nutrient AI Assistant into your Flutter app to enable natural language queries and receive instant answers from your documents, enhancing user experience."
---

# AI Assistant on Flutter

Nutrient AI Assistant brings AI chat capabilities to your documents, enabling users to ask questions in natural language and get answers without sifting through pages of text. AI Assistant is ideal for summarizing, translating, and finding certain information in documents. Users can tap links in the chat to jump to the part of the document information came from.

To use this feature, run [Nutrient AI Assistant](https://www.nutrient.io/guides/ai-assistant.md) on your server.

## Setting up AI Assistant on Flutter

To get started, either implement AI Assistant in your own app by following the steps below, or check out the `nutrient_ai_assistant_example` in our [Catalog app](https://github.com/PSPDFKit/pspdfkit-flutter/tree/master/example/lib).

1. Set up Nutrient AI Assistant on your server, or run the server locally. The easiest way to get started is to clone our [AI Assistant demo repository](https://github.com/PSPDFKit/ai-assistant-demo) and follow the instructions in the README.

2. Set an `AIAssistantConfiguration` in your main `PdfConfiguration`. This configuration specifies the URL where your AI Assistant server can be accessed, a JSON Web Token (JWT) for authentication, a session identifier, and an optional user identifier. It’s best practice for the JWT to be [generated by your own server](https://www.nutrient.io/guides/ai-assistant/viewer-integration/client-authentication/generate-a-jwt.md):

```dart

// Create the AI Assistant configuration.
final aiConfig = AIAssistantConfiguration(
  serverUrl: 'https://your-ai-assistant-server.com',
  jwt: 'your-jwt-token', // Generate this from your server.
  sessionId: 'unique-session-id',
  userId: 'optional-user-id',
);

// Add to the PDF configuration.
final pdfConfig = PdfConfiguration(
  aiAssistantConfiguration: aiConfig,
  androidEnableAiAssistant: true,
  iOSLeftBarButtonItems: ['aiAssistantButtonItem'],
);

```

3. Add AI Assistant to your platform-specific UI.
   - **iOS** — Add `'aiAssistantButtonItem'` to `iOSLeftBarButtonItems` or `iOSRightBarButtonItems`
   - **Android** — Set `androidEnableAiAssistant: true`
   - **Web** — Add the AI Assistant button to your toolbar:

```dart

webConfiguration: PdfWebConfiguration(
  toolbarItems: [
    NutrientWebToolbarItem(type: NutrientWebToolbarItemType.aiAssistant),...Nutrient.defaultWebToolbarItems,
  ],
),

```

When users tap the AI Assistant button, the document data will be uploaded to AI Assistant on your server, and the chat UI will be presented.