Skip to main content

AI Chat

AI chat enables you to interact with an AI bot that can answer questions, provide information, and assist with various tasks.

Features

  • AI Chatbot - Interactive AI assistant for general questions and tasks
  • Conversational Interface - Natural chat-based interaction
  • General Assistance - Help with a wide range of questions and tasks
  • Q&A Capabilities - Answer questions about your organization and data
  • Context Awareness - Maintains conversation context for follow-up questions

Requirements

RequirementDetails
DependenciesAICore
PHP Version8.2+
AI ProviderAt least one AI provider configured in AI Core

Installation

  1. Ensure AI Core module is installed and enabled
  2. Enable the AI Chat module in Settings > Modules
  3. Configure chat settings and permissions

Configuration

Navigate to Settings > AI Core > AI Chat to configure:

  • Chat Model - Select AI model for chat interactions
  • System Prompt - Customize the AI's behavior and personality
  • Data Access - Configure what data the chat can access
  • History Retention - Set conversation history retention period

Usage

Web Interface

Access the AI Chat through the main navigation menu. The chat interface supports:

  • Text messages
  • File attachments (if Document AI is enabled)
  • Code snippets with syntax highlighting
  • Conversation history

Sample Conversations

General Questions:

  • "What's on my calendar today?"
  • "Summarize my pending tasks"
  • "How many employees are in the engineering team?"

Task Assistance:

  • "Help me write a job description for a software developer"
  • "Draft an email to the team about the upcoming meeting"
  • "Create a checklist for new employee onboarding"

Programmatic Access

use Modules\AIChat\Services\AIChatService;

$chat = app(AIChatService::class);

// Send a message
$response = $chat->send([
'message' => 'What are the company holidays this year?',
'conversation_id' => $conversationId, // Optional for context
]);

// Start a new conversation
$conversation = $chat->createConversation([
'system_prompt' => 'You are a helpful HR assistant.',
]);

API Endpoints

MethodEndpointDescription
POST/api/v1/ai-chat/sendSend message to AI
GET/api/v1/ai-chat/conversationsList conversations
GET/api/v1/ai-chat/conversations/{id}Get conversation history
DELETE/api/v1/ai-chat/conversations/{id}Delete conversation

Chat Capabilities

CapabilityDescription
Q&AAnswer questions about policies, procedures, data
Writing HelpDraft emails, documents, descriptions
Data QueriesQuery system data (with permissions)
CalculationsPerform calculations and analysis
ExplanationsExplain complex topics simply

Permissions

  • Use AI Chat - Basic access to chat interface
  • Access Data via Chat - Allow AI to query system data
  • Manage Conversations - View and manage all conversations

Notes

  • Conversation history is saved and can be continued later
  • AI responses are based on configured knowledge and permissions
  • All chat interactions are logged for audit purposes
  • Supports multiple concurrent conversations per user