Architecture & Performance Benchmark of DivinityAI – Islamic Grounded RAG

Architecture & Performance Benchmark of DivinityAI – Islamic Grounded RAG

Key Takeaways: DivinityAI is a strict corpus-locked Islamic RAG system, ensuring zero hallucination of Quranic verses or Hadith citations. It features a five-path intent router, HyDE expansion, hybrid search, and deterministic citation verification.

Live Project Access: https://muslim.nevatal.id

The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

General-purpose large language models (LLMs) often hallucinate religious texts, fabricating Quranic surah and ayah numbers, attributing narrations to the wrong companions, merging distinct prophetic sayings (Hadith), and synthesizing inaccurate Islamic jurisprudence (Fiqh) fatwas. This inaccuracy can be misleading and unreliable, particularly in a domain where textual accuracy is critical.

Core Architecture & Technical Stack Deep-Dive

Overview

DivinityAI is built as a modular application with a Django backend serving a React SPA, deploying local embeddings and remote LLM orchestrators. The system consists of several components, including a vector database (ChromaDB), a sparse index (rank_bm25), an embedding model (Ollama), and an LLM engine (OpenRouter and Groq).

Ingestion & Arabic NLP Pipeline

The ingestion pipeline implements a custom preprocessing normalization stage to index classical Arabic scripts accurately. This includes NFKD normalization, stripping diacritics, and normalizing alef forms.

Key Features Breakdown & Practical Benefits

Strict Corpus-Lock Policy

DivinityAI ensures zero hallucination of Quranic verses or Hadith citations by implementing a strict corpus-lock policy. If a fact or claim cannot be verified from the retrieved sources, the system refuses to answer.

Intent Router & HyDE Expansion

The system features a five-path intent router, classifying incoming queries by intent (Quran search, Hadith research, Fiqh analysis, calculations, or out-of-scope). It also implements HyDE expansion and sub-query decomposition for nuanced jurisprudential queries.

Hybrid Search & Deterministic Citation Verification

DivinityAI uses a hybrid approach, combining BM25 sparse matching with BGE-M3 dense embeddings. It also implements a deterministic citation verification chain, ensuring that all citations are accurate and reliable.

Real-World Use Cases & Applications

DivinityAI has several real-world use cases, including scholarly research and authenticated Quran/Hadith reference discovery, academic study of classical Arabic religious texts, and reference design pattern for high-stakes zero-hallucination domain-specific RAG architectures.

How It Works: Step-by-Step Workflow

  1. Intent classification: The system classifies the user query using an LLM classifier.
  2. Scope enforcement: The system checks the classification confidence and rejects out-of-scope queries.
  3. Expansion: The system executes HyDE expansion and sub-query decomposition for Fiqh intent.
  4. Retrieval: The system runs BM25 token searches and BGE-M3 dense queries against ChromaDB.
  5. Verification: The system validates citations using a deterministic verification chain.
  6. Synthesis: The system generates the final response using the validated citations.

Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

Feature DivinityAI Traditional Approaches
Corpus-lock policy Strict corpus-lock policy No corpus-lock policy
Intent router Five-path intent router No intent router
Hybrid search Hybrid BM25 and BGE-M3 search No hybrid search
Citation verification Deterministic citation verification No citation verification

Frequently Asked Questions (FAQ)

What is DivinityAI – Islamic Grounded RAG?
DivinityAI is a strict corpus-locked Islamic RAG system that ensures zero hallucination of Quranic verses or Hadith citations.
How does DivinityAI work?
DivinityAI works by classifying the user query, expanding the query, retrieving relevant citations, verifying the citations, and synthesizing the final response.
What are the benefits of using DivinityAI?
The benefits of using DivinityAI include accurate and reliable citations, zero hallucination of Quranic verses or Hadith citations, and a strict corpus-lock policy.
Can I use DivinityAI for scholarly research?
Yes, DivinityAI is suitable for scholarly research and authenticated Quran/Hadith reference discovery.
Is DivinityAI available for public use?
Yes, DivinityAI is available for public use at https://muslim.nevatal.id.

Conclusion & Next Steps

In conclusion, DivinityAI – Islamic Grounded RAG is a revolutionary system that ensures zero hallucination of Quranic verses or Hadith citations. Its strict corpus-lock policy, five-path intent router, HyDE expansion, hybrid search, and deterministic citation verification make it an ideal solution for scholarly research and authenticated Quran/Hadith reference discovery. To explore the project and learn more about its features and use cases, visit https://muslim.nevatal.id.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *