AI features

An assistant that answers questions about bookings, and descriptions of stays written in both languages.

AI is optional. With AI_BASE_URL empty, everything else works and the AI buttons explain how to turn it on.

Turning it on

Any provider with an OpenAI-compatible /chat/completions endpoint works:

# OpenAI
AI_BASE_URL="https://api.openai.com/v1"
AI_API_KEY="sk-..."
AI_MODEL="gpt-4o-mini"

# A local Ollama, nothing leaves your server
AI_BASE_URL="http://localhost:11434/v1"
AI_API_KEY=""
AI_MODEL="qwen2.5:14b"

Restart after editing .env.

Booking assistant

Dashboard > AI assistant (owners and admins). Ask things like "Who arrives in the next 3 days?", "Which stays are empty next weekend?" or "Summarise this month's revenue by destination".

How it works (src/app/api/dashboard/ai/ask/route.ts):

  1. The server writes a plain-text snapshot: today's date, the stays with their rates, and the bookings from 60 days ago to 120 days ahead (code, stay, dates, guests, status, payment, total, guest name and country).
  2. It sends the snapshot and the question to the AI with instructions to answer only from that data and to say so when the answer is not there.
  3. The answer is shown in the dashboard. Nothing is changed in the database; the assistant cannot book, cancel or edit.

Guest names and countries are sent to the AI provider. Use a provider you trust with that data, or a local model.

Write with AI

In the stay editor, Write with AI sends the stay's names, type, destination, amenities and your notes ("private beach five minutes on foot, 4x4 needed") and gets back a short summary and a description in Arabic and in English. The Arabic is written for Gulf guests, not translated from the English. The suggestions fill the text fields; nothing is saved until you press Save.

Limits

Each account can make 20 AI requests a minute. Answers are cut at 4,000 characters. Change the prompts in src/lib/ai.ts.