Tag: Django

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

  • AI English Grammar Diagnostic Platform: Adaptive Learning with OpenRouter & Django

    AI English Grammar Diagnostic Platform: Adaptive Learning with OpenRouter & Django

    Mastering English grammar requires precise identification of weaknesses and targeted practice—traditionally a time-consuming manual process. The English Practice Diagnostic platform revolutionizes this with AI-powered adaptive assessments, combining cloud-based OpenRouter question generation with persistent local question banks for uninterrupted learning.

    Key Takeaways

    • AI-adaptive diagnostics pinpoint grammar weaknesses with CEFR-aligned scoring
    • Fault-tolerant architecture blends OpenRouter LLMs with offline-ready SQLite question banks
    • Persistent test sessions survive container restarts via Docker-mounted databases
    • Educators can generate customized assessments with safety-checked prompts
    Live Project Access: https://english.nevatal.id

    The Challenge: Why English Practice Diagnostic Was Built

    Traditional English assessments often fail to dynamically adapt to learners’ skill levels or provide immediate, actionable feedback. Most platforms either rely entirely on static question banks or require constant internet connectivity for AI-powered features—creating accessibility and reliability challenges.

    Core Architecture & Technical Stack Deep-Dive

    AI Question Generation Engine

    At its core, the platform leverages OpenRouter’s API to dynamically generate grammar questions using GPT-4o-mini and Gemma LLMs. Each request undergoes:

    def generate_question(topic, difficulty):
        prompt = f"Generate a {difficulty} English grammar question about {topic}"
        return openrouter.Completion.create(
            model="gpt-4o-mini",
            prompt=prompt,
            safety_check=True
        )

    Fault-Tolerant Data Layer

    A dual-storage architecture ensures zero downtime:

    • Primary: OpenRouter API for fresh question generation
    • Fallback: Local SQLite database with 500+ pre-generated questions

    Key Features Breakdown & Practical Benefits

    Adaptive Diagnostic Testing

    The platform employs a hidden-topic algorithm that dynamically adjusts question difficulty based on real-time performance, delivering accurate CEFR (Common European Framework of Reference) alignment within 15 questions.

    Persistent Learning Environment

    Through Docker volume mounts and SQLite optimizations, the system maintains:

    • Active test sessions through container restarts
    • User progress tracking across devices
    • Educator-customized question banks

    Real-World Use Cases & Applications

    From IELTS candidates identifying preposition weaknesses to ESL teachers generating class-specific diagnostics, the platform serves diverse needs while demonstrating robust AI/cloud integration patterns.

    How It Works: Step-by-Step Workflow

    1. User begins diagnostic (online or offline)
    2. System selects questions from OpenRouter or local bank
    3. Adaptive algorithm adjusts subsequent questions
    4. Detailed report with CEFR alignment and study plan

    Comparison: English Practice Diagnostic vs Traditional Approaches

    Feature Traditional Tests English Practice Diagnostic
    Question Generation Static bank AI-dynamic + local fallback
    Adaptivity Linear progression Real-time difficulty adjustment
    Offline Capability Usually none Persistent SQLite database

    Frequently Asked Questions (FAQ)

    How does the platform ensure question quality?

    All AI-generated questions undergo syntactic validation and difficulty scoring before being presented or added to the local bank.

    Can educators customize assessments?

    Yes, through the admin interface, teachers can weight specific grammar topics or inject custom questions while retaining AI adaptivity.

    What happens during OpenRouter outages?

    The system automatically fails over to the local question bank within 300ms, with no visible interruption to users.

    Conclusion & Next Steps

    The English Practice Diagnostic demonstrates how carefully architected AI systems can enhance language learning while maintaining reliability. By combining cloud-based intelligence with persistent local storage, it delivers both innovation and practical resilience.

    Experience the platform: https://english.nevatal.id

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

  • AI-Powered English Grammar Diagnostic: Adaptive Learning with OpenRouter & Django

    AI-Powered English Grammar Diagnostic: Adaptive Learning with OpenRouter & Django

    Key Takeaways

    • AI-driven adaptive testing identifies specific English grammar weaknesses
    • Combines cloud-based OpenRouter LLMs with persistent local question banks
    • Detailed diagnostic reports with CEFR alignment and study suggestions
    • Fault-tolerant architecture ensures zero-downtime assessments
    Live Project Access: https://english.nevatal.id

    The Challenge: Why English Practice Diagnostic Was Built

    Traditional English grammar assessment tools often fail to provide personalized, adaptive learning experiences. Most platforms use static question banks that don’t dynamically adjust to a learner’s skill level or identify specific weaknesses with precision. The English Practice Diagnostic was created to solve these challenges through AI-powered adaptive testing.

    Core Architecture & Technical Stack Deep-Dive

    Backend Foundation

    The system is built on Django 5 with Python 3.12, leveraging Django’s ORM for data persistence. The architecture features a mounted SQLite database that survives container restarts, ensuring test session continuity.

    AI Integration Layer

    The platform integrates with OpenRouter API to access cutting-edge LLMs (GPT-4o-mini and Gemma) for dynamic question generation. A sophisticated prompt engineering system ensures generated questions meet grammatical accuracy standards.

    Deployment Infrastructure

    The application runs on Gunicorn with WhiteNoise for static files, containerized using Docker Compose for easy deployment. Bootstrap 5 provides responsive frontend components.

    Key Features Breakdown & Practical Benefits

    Adaptive Diagnostic Testing

    The system employs an algorithm that adjusts question difficulty based on user responses, pinpointing specific grammar weaknesses with precision.

    Fault-Tolerant Question Generation

    When OpenRouter connectivity fails, the system automatically falls back to the local question bank, ensuring uninterrupted testing sessions.

    Detailed Performance Analytics

    Users receive comprehensive reports showing CEFR alignment, grammatical explanations, and personalized study recommendations.

    Real-World Use Cases & Applications

    • Individual learners identifying grammar weaknesses for targeted improvement
    • ESL students preparing for TOEFL/IELTS exams with adaptive practice tests
    • Educators generating customized grammar assessments for classes
    • Showcase of robust AI architectures combining cloud and local resources

    How It Works: Step-by-Step Workflow

    1. User initiates diagnostic test session
    2. System evaluates initial responses to determine skill level
    3. AI generates subsequent questions targeting potential weak areas
    4. Final report provides detailed analysis and learning path

    Comparison: English Practice Diagnostic vs Traditional Approaches

    Feature English Practice Diagnostic Traditional Tools
    Question Adaptation Dynamic, AI-powered Static question banks
    Fault Tolerance Automatic fallback to local questions Single point of failure
    Diagnostic Depth Detailed CEFR-aligned analysis Basic scoring only

    Frequently Asked Questions (FAQ)

    How accurate are the AI-generated questions?

    The system employs multiple validation layers including prompt engineering templates and human-curated fallback questions to ensure grammatical accuracy.

    Can I use this without internet access?

    Yes, the local question bank allows for complete offline functionality when needed.

    How does the adaptive algorithm work?

    The system uses response patterns to identify knowledge gaps and adjusts question difficulty accordingly, similar to computerized adaptive testing used in major proficiency exams.

    Is my test progress saved if I close the browser?

    Yes, the mounted SQLite database persists all test sessions through container restarts and browser refreshes.

    Conclusion & Next Steps

    The English Practice Diagnostic represents a significant advancement in personalized language learning technology. By combining AI-powered question generation with robust local fallback systems, it delivers reliable, adaptive assessments for English learners at all levels.

    Experience the future of grammar diagnostics today at https://english.nevatal.id.

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

  • AI English Grammar Diagnostic Platform: Revolutionizing Language Learning

    AI English Grammar Diagnostic Platform: Revolutionizing Language Learning

    Key Takeaways:

    • AI-powered adaptive grammar testing identifies hidden weaknesses instantly.
    • Dynamic question generation using OpenRouter LLMs ensures diverse and relevant questions.
    • Persistent question banks and active test sessions survive container restarts.
    • Detailed diagnostic breakdowns align with CEFR standards for targeted learning.
    Live Project Access: https://english.nevatal.id

    The Challenge: Why English Practice Diagnostic Was Built

    Traditional English grammar diagnostic tools often fall short in providing personalized and adaptive learning experiences. Learners struggle to identify specific grammar weaknesses, and educators face challenges in generating customized assessment sessions. The English Practice Diagnostic platform was built to address these gaps, leveraging AI and advanced technologies to revolutionize language learning.

    Core Architecture & Technical Stack Deep-Dive

    Tech Stack Overview

    The platform is built using Django 5 and Python 3.12, ensuring robust and scalable performance. It integrates OpenRouter API for dynamic question generation, utilizing GPT-4o-mini and Gemma models. SQLite with Data Persistence ensures that question banks and active test sessions survive container restarts. Gunicorn and WhiteNoise optimize web server performance, while Docker Compose facilitates seamless deployment.

    Adaptive Hidden-Topic Diagnostic Testing

    The platform employs adaptive algorithms to identify hidden grammar weaknesses, providing instant score evaluations. This ensures that learners receive targeted feedback and can focus on areas needing improvement.

    Dynamic AI Question Generation

    Powered by OpenRouter LLMs, the platform generates diverse and relevant questions dynamically. Prompt safety checks ensure that generated questions are appropriate and aligned with learning objectives.

    Persistent Question Bank

    Automatic fallback to a local question bank guarantees zero-downtime and offline testing. This fault-tolerant architecture ensures uninterrupted learning experiences.

    Key Features Breakdown & Practical Benefits

    Instant Score Evaluations

    Learners receive instant feedback on their performance, allowing them to identify and address grammar weaknesses promptly.

    Detailed Diagnostic Breakdown

    The platform provides a comprehensive diagnostic breakdown, aligning with CEFR standards. Grammatical explanations and study suggestions guide learners towards targeted improvement.

    Customizable Assessment Sessions

    Educators can generate customizable grammar assessment sessions automatically, saving time and effort while ensuring relevance and accuracy.

    Real-World Use Cases & Applications

    The English Practice Diagnostic platform is invaluable for individual English learners, ESL, TOEFL, and IELTS students, and educators. It aids in identifying specific grammar weaknesses, preparing for diagnostic proficiency exams, and generating customizable assessment sessions automatically.

    How It Works: Step-by-Step Workflow

    The platform begins with an adaptive diagnostic test, identifying hidden grammar weaknesses. Dynamic question generation ensures diverse and relevant questions. Persistent question banks and active test sessions survive container restarts, providing a seamless learning experience. Detailed diagnostic breakdowns guide learners towards targeted improvement.

    Comparison: English Practice Diagnostic vs Traditional Approaches

    Feature English Practice Diagnostic Traditional Approaches
    Adaptive Testing Yes No
    Dynamic Question Generation Yes No
    Persistent Question Bank Yes No
    Detailed Diagnostic Breakdown Yes Limited

    Frequently Asked Questions (FAQ)

    What is the English Practice Diagnostic platform?

    The English Practice Diagnostic platform is an AI-powered web platform designed to provide adaptive grammar testing and detailed diagnostic breakdowns for English learners.

    How does the platform generate questions?

    The platform uses OpenRouter API to generate dynamic and relevant questions, ensuring diverse and appropriate content.

    Can the platform be used offline?

    Yes, the platform automatically falls back to a local question bank, ensuring zero-downtime and offline testing.

    Who can benefit from using this platform?

    Individual English learners, ESL, TOEFL, and IELTS students, and educators can all benefit from using the platform.

    Conclusion & Next Steps

    The AI-powered English Practice Diagnostic platform revolutionizes language learning by providing adaptive grammar testing, dynamic question generation, and persistent question banks. Visit https://english.nevatal.id to experience the future of English grammar diagnostics.

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

  • AI English Grammar Diagnostic Platform: Adaptive Learning with OpenRouter & Django

    AI English Grammar Diagnostic Platform: Adaptive Learning with OpenRouter & Django

    Modern language learning demands precise diagnostic tools capable of identifying grammatical weaknesses with surgical precision. The English Practice Diagnostic platform delivers exactly this – combining cutting-edge AI question generation via OpenRouter with robust Django architecture and fault-tolerant local question banks.

    Key Takeaways

    • AI-powered adaptive grammar diagnostics with instant CEFR-aligned scoring
    • Hybrid architecture blending OpenRouter LLMs (GPT-4o-mini/Gemma) with local SQLite fallback
    • Persistent question banks and active sessions surviving container restarts
    • Detailed grammatical explanations and targeted study recommendations
    Live Project Access: https://english.nevatal.id

    The Challenge: Why English Practice Diagnostic Was Built

    Traditional grammar assessments suffer from static question banks that quickly become predictable, while pure AI solutions risk downtime when API services fail. This platform addresses three critical gaps:

    1. Dynamic Question Generation

    OpenRouter-powered AI creates fresh, targeted grammar questions in real-time based on user performance – no two tests are identical.

    2. Fault-Tolerant Architecture

    The system automatically falls back to local SQLite question banks during API outages, ensuring uninterrupted learning sessions.

    3. Persistent Learning Context

    Mounted database volumes preserve question history and active test sessions across container redeployments.

    Core Architecture & Technical Stack Deep-Dive

    The platform’s hybrid architecture delivers reliability through strategic redundancy:

    Backend Foundation

    • Django 5: Robust Python framework handling request routing and business logic
    • SQLite: Persistent storage for question banks with Docker volume mounts
    • Gunicorn: Production-grade WSGI server for Django deployment
    • WhiteNoise: Static file serving optimized for Bootstrap 5 frontend

    AI Integration Layer

    • OpenRouter API: Dynamic question generation via GPT-4o-mini and Gemma models
    • Prompt Safeguards: Validation checks preventing malformed LLM outputs
    • Fallback Mechanism: Seamless transition to local question bank when APIs fail

    Key Features Breakdown & Practical Benefits

    Adaptive Hidden-Topic Diagnostics

    The system employs Item Response Theory (IRT) principles to:

    • Dynamically adjust question difficulty based on user responses
    • Identify latent grammatical weaknesses through response patterns
    • Generate CEFR-aligned proficiency scores with sub-skill breakdowns

    Self-Healing Question Pipeline

    if openrouter_status == 'healthy':
        generate_ai_questions()
    else:
        load_local_questions()
        log_fallback_event()

    Real-World Use Cases & Applications

    • ESL Students: Identify specific grammar gaps before high-stakes exams
    • IELTS Preparation: Targeted practice aligned with test scoring rubrics
    • Classroom Teachers: Generate customized diagnostic sets in seconds
    • Self-Learners: Continuously adaptive practice without repetition

    How It Works: Step-by-Step Workflow

    1. User initiates diagnostic session (adaptive or topic-specific)
    2. System evaluates available AI services status
    3. Questions generated via OpenRouter or loaded from local bank
    4. Responses analyzed using IRT models
    5. Instant scoring with grammatical explanations
    6. Results persisted for longitudinal tracking

    Comparison: English Practice Diagnostic vs Traditional Approaches

    Feature This Platform Static Tests Pure AI Tools
    Question Variety Dynamic generation + local bank Fixed question set API-dependent only
    Uptime Reliability Dual-source fallback Always available Vulnerable to outages
    Personalization Adaptive difficulty One-size-fits-all Variable quality

    Frequently Asked Questions (FAQ)

    How does the diagnostic adapt to my skill level?

    The system employs psychometric modeling to adjust question difficulty based on your response patterns, continuously refining its understanding of your abilities.

    What happens during OpenRouter API outages?

    The platform automatically switches to its curated local question bank, ensuring zero interruption to your learning session.

    Can educators customize the diagnostic content?

    Yes, instructors can specify grammatical focus areas and difficulty parameters that the AI incorporates into generated questions.

    How are results aligned with CEFR standards?

    Each question is tagged with CEFR levels (A1-C2), and your performance across these tags generates your proficiency profile.

    Conclusion & Next Steps

    The English Practice Diagnostic represents a significant evolution in language assessment technology – combining the flexibility of modern AI with the reliability of traditional testing methods. Its hybrid architecture offers a blueprint for building fault-tolerant educational applications in an era of increasingly unstable API dependencies.

    Experience adaptive English diagnostics today: https://english.nevatal.id

  • Nevatal URL Shortener: A High-Performance Django Microservice with Redis Caching

    Nevatal URL Shortener: A High-Performance Django Microservice with Redis Caching

    Key Takeaways:

    • Production-ready URL shortening microservice built with Django 5, PostgreSQL 16, and Redis 7.
    • Ultra-low latency redirects powered by Redis caching.
    • Detailed click analytics, referrer tracking, and dashboard stats.
    • IP-based rate limiting with graceful 429 backoff handling.
    • Production Dockerized deployment with isolated network bridges.
    Live Project Access: https://url.nevatal.tech

    The Challenge: Why Nevatal URL Shortener Was Built

    In today’s digital landscape, URL shortening is a critical component for efficient link management, marketing campaigns, and internal routing. However, many existing solutions fall short in terms of performance, scalability, and analytics. Nevatal URL Shortener was built to address these challenges, offering a robust, high-performance microservice that combines Redis caching, PostgreSQL persistence, and detailed analytics.

    Core Architecture & Technical Stack Deep-Dive

    Django 5: The Backbone of Nevatal

    Django 5 serves as the core framework for Nevatal URL Shortener, providing a robust and scalable foundation. Its built-in ORM and middleware support make it ideal for handling URL shortening logic, database interactions, and request processing.

    PostgreSQL 16: Reliable Persistence

    PostgreSQL 16 ensures reliable data persistence for all shortened URLs and their associated metadata. Its advanced indexing and query optimization features guarantee quick lookups and efficient storage.

    Redis 7: Ultra-Low Latency Caching

    Redis 7 powers the caching layer, enabling ultra-low latency redirects. By storing frequently accessed URLs in memory, Redis minimizes database load and ensures rapid response times.

    Nginx: High-Performance Web Server

    Nginx acts as the web server, handling incoming requests and routing them to the appropriate backend services. Its asynchronous architecture ensures high concurrency and low latency.

    Docker Compose: Streamlined Deployment

    Docker Compose simplifies the deployment process, allowing for easy setup and management of the microservice. Isolated network bridges ensure secure and efficient communication between containers.

    Key Features Breakdown & Practical Benefits

    Custom Slug Generation

    Nevatal generates custom slugs with database-level uniqueness validation, ensuring that each shortened URL is unique and easily identifiable.

    Detailed Click Analytics

    Track clicks, referrers, and user agents with precision. The built-in dashboard provides comprehensive insights into link performance and traffic attribution.

    IP-Based Rate Limiting

    Protect your service from abuse with IP-based rate limiting. Graceful 429 backoff handling ensures that legitimate users are not adversely affected.

    Production Dockerized Deployment

    With Docker Compose, Nevatal is ready for production deployment out of the box. Isolated network bridges enhance security and performance.

    Real-World Use Cases & Applications

    Nevatal URL Shortener is versatile and can be used in various scenarios, including:

    • Branded marketing link management and campaign tracking.
    • Internal microservice URL routing and API endpoint aliasing.
    • Fast link analytics and traffic attribution.

    How It Works: Step-by-Step Workflow

    1. User submits a long URL via the web interface or API.
    2. The system generates a unique custom slug and stores the URL in PostgreSQL.
    3. Redis caches the shortened URL for rapid retrieval.
    4. When a user accesses the shortened URL, Redis serves the redirect instantly.
    5. Click analytics are recorded and displayed in the dashboard.

    Comparison: Nevatal URL Shortener vs Traditional Approaches

    Feature Nevatal URL Shortener Traditional Approaches
    Latency Ultra-low (Redis caching) Higher (Database-dependent)
    Analytics Detailed click analytics Basic or None
    Scalability High (Dockerized deployment) Limited
    Rate Limiting IP-based with graceful backoff Basic or None

    Frequently Asked Questions (FAQ)

    What is Nevatal URL Shortener?

    Nevatal URL Shortener is a production-ready Django microservice for URL shortening, featuring Redis caching, PostgreSQL persistence, and detailed click analytics.

    How does Nevatal ensure low latency?

    Nevatal uses Redis caching to store frequently accessed URLs, enabling ultra-low latency redirects.

    Can I customize the slugs?

    Yes, Nevatal generates custom slugs with database-level uniqueness validation.

    Is Nevatal suitable for production use?

    Absolutely. Nevatal is Dockerized and ready for production deployment with isolated network bridges.

    How do I access the live project?

    You can access the live project at https://url.nevatal.tech.

    Conclusion & Next Steps

    Nevatal URL Shortener is a powerful, production-ready microservice designed for high-performance URL shortening. With its advanced features and robust architecture, it’s an ideal solution for developers and businesses alike. Ready to optimize your link management? Visit https://url.nevatal.tech to get started today.

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