Production-grade RAG API for Dubai Real Estate — English docs → Arabic MSA + Dubai dialect answers with full observability.
Day 6/7 of 30-Day AI Sprint | 4.4s EN / 5.6s AR | 0.822 similarity
- 🌍 Cross-lingual retrieval (English ↔ Arabic)
- 📄 Metadata-aware semantic search
- 📚 Citation-based grounded answers
- 🆔 Correlation ID tracing
- 📊 Production observability
- 🔁 Duplicate source removal
- ⚡ Average latency: 4.4–5.6 seconds
flowchart TD
A[Webhook POST] --> B[Validation + CorrelationID]
B --> C[Detect Language]
C --> D[Generate Embedding]
D --> E[Validate Embedding]
E --> F[Detect Project]
F --> G[Semantic Search]
G --> H[Build Context]
H --> I[Grounded Answer]
I --> J[Format Response]
J --> K[Respond Webhook]
J --> L[Insert Log]
EN: What is DLD transfer fee? → 4% [0.822] 4489ms
AR MSA: ما هي رسوم نقل ملكية دائرة الأراضي؟ → 4% [0.775] 5391ms
Dubai: كم رسوم ال DLD؟ → 4% [0.722] 5648ms
Q: ما هي رسوم نقل ملكية دائرة الأراضي والأملاك في دبي؟
A: رسوم نقل الملكية: 4%... [source: Dubai DLD Fees 2026, page: 1]
Latency: 5391ms | Language: arQ: كم رسوم ال DLD؟
A: رسوم نقل الملكية: 4%... [source: Dubai DLD Fees 2026, page: 1]
Latency: 5648ms | Language: arQuery the latest RAG requests and performance metrics:
SELECT
request_id,
language,
top_similarity,
latency_ms,
prompt_tokens,
total_tokens
FROM rag_logs_realestate
ORDER BY created_at DESC;| Request ID | Language | Top Similarity | Latency | Tokens (Prompt / Total) |
|---|---|---|---|---|
| req_msgbc9en... | ar | 0.722 | 5648 ms | 330 / 1093 |
| req_msgayjpq... | en | 0.822 | 4489 ms | 725 / 860 |
The observability table helps monitor retrieval quality, API latency, multilingual usage, and token consumption for each request.
| Technology | Version | Purpose |
|---|---|---|
| n8n | 2.33.4 | Workflow orchestration and automation |
| Gemini 2.5 Flash | Latest | Grounded answer generation (LLM) |
| Gemini Embedding 2 | Latest | 768-dimensional vector embeddings |
| Supabase + pgvector | PostgreSQL + pgvector | Vector database, semantic search, and observability logging |
| Docker | Latest | Self-hosted deployment environment |
- 🌍 Cross-lingual semantic retrieval (English ↔ Arabic)
- 🏷️ Metadata-aware filtering (Project, Developer, Community, Document Type)
- 📚 Citation-based grounded responses
- 📊 Production observability and audit logging
- 📈 Similarity score tracking for every retrieval
- 🆔 End-to-end request tracing with Correlation IDs
- 🇦🇪 Arabic MSA and Dubai dialect support
- 🔁 Duplicate source detection and removal
- ⚡ Enterprise RAG workflow built with n8n
- 🐳 Fully self-hosted using Docker
Request
{
"question": "كم رسوم ال DLD؟",
"project": "Dubai DLD Fees 2026"
}Response
{
"success": true,
"request_id": "req_msgbc9en_5wjy5z",
"answer": "رسوم نقل الملكية: 4%... [source: Dubai DLD Fees 2026, page: 1]",
"language": "ar",
"latency_ms": 5648,
"sources": [{"similarity": 0.722}],
"usage": {"prompt_tokens": 330, "total_tokens": 1093}
}- 🇦🇪 Supports Arabic-speaking property buyers
- 📄 Provides citation-based answers from official documents
- ⚡ Reduces repetitive customer support requests
- 📊 Enables production monitoring through observability logs
- 🔍 Uses metadata-aware semantic search for higher retrieval accuracy
-
Clone repository
-
Configure environment variables
-
Start Docker
-
Import workflow into n8n
-
Configure Supabase
-
Add Gemini API Key
-
Execute workflow
Toqeer Ahmad
Dubai, UAE 🇦🇪
AI Automation • Enterprise RAG • n8n • Gemini • Supabase
Open to:
- AI Automation Engineer
- RAG Engineer
- n8n Developer
Proprietary — All Rights Reserved. See LICENSE file. Viewing allowed for recruitment only.





