Tag: Quran Search

  • DivinityAI – Islamic Grounded RAG: Architecture & Performance Benchmark

    DivinityAI – Islamic Grounded RAG: Architecture & Performance Benchmark

    Key Takeaways: DivinityAI is a Retrieval-Augmented Generation (RAG) system built to provide hallucination-free, accurate Quran and Hadith references. Its strict corpus-lock policy ensures every response is grounded in authentic sources. Explore the live project here.

    The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

    General-purpose large language models (LLMs) often hallucinate religious texts, fabricating Quranic verses and Hadith narrations. This poses significant risks in a domain where textual accuracy is paramount. DivinityAI addresses this challenge by implementing a strict corpus-lock policy, ensuring every response is verified against authenticated Quran and Hadith collections.

    Core Architecture & Technical Stack Deep-Dive

    DivinityAI leverages a robust tech stack to deliver its promise of accuracy and reliability. The system is built on Django ASGI/DRF for the backend, React 19/Vite for the frontend, and ChromaDB for vector storage. Key components include:

    • Intent Router: Classifies queries into Quran verse, Hadith, Fiqh, Calculation, or Off-Domain.
    • Hybrid Search: Combines BM25 sparse matching with BGE-M3 dense embeddings for comprehensive retrieval.
    • Citation Verification: A four-tier deterministic verification chain ensures citation accuracy.

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI refuses to answer queries that cannot be verified from its locked corpus of Quran and Hadith texts, ensuring zero hallucination.

    Deterministic Citation Verification

    Every citation undergoes a rigorous verification process, including exact string matching, normalized matching, fuzzy Levenshtein distance, and semantic LLM fallback.

    Real-World Use Cases & Applications

    DivinityAI serves as a reliable tool for scholarly research, academic study, and jurisprudential analysis. Its applications include:

    • Authenticated Quran and Hadith reference discovery.
    • Cross-source comparative analysis of classical Arabic texts.

    How It Works: Step-by-Step Workflow

    The workflow begins with user query classification, followed by scope enforcement, query rewriting, hybrid retrieval, and citation verification. The system ensures every step is meticulously validated before generating a response.

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional Approaches
    Hallucination Risk Zero High
    Citation Accuracy 95%+ Variable
    Corpus Lock Strict None

    Frequently Asked Questions (FAQ)

    What is DivinityAI?

    DivinityAI is a Retrieval-Augmented Generation (RAG) system designed to provide accurate Quran and Hadith references without hallucination.

    How does DivinityAI ensure citation accuracy?

    DivinityAI employs a four-tier deterministic verification chain to validate every citation.

    Conclusion & Next Steps

    DivinityAI represents a significant advancement in domain-specific RAG systems, offering unparalleled accuracy and reliability. Explore the live project here to experience its capabilities firsthand.

  • DivinityAI – Islamic Grounded RAG: A Comprehensive Guide & Technical Deep-Dive

    DivinityAI – Islamic Grounded RAG: A Comprehensive Guide & Technical Deep-Dive

    Key Takeaways

    • DivinityAI is a strictly corpus-locked Islamic RAG system ensuring zero hallucination in Quran and Hadith responses.
    • Implements a 5-path intent router, HyDE expansion, hybrid search, and deterministic citation verification.
    • Built with Django ASGI/DRF, React 19, ChromaDB, BGE-M3 embeddings, and BM25 sparse search.
    • Designed for scholarly research, academic study, and high-stakes RAG architecture reference.
    Live Project Access: https://muslim.nevatal.tech

    The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

    General-purpose large language models (LLMs) often hallucinate religious texts, fabricating Quranic verses, misattributing Hadith, and generating inaccurate Islamic jurisprudence (Fiqh). In a domain where textual accuracy is paramount, these inaccuracies can be misleading. DivinityAI addresses this challenge by implementing a strict corpus-lock policy, ensuring every response is grounded in authenticated Quran and Hadith sources.

    Core Architecture & Technical Stack Deep-Dive

    System Components & Interface Boundaries

    DivinityAI is built as a modular application with a Django backend serving a React SPA, deploying local embeddings and remote LLM orchestrators:

                              ┌──────────────────────┐
                              │   React 19 / Vite    │
                              └──────────┬───────────┘
                                         │
                                         │ HTTP (POST /api/v1/query)
                                         ▼
                              ┌──────────────────────┐
                              │      Django / DRF    │
                              └──────────┬───────────┘
                                         │
                     ┌───────────────────┼───────────────────┐
                     ▼                   ▼                   ▼
          ┌─────────────────────┐┌───────────────┐ ┌───────────────────┐
          │  ChromaDB (8040)    ││ rank_bm25     │ │  Ollama (11434)   │
          │  Quran & Hadith     ││ (Local Disk)  │ │  embeddinggemma   │
          └─────────────────────┘└───────────────┘ └───────────────────┘
    

    Ingestion & Arabic NLP Pipeline

    To index classical Arabic scripts accurately, the ingestion pipeline implements a custom preprocessing normalization stage:

    [Raw JSON File] ──► [NFKD Normalization] ──► [Strip Diacritics] ──► [Alef Normalization] ──► [Chroma & BM25]
    

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI refuses to answer queries not grounded in its locked corpus of Quran and Hadith texts, ensuring zero hallucination.

    Five-Path Intent Router

    Queries are classified into Quran verse, Hadith, Fiqh, Calculation, or Off-Domain categories, each triggering specialized retrieval strategies.

    Deterministic Citation Verification

    A 4-tier verification chain (exact match, normalized, Levenshtein distance, semantic check) ensures citation accuracy.

    Real-World Use Cases & Applications

    • Scholarly research and authenticated Quran/Hadith reference discovery.
    • Academic study of classical Arabic religious texts and cross-source comparative analysis.
    • Reference design pattern for high-stakes zero-hallucination domain-specific RAG architectures.

    How It Works: Step-by-Step Workflow

    1. Intent Classification: Determines query type (Quran, Hadith, Fiqh, etc.).
    2. Scope Enforcement: Rejects off-domain queries.
    3. Query Rewriting: Uses HyDE and sub-query decomposition for complex queries.
    4. Hybrid Retrieval: Combines BM25 sparse and BGE-M3 dense searches.
    5. Citation Verification: Validates references deterministically.
    6. Grounded Generation: Synthesizes responses strictly from verified sources.

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional LLMs
    Hallucination Rate Near-zero (corpus-locked) High (free-form generation)
    Citation Accuracy 95%+ (deterministic verification) Low (no built-in verification)
    Query Intent Handling Specialized 5-path routing Generic single-path

    Frequently Asked Questions (FAQ)

    What makes DivinityAI different from other Islamic AI tools?

    DivinityAI implements a strict corpus-lock policy and deterministic citation verification, ensuring responses are always grounded in authentic sources.

    Can DivinityAI issue fatwas?

    No. DivinityAI displays source materials and scholarly positions without generating new religious rulings.

    What languages does DivinityAI support?

    DivinityAI supports multilingual inputs (Arabic, English, and Malay) with optimized Right-to-Left (RTL) Arabic typography.

    How fast is DivinityAI?

    End-to-end responses typically return in less than 8 seconds, thanks to optimized hybrid search and remote LLM fallbacks.

    Conclusion & Next Steps

    DivinityAI – Islamic Grounded RAG sets a new standard for accuracy in religious text retrieval and generation. Its corpus-locked approach, hybrid search, and deterministic verification make it an invaluable tool for scholars, students, and developers alike. Experience it yourself at https://muslim.nevatal.tech.

  • Getting Started with DivinityAI – Islamic Grounded RAG: A Hands-on Tutorial

    Getting Started with DivinityAI – Islamic Grounded RAG: A Hands-on Tutorial

    Key Takeaways: DivinityAI is a Retrieval-Augmented Generation (RAG) system that ensures zero hallucination by strictly grounding responses in authentic Quran and Hadith texts. Its deterministic citation verification and hybrid search capabilities make it a reliable tool for scholarly research and academic study.

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

    The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

    General-purpose large language models (LLMs) often hallucinate religious texts, leading to fabricated Quranic verses and incorrect Hadith attributions. DivinityAI addresses this critical issue by implementing a strict corpus-lock policy, ensuring every response is grounded in authenticated Quran and Hadith collections.

    Core Architecture & Technical Stack Deep-Dive

    Tech Stack Overview

    • Backend: Django ASGI / DRF
    • Frontend: React 19 / Vite
    • Database: ChromaDB
    • Embeddings: BGE-M3 Embeddings
    • Search: BM25 Sparse Search, Reciprocal Rank Fusion
    • LLM: OpenRouter (Gemini 2.5 Flash), Groq (Llama 3.3 70B)
    • Styling: Tailwind CSS v4

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI refuses to answer queries that cannot be verified from its locked corpus, ensuring zero hallucination.

    Five-Path Intent Router

    The system classifies queries into Quran verse, Hadith, Fiqh, Calculation, or Off-Domain categories, applying specialized retrieval strategies for each.

    Hybrid Search Capabilities

    Combining BM25 sparse matching with BGE-M3 dense embeddings, DivinityAI ensures comprehensive and accurate search results.

    Real-World Use Cases & Applications

    DivinityAI is ideal for scholarly research, authenticated Quran/Hadith reference discovery, and academic study of classical Arabic religious texts.

    How It Works: Step-by-Step Workflow

    1. User Query Submission
    2. Intent Classification
    3. Query Rewriting (HyDE & Sub-Queries)
    4. Hybrid Retrieval (BM25 + Dense)
    5. Citation Verification
    6. Grounded Generation
    7. Post-Generation Safety Checks

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional LLMs
    Hallucination Risk Zero High
    Citation Accuracy 95%+ Variable

    Frequently Asked Questions (FAQ)

    1. What is DivinityAI?

    DivinityAI is a Retrieval-Augmented Generation system designed for accurate Quran and Hadith searches, ensuring zero hallucination.

    2. How does DivinityAI ensure citation accuracy?

    It uses a deterministic citation verification chain, including exact match, normalized match, Levenshtein distance, and semantic checks.

    3. Can DivinityAI answer non-Islamic queries?

    No, DivinityAI strictly rejects off-domain queries, focusing solely on Quran and Hadith-related questions.

    Conclusion & Next Steps

    DivinityAI offers a reliable, hallucination-free solution for Quran and Hadith searches. Explore the live project at https://muslim.nevatal.tech to experience its capabilities firsthand.

  • DivinityAI – Islamic Grounded RAG: A Comparison & Alternatives Breakdown

    DivinityAI – Islamic Grounded RAG: A Comparison & Alternatives Breakdown

    Key Takeaways:

    • DivinityAI ensures zero hallucination in Quran and Hadith searches.
    • It uses a strict corpus-lock policy for authenticated results.
    • The system combines hybrid search techniques for accurate retrieval.
    • Real-world applications include scholarly research and academic study.
    Live Project Access: https://muslim.nevatal.tech

    The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

    General-purpose large language models (LLMs) often hallucinate religious texts, leading to inaccurate Quranic surah and Hadith citations. DivinityAI addresses this critical issue by implementing a strict corpus-lock policy, ensuring every response is grounded in authenticated Quranic verses and canonical Hadith collections.

    Core Architecture & Technical Stack Deep-Dive

    DivinityAI leverages a robust tech stack including Django ASGI / DRF, React 19 / Vite, ChromaDB, BGE-M3 Embeddings, BM25 Sparse Search, and Reciprocal Rank Fusion. The system integrates OpenRouter and Groq for efficient LLM orchestration and validation tasks.

    Intent Router & Scope Guard

    The Intent Router classifies queries into categories such as Quran verse, Hadith, Fiqh, and Calculation. The Scope Guard ensures that only queries within the system’s boundary conditions are processed.

    Hybrid Retrieval & Citation Verification

    DivinityAI combines BM25 sparse matching with BGE-M3 dense embeddings for hybrid retrieval. A deterministic citation verification chain ensures the accuracy of every citation.

    Key Features Breakdown & Practical Benefits

    • Strict Corpus-Lock Policy: Ensures responses are grounded in authenticated sources.
    • Intent Routing: Classifies queries for specialized retrieval strategies.
    • Hybrid Search: Combines sparse and dense embeddings for accurate retrieval.
    • Deterministic Citation Verification: Validates citations through a multi-layered verification process.

    Real-World Use Cases & Applications

    DivinityAI is ideal for scholarly research, authenticated Quran/Hadith reference discovery, and academic study of classical Arabic religious texts. It serves as a reference design pattern for high-stakes, domain-specific RAG architectures.

    How It Works: Step-by-Step Workflow

    1. User query is classified by the Intent Router.
    2. Scope Guard checks query boundaries.
    3. Query Rewriting generates HyDE and sub-queries.
    4. Hybrid Retrieval combines BM25 and dense embeddings.
    5. Citation Verifier validates retrieved citations.
    6. Grounded Generation synthesizes the final response.

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional Approaches
    Hallucination Prevention Yes No
    Corpus-Lock Policy Strict None
    Citation Verification Deterministic Manual
    Hybrid Retrieval Yes Single Method

    Frequently Asked Questions (FAQ)

    What is DivinityAI?

    DivinityAI is a Retrieval-Augmented Generation (RAG) system designed for accurate Quran and Hadith searches, ensuring zero hallucination.

    How does DivinityAI prevent hallucination?

    It implements a strict corpus-lock policy and a deterministic citation verification chain.

    What are the key features of DivinityAI?

    Key features include intent routing, hybrid search, and deterministic citation verification.

    What are the real-world applications of DivinityAI?

    Applications include scholarly research, academic study, and authenticated Quran/Hadith reference discovery.

    Conclusion & Next Steps

    DivinityAI – Islamic Grounded RAG sets a new standard for accurate Quran and Hadith searches. Explore the live project at https://muslim.nevatal.tech to experience its capabilities firsthand.

  • DivinityAI: A Grounded Islamic RAG AI System for Hallucination-Free Quran and Hadith Search

    DivinityAI: A Real-World Deployment & Case Study of a Grounded Islamic RAG AI System

    Key Takeaways: DivinityAI’s unique approach to Islamic RAG AI, its technical architecture, and real-world applications make it an exemplary model for high-stakes, zero-hallucination domain-specific RAG architectures.
    Live Project Access: https://muslim.nevatal.tech

    The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

    General-purpose large language models (LLMs) often hallucinate religious texts, fabricating Quranic verses and Hadith citations, which can lead to misinformation and misinterpretation. To address this challenge, DivinityAI was developed as a Retrieval-Augmented Generation (RAG) system with a strict corpus-lock policy, ensuring that all answers are grounded in authentic Islamic sources.

    Core Architecture & Technical Stack Deep-Dive

    Overview

    DivinityAI’s architecture consists of a Django backend, a React frontend, and a ChromaDB vector database. The system utilizes a hybrid search approach, combining BM25 sparse matching with BGE-M3 dense embeddings, and implements a deterministic citation verification chain.

    Technical Stack

    • Django ASGI / DRF
    • React 19 / Vite
    • ChromaDB
    • BGE-M3 Embeddings
    • BM25 Sparse Search
    • Reciprocal Rank Fusion
    • OpenRouter (Gemini 2.5 Flash)
    • Groq (Llama 3.3 70B)
    • Tailwind CSS v4

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI’s strict corpus-lock policy ensures that all answers are grounded in authentic Islamic sources, preventing hallucinations and providing reliable results.

    Intent Router and Scope Guard

    The intent router categorizes user queries, and the scope guard rejects off-domain queries, ensuring that the system only provides answers within its domain of expertise.

    Hybrid Search and Citation Verification

    The hybrid search approach combines the strengths of sparse and dense search methods, while the deterministic citation verification chain ensures the accuracy of citations.

    Real-World Use Cases & Applications

    DivinityAI has various real-world applications, including scholarly research, academic study, and reference design patterns for high-stakes, zero-hallucination domain-specific RAG architectures.

    How It Works: Step-by-Step Workflow

    1. User Query: The user submits a query to the system.
    2. Intent Routing: The intent router categorizes the query.
    3. Scope Guard: The scope guard checks the query’s relevance to the system’s domain.
    4. Hybrid Search: The system performs a hybrid search using BM25 and BGE-M3 embeddings.
    5. Citation Verification: The system verifies the accuracy of citations using a deterministic verification chain.
    6. Grounded Generation: The system generates an answer based on the verified 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 Routing Advanced intent routing Basic intent routing
    Citation Verification Deterministic citation verification No citation verification

    Frequently Asked Questions (FAQ)

    What is DivinityAI?
    DivinityAI is a Retrieval-Augmented Generation (RAG) system designed to provide accurate and reliable Quran and Hadith search results, free from hallucinations.
    How does DivinityAI ensure the accuracy of citations?
    DivinityAI uses a deterministic citation verification chain to ensure the accuracy of citations.
    Can I use DivinityAI for non-Islamic queries?
    No, DivinityAI is designed specifically for Islamic queries and rejects off-domain queries.

    Conclusion & Next Steps

    DivinityAI is a groundbreaking Islamic RAG AI system that provides accurate and reliable Quran and Hadith search results, free from hallucinations. With its robust architecture and technical stack, DivinityAI ensures the integrity of Islamic knowledge. To learn more about DivinityAI and experience its capabilities, visit https://muslim.nevatal.tech.

  • DivinityAI – Islamic Grounded RAG: Hallucination-Free Quran & Hadith AI Search

    DivinityAI – Islamic Grounded RAG: Hallucination-Free Quran & Hadith AI Search

    Key Takeaways

    • DivinityAI enforces a strict corpus-lock policy to ensure zero hallucination in Quranic verses and Hadith citations.
    • Features a five-path intent router, HyDE expansion, hybrid search, and deterministic citation verification.
    • Built with Django ASGI/DRF, React 19/Vite, ChromaDB, BGE-M3 embeddings, and more.
    • Optimized for Right-to-Left (RTL) Arabic typography and Uthmani script rendering.
    Live Project Access: https://muslim.nevatal.tech

    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 or merging distinct Hadith narrations. In a domain where textual accuracy is critical, these inaccuracies are unacceptable. DivinityAI was built to address this problem by implementing a strict “corpus-lock” policy, ensuring every answer is grounded in authenticated Quran and Hadith sources.

    Core Architecture & Technical Stack Deep-Dive

    Frontend & Backend

    The frontend is a React 19 single-page application styled with Tailwind CSS v4, optimized for Right-to-Left (RTL) Arabic typography and Uthmani script rendering. The backend is powered by Django ASGI/DRF, providing REST endpoints for query processing.

    Vector Database & Retrieval

    DivinityAI uses ChromaDB for vector storage and a hybrid retrieval system combining BM25 sparse matching with BGE-M3 dense embeddings. This ensures both exact keyword matches and semantic understanding of queries.

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI refuses to answer queries that cannot be verified from its locked corpus of Quran and Hadith texts, ensuring zero hallucination.

    Intent Routing & Scope Guard

    Queries are classified into five intents (Quran verse, Hadith, Fiqh, Calculation, Off-Domain) and routed accordingly. Off-domain queries are rejected with a polite message.

    Deterministic Citation Verification

    A four-tier verification chain (exact match, normalized, Levenshtein distance, semantic check) ensures all citations are accurate.

    Real-World Use Cases & Applications

    DivinityAI is ideal for scholarly research, authenticated Quran/Hadith reference discovery, and academic study of classical Arabic texts. It also serves as a reference design for high-stakes, zero-hallucination RAG architectures.

    How It Works: Step-by-Step Workflow

    1. User submits a query.
    2. Intent Router classifies the query.
    3. Scope Guard checks for off-domain queries.
    4. Query Rewriter applies HyDE and sub-query decomposition.
    5. Hybrid Retrieval combines BM25 and dense search results.
    6. Citation Verifier validates references.
    7. Grounded Generation compiles the final answer.
    8. Safety Layer audits the response for hallucinations.

    Comparison: DivinityAI vs Traditional Approaches

    Feature DivinityAI Traditional LLMs
    Hallucination Rate 0% (corpus-locked) High (unconstrained)
    Citation Accuracy 95%+ verified Unreliable
    Query Intent Handling Five-path router Single-path

    Frequently Asked Questions (FAQ)

    1. Does DivinityAI issue fatwas?

    No, it displays source materials and scholarly positions without generating new religious rulings.

    2. What languages does it support?

    Full support for Arabic, English, and Malay, with optimized RTL Arabic typography.

    3. How does it ensure citation accuracy?

    Through a four-tier verification chain: exact match, normalized, Levenshtein distance, and semantic check.

    4. Can it answer non-Islamic queries?

    No, off-domain queries are rejected with an informational message.

    Conclusion & Next Steps

    DivinityAI – Islamic Grounded RAG sets a new standard for accuracy in religious text retrieval, combining advanced AI techniques with strict verification protocols. To experience it firsthand, visit the live project at https://muslim.nevatal.tech.

  • DivinityAI – Islamic Grounded RAG: Hallucination-Free Quran & Hadith Search

    DivinityAI – Islamic Grounded RAG: Hallucination-Free Quran & Hadith Search

    In the realm of religious scholarship, textual accuracy isn’t just a preference—it’s a sacred obligation. General-purpose large language models (LLMs) frequently hallucinate Islamic religious texts, fabricating Quranic verses, misattributing Hadith narrations, or generating incorrect jurisprudential rulings. DivinityAI – Islamic Grounded RAG solves this critical problem through a Retrieval-Augmented Generation (RAG) system with an uncompromising corpus-lock policy.

    Key Takeaways

    • Strict corpus-lock ensures answers are exclusively grounded in authenticated Quran and Hadith sources
    • Five-path intent router classifies queries (Quran, Hadith, Fiqh, Calculation, Off-Domain) with confidence gating
    • Hybrid BM25 + BGE-M3 search with Reciprocal Rank Fusion maximizes retrieval accuracy
    • Deterministic four-tier citation verification chain eliminates hallucination risks
    • Pre-generation evidence checks and post-generation boundary detectors enforce scholarly integrity
    Live Project Access: https://muslim.nevatal.tech

    The Challenge: Why DivinityAI Was Built

    General-purpose LLMs exhibit three critical failures when handling Islamic texts:

    • Verse Fabrication: Inventing non-existent Quranic surah/ayah combinations
    • Hadith Corruption: Merging narrations or misattributing chains of transmission
    • Jurisprudential Errors: Generating fatwas unsupported by classical scholarship

    DivinityAI addresses these through architectural enforcement of:

    1. Source Lock - Only King Fahd Uthmani Quran and six canonical Hadith collections
    2. Verification Chains - Every citation validated before response generation
    3. Boundary Policies - Automatic rejection of unanswerable or off-domain queries

    Core Architecture & Technical Stack

    Pipeline Design

    The system implements a twelve-stage processing pipeline:

    1. Intent classification via Gemini 2.5 Flash
    2. Scope enforcement with confidence thresholding
    3. Query rewriting (HyDE + sub-query decomposition)
    4. Parallel BM25 (sparse) and BGE-M3 (dense) retrieval
    5. Reciprocal Rank Fusion to merge result sets
    6. Four-tier citation verification
    7. Evidence sufficiency evaluation
    8. Grounded generation with context-only prompting
    9. Fatwa boundary detection
    10. Hallucination verification
    11. Disclaimer injection
    12. Structured response assembly

    Component Stack

    Layer Technology Purpose
    Frontend React 19 + Vite + Tailwind CSS v4 RTL-optimized Arabic interface
    Backend Django ASGI + DRF Query orchestration
    Vector DB ChromaDB Quran/Hadith embeddings
    Sparse Search BM25 Exact token matching
    Dense Search BGE-M3 Semantic retrieval
    LLM Routing OpenRouter (Gemini 2.5 Flash) Primary generation
    Validation Groq (Llama 3.3 70B) Semantic verification

    Key Features Breakdown

    Deterministic Citation Verification

    Implements a cascading validation chain:

    1. Exact string match against source texts
    2. Normalized matching (diacritic-insensitive)
    3. Levenshtein distance threshold (85%+)
    4. Semantic equivalence confirmation via Llama 3.3

    Hybrid Retrieval System

    Combines strengths of two search methodologies:

    • BM25 Sparse: Precise matching on normalized Arabic text
    • BGE-M3 Dense: Cross-lingual semantic understanding
    • RRF Fusion: Blends rankings from both approaches

    Fatwa Boundary Detection

    Rule-based triggers append disclaimers when detecting:

    - Inheritance calculations (Mirath)
    - Medical ethics questions
    - Marriage/divorce rulings
    - Any potentially evolving jurisprudential matter

    Real-World Use Cases

    • Scholarly Research: Authenticated reference discovery without contamination risk
    • Comparative Analysis: Cross-source verification across Hadith collections
    • Architectural Pattern: Reference design for high-stakes RAG implementations (legal/medical)

    How It Works: Step-by-Step

    Example Query: “What did the Prophet say about kindness to parents?”

    1. Intent router classifies as hadith with 92% confidence
    2. HyDE generates hypothetical authentic response pattern
    3. BM25 finds matches for “kindness parents” in Arabic text
    4. BGE-M3 retrieves semantically similar narrations
    5. RRF merges and re-ranks top 10 candidates
    6. Verifier confirms Sahih Bukhari 5971 matches exactly
    7. Llama 3.3 confirms evidence sufficiency
    8. Gemini generates response strictly from verified chunks
    9. Safety layer adds “consult scholar” disclaimer

    Comparison: DivinityAI vs Traditional Approaches

    Criteria General LLM DivinityAI
    Citation Accuracy ≈40-60% >95%
    Hallucination Rate 15-25% <1%
    Jurisprudential Safety None Boundary checks
    Query Rejection Rare Confidence-gated

    Frequently Asked Questions (FAQ)

    1. What makes DivinityAI different from ChatGPT for Islamic questions?

    DivinityAI implements architectural enforcement of zero hallucination through its corpus-lock policy and deterministic verification chains, whereas ChatGPT has no mechanisms to prevent fabrication of religious texts.

    2. How does the system handle differences between Madhahib (schools of thought)?

    It surfaces authentic source texts with clear attribution but avoids synthesizing new rulings. For fiqh questions, it retrieves and presents relevant positions from primary sources with appropriate contextual disclaimers.

    3. Can I contribute additional Hadith collections to the corpus?

    The current implementation intentionally limits sources to the most universally authenticated collections to maintain verifiability standards. Expansion would require rigorous scholarly validation.

    4. What languages does the system support?

    Query input accepts Arabic, English, and Malay, while responses maintain original Arabic script with parallel translations when available.

    Conclusion & Next Steps

    DivinityAI represents a significant advancement in domain-specific RAG architectures, demonstrating how to achieve verifiable accuracy in high-stakes knowledge domains. The system’s strict verification chains and boundary enforcement provide a template for applications in legal, medical, and other precision-critical fields.

    Experience the system firsthand at: https://muslim.nevatal.tech

    For technical teams, the architectural patterns demonstrated—particularly the hybrid retrieval system and deterministic verification approaches—offer immediately applicable insights for building reliable AI systems.

  • DivinityAI: A Hallucination-Free Grounded Islamic RAG AI System

    DivinityAI: A Hallucination-Free Grounded Islamic RAG AI System

    Key Takeaways:

    • DivinityAI ensures zero hallucination in Quran and Hadith research.
    • Implements a strict corpus-lock policy for authentic citations.
    • Uses advanced retrieval techniques like HyDE and BM25 sparse search.
    • Provides deterministic citation verification for accurate results.
    Live Project Access: https://muslim.nevatal.tech

    The Challenge: Why DivinityAI – Islamic Grounded RAG Was Built

    General-purpose large language models (LLMs) often hallucinate religious texts, leading to inaccurate Quranic verses and Hadith citations. In a domain where textual accuracy is critical, these LLMs are unreliable and potentially misleading. DivinityAI addresses this challenge by implementing a strict “corpus-lock” policy, ensuring every statement is grounded in authenticated Quran and Hadith collections.

    Core Architecture & Technical Stack Deep-Dive

    DivinityAI’s architecture is built around a Django backend serving a React 19 SPA, utilizing advanced technologies like ChromaDB, BGE-M3 embeddings, and BM25 sparse search. The system ensures low-latency responses and high citation accuracy, making it a reliable tool for Islamic scholarly research.

    Tech Stack Overview

    • Backend: Django ASGI / DRF
    • Frontend: React 19 / Vite
    • Vector Database: ChromaDB
    • Embeddings: BGE-M3
    • Sparse Search: BM25
    • LLM Engine: OpenRouter (Gemini 2.5 Flash), Groq (Llama 3.3 70B)
    • Styling: Tailwind CSS v4

    Key Features Breakdown & Practical Benefits

    DivinityAI offers several advanced features designed to ensure accuracy and reliability in Islamic text research:

    Strict Corpus-Lock Policy

    The system refuses to answer questions that cannot be verified from authenticated Quran and Hadith sources, ensuring zero hallucination.

    Five-Path Intent Router

    Queries are classified into Quran verse, Hadith, Fiqh, Calculation, or Off-Domain categories, with specialized retrieval strategies for each.

    Hybrid Retrieval Techniques

    Combines BM25 sparse matching with BGE-M3 dense embeddings for comprehensive search results.

    Deterministic Citation Verification

    Ensures citations are verified through a four-tier validation chain (exact match, normalized, Levenshtein distance, semantic check).

    Real-World Use Cases & Applications

    DivinityAI is invaluable for scholarly research, academic study, and high-stakes domain-specific RAG architectures. Its deterministic citation verification makes it a reliable tool for Quran and Hadith reference discovery.

    How It Works: Step-by-Step Workflow

    The query execution pipeline involves intent classification, scope enforcement, query rewriting, hybrid retrieval, citation verification, and grounded generation. Each step ensures the response is accurate and grounded in authentic sources.

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional Approaches
    Hallucination Risk Zero High
    Citation Verification Deterministic Probabilistic
    Retrieval Techniques Hybrid (BM25 + BGE-M3) Single Method

    Frequently Asked Questions (FAQ)

    1. What is DivinityAI?
    DivinityAI is a Retrieval-Augmented Generation (RAG) system designed for accurate Quran and Hadith research.

    2. How does DivinityAI ensure accuracy?
    By implementing a strict corpus-lock policy and deterministic citation verification.

    3. What are the key features of DivinityAI?
    Strict corpus-lock, five-path intent router, hybrid retrieval, and deterministic citation verification.

    4. Who can benefit from DivinityAI?
    Scholars, researchers, and students focused on Islamic texts.

    Conclusion & Next Steps

    DivinityAI sets a new standard for accurate and reliable Islamic text research. Its advanced features and strict verification processes ensure zero hallucination, making it an indispensable tool for scholars and researchers. Explore DivinityAI today at https://muslim.nevatal.tech.

  • DivinityAI – Islamic Grounded RAG: A Hallucination-Free Quran & Hadith Search AI

    DivinityAI – Islamic Grounded RAG: A Hallucination-Free Quran & Hadith Search AI

    Key Takeaways:

    • DivinityAI ensures zero hallucination of Quranic verses and Hadith citations.
    • It implements a strict corpus-lock policy, verifying all references against authenticated sources.
    • The system supports multilingual inputs and optimized Right-to-Left (RTL) Arabic typography.
    • Real-world applications include scholarly research, academic study, and high-stakes domain-specific RAG architectures.
    Live Project Access: https://muslim.nevatal.tech

    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, and merging distinct prophetic sayings. In a domain where textual accuracy is critical, these inaccuracies are unacceptable. DivinityAI addresses this challenge by providing a Retrieval-Augmented Generation (RAG) system that ensures every answer is grounded in authenticated Quran and Hadith sources.

    Core Architecture & Technical Stack Deep-Dive

    System Components & Interface Boundaries

    DivinityAI is built as a modular application with a Django backend serving a React SPA, deploying local embeddings and remote LLM orchestrators. The system integrates ChromaDB for vector storage, BM25 for sparse search, and BGE-M3 embeddings for dense retrieval.

    Ingestion & Arabic NLP Pipeline

    To index classical Arabic scripts accurately, the ingestion pipeline implements a custom preprocessing normalization stage, including NFKD normalization, stripping diacritics, and alef normalization. This ensures accurate retrieval and embedding generation.

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI refuses to answer queries that cannot be verified from the retrieved sources, ensuring zero hallucination.

    Five-Path Intent Router

    The system classifies incoming queries into Quran verse, Hadith, Fiqh, Calculation, or Off-Domain categories, applying specialized retrieval strategies for each.

    Hybrid BM25 Sparse Matching

    Combining BM25 sparse matching with BGE-M3 dense embeddings, DivinityAI captures both exact keyword matches and semantic concepts.

    Real-World Use Cases & Applications

    DivinityAI is invaluable for scholarly research, academic study of classical Arabic religious texts, and as a reference design pattern for high-stakes domain-specific RAG architectures.

    How It Works: Step-by-Step Workflow

    From intent classification to citation verification and grounded generation, DivinityAI’s workflow ensures every step adheres to strict accuracy standards.

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional LLMs
    Hallucination Rate Zero High
    Citation Verification Deterministic Non-existent
    Intent Routing Five-path None

    Frequently Asked Questions (FAQ)

    What makes DivinityAI different from other AI systems?

    DivinityAI implements a strict corpus-lock policy and deterministic citation verification, ensuring zero hallucination and accurate references.

    Can DivinityAI issue fatwas?

    No, DivinityAI displays source materials and scholarly positions without generating new religious rulings.

    Is DivinityAI multilingual?

    Yes, DivinityAI supports Arabic, English, and Malay inputs.

    How fast is DivinityAI?

    End-to-end responses are returned in less than 8 seconds.

    Conclusion & Next Steps

    DivinityAI – Islamic Grounded RAG sets a new standard for accuracy and reliability in Quran and Hadith search. Explore the live project at https://muslim.nevatal.tech.

  • DivinityAI – Islamic Grounded RAG: The Hallucination-Free Quran and Hadith Search System

    DivinityAI – Islamic Grounded RAG: The Hallucination-Free Quran and Hadith Search System

    Key Takeaways:

    • DivinityAI ensures zero hallucination by grounding every answer in authenticated Quran and Hadith texts.
    • Features include intent routing, HyDE expansion, hybrid search, and deterministic citation verification.
    • Built with Django ASGI, React 19, ChromaDB, and advanced AI models like BGE-M3 and Llama 3.3 70B.
    • Real-world applications include scholarly research, academic study, and high-stakes domain-specific RAG architectures.
    Live Project Access: https://muslim.nevatal.tech

    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, and synthesizing inaccurate Islamic jurisprudence (Fiqh) fatwas. In a domain where textual accuracy is critical, these hallucinations are unreliable and potentially misleading. DivinityAI addresses this challenge by implementing a strict “corpus-lock” policy, ensuring every answer is grounded in authenticated Quran and Hadith texts.

    Core Architecture & Technical Stack Deep-Dive

    DivinityAI is built as a modular application with a Django backend serving a React SPA, deploying local embeddings and remote LLM orchestrators. The tech stack includes:

    • Frontend: React 19 single-page application styled using Tailwind CSS v4, optimized for Right-to-Left Arabic typography.
    • Backend: Django web service with Django REST Framework (DRF) for REST endpoints.
    • Vector Database: ChromaDB server for storing Quran and Hadith embeddings.
    • Sparse Index: BM25 sparse search for exact-token matches.
    • Embedding Model: BGE-M3 embeddings for semantic search.
    • LLM Engine: OpenRouter for text generation and Groq for high-speed validation tasks.

    Key Features Breakdown & Practical Benefits

    Strict Corpus-Lock Policy

    DivinityAI refuses to answer queries that cannot be verified from authenticated Quran and Hadith texts, ensuring zero hallucination.

    Five-Path Intent Router

    Every user query is classified into one of five intents: Quran verse, Hadith, Fiqh, Calculation, or Off-Domain, with specialized retrieval strategies for each.

    Hybrid Search

    Combines BM25 sparse matching with BGE-M3 dense embeddings for comprehensive retrieval.

    Deterministic Citation Verification

    Validates citations through a 4-tier verification chain, ensuring every reference is accurate.

    Pre- and Post-Generation Checks

    Pre-generation evidence sufficiency checks and post-generation fatwa boundary/hallucination detectors ensure the integrity of responses.

    Real-World Use Cases & Applications

    DivinityAI is designed for:

    • Scholarly research and authenticated Quran/Hadith reference discovery.
    • Academic study of classical Arabic religious texts and cross-source comparative analysis.
    • Reference design pattern for high-stakes zero-hallucination domain-specific RAG architectures.

    How It Works: Step-by-Step Workflow

    The query execution pipeline includes:

    1. Intent Classification: Routes the query to the appropriate intent.
    2. Scope Enforcement: Rejects off-domain queries.
    3. Query Rewriting: Expands and decomposes complex queries.
    4. Hybrid Retrieval: Combines BM25 and BGE-M3 searches.
    5. Citation Verification: Validates references through a 4-tier chain.
    6. Grounded Generation: Synthesizes answers strictly from verified sources.
    7. Safety Layer: Detects hallucinations and ensures compliance with fatwa boundaries.

    Comparison: DivinityAI – Islamic Grounded RAG vs Traditional Approaches

    Feature DivinityAI Traditional Approaches
    Hallucination Risk Zero High
    Citation Accuracy 95%+ Variable
    Intent Routing Five-path classification None
    Hybrid Search BM25 + BGE-M3 Single method

    Frequently Asked Questions (FAQ)

    What is DivinityAI?

    DivinityAI is a Retrieval-Augmented Generation system designed to provide hallucination-free Quran and Hadith search results with deterministic citation verification.

    How does DivinityAI ensure accuracy?

    DivinityAI implements a strict corpus-lock policy, hybrid search, and a 4-tier citation verification chain.

    What languages does DivinityAI support?

    DivinityAI supports Arabic, English, and Malay inputs.

    Can DivinityAI issue fatwas?

    No, DivinityAI displays source materials and scholarly positions without generating new religious rulings.

    Is DivinityAI free to use?

    Yes, DivinityAI operates on a 100% free-tier model.

    Conclusion & Next Steps

    DivinityAI – Islamic Grounded RAG sets a new standard for hallucination-free Quran and Hadith search systems. Its strict corpus-lock policy, advanced intent routing, and deterministic citation verification ensure unparalleled accuracy. Explore the live project at https://muslim.nevatal.tech to experience its capabilities firsthand.