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
| Requirement | Details |
|---|---|
| Dependencies | AICore |
| PHP Version | 8.2+ |
| AI Provider | At least one AI provider configured in AI Core |
Installation
- Ensure AI Core module is installed and enabled
- Enable the AI Chat module in Settings > Modules
- 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
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/ai-chat/send | Send message to AI |
| GET | /api/v1/ai-chat/conversations | List conversations |
| GET | /api/v1/ai-chat/conversations/{id} | Get conversation history |
| DELETE | /api/v1/ai-chat/conversations/{id} | Delete conversation |
Chat Capabilities
| Capability | Description |
|---|---|
| Q&A | Answer questions about policies, procedures, data |
| Writing Help | Draft emails, documents, descriptions |
| Data Queries | Query system data (with permissions) |
| Calculations | Perform calculations and analysis |
| Explanations | Explain 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