For: Full Stack · Agency Dashboard · Backend API

AI assistant

Questions over your listings, and listing titles and descriptions in Arabic and English.

The assistant has two tools, both off until you connect a chat model.

Switching it on

Add to .env and restart:

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

Any OpenAI-compatible chat API works (POST {AI_BASE_URL}/chat/completions): OpenAI, Azure OpenAI, OpenRouter, or a local model with Ollama (AI_BASE_URL="http://localhost:11434/v1", AI_API_KEY="", AI_MODEL="qwen2.5:14b" for example).

Ask about your listings

Dashboard > AI assistant > "Ask about your listings". Examples:

  • "Which rentals under 700 OMR a month have a pool?"
  • "List our villas for sale in Al Mouj and Qurum with their prices."
  • "Which published listings have no inquiries yet?"

The server builds a compact table of the listings the signed-in person may see (agents: their own) with reference, title, purpose, type, status, price, rooms, size, area, furnishing, amenities, agent and number of inquiries. The model is told to answer from that table only, to cite references, and to say so when the answer is not there. Up to 300 listings are sent, most recently updated first.

Write a listing

In the listing editor ("Write with AI") or on the assistant page, give the facts and optional notes ("kitchen renovated in 2024"). The model returns a title and a three-paragraph description in Arabic and English. It is told to use only the facts given, never invent distances, views or amenities, and to write the Arabic for Gulf readers rather than translating the English word for word. Nothing is saved automatically: the agent reads and edits the draft first.

Limits

10 AI requests per minute per staff member. AI calls are refused in demo mode so a public demo cannot spend your credits.

API

Endpoint Body Answer
POST /api/dashboard/ai/ask {"question", "locale", "history"?} {"answer", "listingsConsidered"}
POST /api/dashboard/ai/listing {"purpose", "type", "areaId", "bedrooms", "bathrooms", "areaM2", "price", "amenities", "notes", ...} {"copy": {"titleAr", "titleEn", "descAr", "descEn"}}

Both answer 503 ai_not_configured when AI_BASE_URL is empty and 502 ai_failed when the provider fails.