Skip to main content
Enable intelligent conversational AI capabilities in your Android app using CometChat UIKit v5 with AI Agent integration:
  • AI Assistant Chat History
  • Chat History Management
  • Contextual Responses
  • Agent Detection
  • Seamless Handoffs
Transform your chat experience with AI-powered assistance that provides intelligent responses and offers seamless integration with your existing chat infrastructure.

Overview

Users can interact with AI agents through a dedicated chat interface that:
  • Provides intelligent responses based on conversation context.
  • Maintains chat history for continuity.
  • Seamlessly integrates with your existing user chat system.
The AI Agent chat interface provides a familiar messaging experience enhanced with AI capabilities, accessible through your main chat flow or as a standalone feature.

Prerequisites

  • CometChat UIKit for Flutter installed via pubspec.yaml
  • CometChat initialized with App ID, Region, and Auth Key
  • Message chat enabled in your CometChat app
  • Navigation set up between message and user/group screens
  • Internet permissions

Components

Integration Steps

Step 1 - Screen Setup

Create a screen for AI Assistant chat using CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer.

Step 2 - Chat History Screen

Create a screen for AI Assistant chat history using CometChatAIAssistantChatHistory. Add the following code inside your widget to navigate to the chat history screen when the user taps a button or icon.
This integration opens the AI Assistant Chat History screen, allowing users to:
  • Browse their previous AI chat sessions.
  • Resume a previous conversation (onMessageClicked).
  • Start a new chat session (onNewChatButtonClicked).
  • Close the chat history view (onClose).

Step 3 - Custom Styles

Define custom styles for AI chat bubbles and the composer by using a ThemeExtension (CometChatAiAssistantBubbleStyle).

Implementation Flow Summary

Customization Options

  • Custom AI Assistant Empty Chat View: Customize the empty state view using emptyStateView.
  • Streaming Speed: Adjust AI response streaming speed via streamingSpeed.
  • AI Assistant Suggested Messages: Create custom list of suggested messages and set quick prompts using suggestedMessages.
  • AI Assistant Tools: Set tools for the AI agent using setAiAssistantTools callback.

Feature Matrix