This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/flutter/ai/ai-assistant.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. AI Assistant on Flutter | Nutrient SDK

Nutrient AI Assistant adds AI chat to documents in your Flutter app. Users can ask questions in natural language, summarize content, translate text, and find information in a document. When AI Assistant cites a source, users can tap the link in the chat to jump to the relevant part of the document.

To use this feature, run Nutrient AI Assistant on your server. Refer to the AI Assistant guide for setup details.

Set up AI Assistant on Flutter

You can use the ai_assistant_example in the Catalog app(opens in a new tab) or configure AI Assistant in your own app with these steps:

  1. Set up Nutrient AI Assistant on your server, or run the server locally. To start from a demo project, clone the AI Assistant demo repository(opens in a new tab) and follow the instructions in the README.
  2. Set aiAssistantConfiguration on your NutrientViewConfiguration(opens in a new tab). This configuration defines the AI Assistant server URL, a JSON Web Token (JWT) for authentication, a session identifier, and an optional user identifier. Generate the JWT on your server. Refer to the generate a JWT guide for details.
NutrientDocumentView(
documentPath: documentPath,
configuration: NutrientViewConfiguration(
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',
},
),
)

When you provide this configuration, the SDK shows the AI Assistant button in the viewer toolbar on Android and iOS. When users tap the button, the SDK uploads the document data to AI Assistant on your server and shows the chat UI.

On Web, aiAssistantConfiguration isn’t mapped into the Web SDK load options yet. Configure AI Assistant through platform adapters, which give you direct access to the Web SDK instance and its load options.

Use AI Assistant with Instant documents

You can also configure AI Assistant for Instant documents on Android and iOS.

Pass the same configuration to NutrientInstantView:

NutrientInstantView(
serverUrl: instantServerUrl,
jwt: instantJwt,
configuration: NutrientViewConfiguration(
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',
},
),
)