Skip to main content
Enable intelligent conversational AI capabilities in your iOS 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 iOS installed via CocoaPods or Swift Package Manager
  • 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. Features Implemented::
  • 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 using CometChatAiAssistantBubbleStyle.

Implementation Flow Summary


Customization Options

  • Custom AI Assistant Empty Chat View: Customize using emptyStateView.
  • Streaming Speed: Adjust AI response streaming speed with streamingSpeed.
  • AI Assistant Suggested Messages: Set quick prompts using suggestedMessages.
  • AI Assistant Tools: Set AI agent tools using setAiAssistantTools callback.

Feature Matrix