ArbresAI - Chat with AI
ArbresAI - AI-Powered Q&A
Overview
ArbresAI is a Joomla 5+ component that provides AI-powered question-and-answer functionality based on your database content. Users can ask natural language questions, and the AI will generate SQL queries, execute them safely, and provide natural language answers. The standard component will process data from Remository and from Joomla articles. Other data can be added by installing simple plugins.
Features
- Multiple AI Provider Support: OpenAI, Claude (Anthropic), Gemini (Google), DeepSeek, and Grok (xAI)
- Natural Language to SQL: Automatically converts user questions into SQL queries
- Query Validation: Security-first approach with query validation and table access controls
- Conversation History: Maintains context across multiple questions
- Query Logging: Audit trail of all generated and executed queries
- Schema Caching: Optimized performance with database schema caching
- Modern Chat Interface: Clean, responsive UI for asking questions
Requirements
- Joomla: 5.0 or later
- PHP: 8.1 or later
- Composer: For installing dependencies
Installation
- Download the component package
- Install via Joomla Extensions Manager
- Configure the component (see Configuration section)
Configuration
AI Provider Setup
- Go to Components → ArbresAI → Options
- Select the AI Provider Settings tab
- Choose your default AI provider
- Enter your API key for the selected provider
- Select the model to use
- If desired, add your own text strings for the user prompts
- Tune the system by choosing the maximum number of database records per table
Supported Providers and Models
OpenAI
- API Key: Get from https://platform.openai.com/api-keys
- Models: GPT-4o, GPT-4o Mini, GPT-4 Turbo
Claude (Anthropic)
- API Key: Get from https://console.anthropic.com/
- Models: Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku
Gemini (Google)
- API Key: Get from https://makersuite.google.com/app/apikey
- Models: Gemini 2.0 Flash, Gemini 1.5 Pro, Gemini 1.5 Flash
DeepSeek
- API Key: Get from https://platform.deepseek.com/
- Models: DeepSeek Chat, DeepSeek Reasoner
Grok (xAI)
- API Key: Get from https://x.ai/
- Models: Grok Beta, Grok Vision Beta
Please note: Gemini and Grok are untested at present.
Database Settings
-
Query Timeout: Maximum execution time for queries (default: 30 seconds)
-
Enable Query Logging: Log all generated queries for auditing (recommended)
Chat Settings
- Max Conversation Length: Number of messages to keep in history (default: 10)
- Enable Conversation History: Store conversations for logged-in users
Usage
Creating a Menu Item
- Go to Menus → Main Menu → New
- Select ArbresAI → AI Chat as the menu item type
- Configure the menu item settings
- Save and publish
Using the Chat Interface
- Navigate to the menu item you created
- Type your question in natural language
- Click Send or press Enter
- View the AI-generated answer
- Optionally view the generated SQL query
Ask Questions
- What can be asked depends on the data available in your database tables
Security
Query Validation
- Only SELECT queries are allowed
- Dangerous SQL keywords (DROP, DELETE, INSERT, UPDATE, etc.) are blocked
- Table access is restricted to the configured tables
- All queries are validated before execution
Best Practices
- Limit Table Access: Only allow access to tables that should be queryable
- Enable Query Logging: Keep an audit trail of all queries
- Set Appropriate Timeouts: Prevent long-running queries
- Secure API Keys: Never share your AI provider API keys
- Review Logs Regularly: Monitor the query log for unusual activity
Troubleshooting
"AI service is not configured"
- Ensure you've entered an API key for your selected provider
- Verify the provider selection matches the configured API key
Query Execution Errors
- Check the Query Log for detailed error messages
- Verify database permissions
- Ensure queries don't exceed timeout limits
Support
- Author: Martin Brampton
- Email: martin@remository.com
- Website: https://remository.com
License
GNU General Public License version 2 or later
Credits
Built with:
- Joomla CMS Framework
- Multiple AI provider APIs