Skip to content

About

Production RAG API for Dubai Real Estate - Cross-lingual (EN → AR MSA + Dubai dialect) + Enterprise Observability - n8n 2.33.4 + Gemini 2.5 Flash + Supabase pgvector - 4.4s latency, 0.822 similarity

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🏙 Enterprise Dubai Real Estate RAG API

n8n Gemini Supabase Observability CrossLingual

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


✨ Features

  • 🌍 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

🏗 Architecture

Architecture

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]
Loading

📸 Screenshots

1. Production Retrieval Workflow

Production Retrieval Workflow

2. System Architecture

System Architecture

3. English Query (Postman)

English Query

4. Arabic MSA Query (Postman)

Arabic MSA Query

5. Dubai Dialect Query (Postman)

Dubai Dialect Query

6. Supabase Observability Dashboard

Supabase Observability

📊 Results

English - 0.822 similarity

EN: What is DLD transfer fee? → 4% [0.822] 4489ms
AR MSA: ما هي رسوم نقل ملكية دائرة الأراضي؟ → 4% [0.775] 5391ms
Dubai: كم رسوم ال DLD؟ → 4% [0.722] 5648ms

Arabic (MSA) - 0.775 similarity

Q: ما هي رسوم نقل ملكية دائرة الأراضي والأملاك في دبي؟
A: رسوم نقل الملكية: 4%... [source: Dubai DLD Fees 2026, page: 1]
Latency: 5391ms | Language: ar

Dubai Dialect - 0.722 similarity

Q: كم رسوم ال DLD؟
A: رسوم نقل الملكية: 4%... [source: Dubai DLD Fees 2026, page: 1]
Latency: 5648ms | Language: ar

📊 Supabase Observability

Query 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;

Sample Logs

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.

🛠️ Tech Stack

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

🎯 Key Capabilities

  • 🌍 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

📡 API Example

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}
}

🌍 Business Value

  • 🇦🇪 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

⚙️ Setup

  1. Clone repository

  2. Configure environment variables

  3. Start Docker

  4. Import workflow into n8n

  5. Configure Supabase

  6. Add Gemini API Key

  7. Execute workflow

👨‍💻 Author

Toqeer Ahmad

Dubai, UAE 🇦🇪

AI Automation • Enterprise RAG • n8n • Gemini • Supabase

Open to:

  • AI Automation Engineer
  • RAG Engineer
  • n8n Developer

📄 License

Proprietary — All Rights Reserved. See LICENSE file. Viewing allowed for recruitment only.

About

Production RAG API for Dubai Real Estate - Cross-lingual (EN → AR MSA + Dubai dialect) + Enterprise Observability - n8n 2.33.4 + Gemini 2.5 Flash + Supabase pgvector - 4.4s latency, 0.822 similarity

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors