Step 1 — OpenAI credentials
Choose one of two options:
Option A: Config file (recommended for production)
Add the following to config/local.config.php:
'chatbot' => [
'openai_api_key' => 'sk-your-key-here',
'encryption_key' => 'random-32-char-secret-change-me!',
],
Then check "Use API key from local.config.php" in Chatbot settings.
Option B: Encrypted in database
Leave the checkbox unchecked and paste your key directly into the OpenAI API key field. It is stored AES-256-CBC encrypted using chatbot.encryption_key from local.config.php.
Note: The encryption_key is always read from local.config.php — it is never stored in the database.
Step 2 — Turso vector database
In Chatbot → Settings, enter:
- Turso Database URL — e.g. libsql://your-db-name.turso.io
- Turso Auth Token — from your Turso dashboard
Step 3 — Model settings
| Setting | Default | Notes |
|---|---|---|
| Embedding model | text-embedding-3-large | text-embedding-3-small uses 1536 dims |
| Embedding dimensions | 3072 | Must match the chosen model |
| Chat model | gpt-4o-mini | Options: gpt-4o, gpt-4-turbo, gpt-3.5-turbo |
| Chunk size | 3200 chars | ≈ 800 tokens; range 200–8000 |
| Chunk overlap | 200 chars | Range 0–2000 |
| Top-K results | 5 | Chunks retrieved per query; range 1–20 |
Step 4 — Index your collection
After saving settings, run an initial index so the chatbot has content to search:
- Go to Items in the admin sidebar → scroll to the bottom → click Re-index All Items, or
- Go to Chatbot → Diagnostics → click Re-index Now
Monitor progress under Jobs in the admin sidebar. Detailed logs are available at Chatbot → View Logs.