Back to home

Trust

How our AI works

Every answer is retrieved, not invented. Every citation is validated before you see it. When we cannot verify something, we say so.

Why this matters

Most Islamic AI products use large language models to generate answers from their training data. The problem is that training data contains errors, misattributions, and outright fabrications - and the model cannot distinguish between them. It produces confident answers that cite Quran verses with wrong numbers, attribute hadith to wrong collections, or invent rulings that no school holds.

For most topics, a hallucinated answer is an inconvenience. For religious guidance, it is a different category of harm. A person asking about their obligations in Ramadan, or how to compute their zakat, deserves an answer they can verify - not a plausible-sounding fabrication.

Our design principle: the AI never generates scripture, rulings, or numbers. It retrieves from authoritative sources and is constrained to cite or abstain. The citation validator is the last line of defense and it always runs.

What we retrieve from

The AI can only cite sources that are in our retrieval corpus. Here is what is in it and where it comes from.

Quran

Full text (6,236 verses) in Uthmani script with five English translations and tafsir excerpts. Source: Quran Foundation Content API.

Hadith

Sahih Bukhari, Sahih Muslim, Abu Dawud, Tirmidhi, Nasa'i, Ibn Majah, Muwatta Malik. Each hadith is stored with its grading (sahih, hasan, daif). Source: sunnah.com data.

Dua corpus

267+ supplications from Hisnul Muslim and Quranic duas. Scholar-reviewed, immutable Arabic text, with source reference and situation tags. No user-generated content.

What is not in it

Social media posts, unverified websites, AI-generated summaries, fatwa databases without traceable chains of authority. If a source cannot be traced to a primary text, it does not enter the corpus.

The pipeline, step by step

From the moment you submit a question to the moment the answer appears, it passes through eight stages. Every stage is a gate, not a decoration.

1

Intent and safety classification

Every query is classified before anything else. The classifier identifies whether the question is a factual Islamic query, a dua request, a fiqh calculation, or something outside the app's scope. A jailbreak or harmful-request detector runs in parallel. Out-of-scope and harmful queries are declined immediately - the model is never invoked.
2

Crisis detection

A dedicated crisis detector screens every input for signals of distress, self-harm, or suicidal ideation - including indirect signals in text, emoji, and numeric sliders. If a signal is detected, the normal pipeline is stopped entirely. The response surfaces helpline resources and a comforting authenticated verse. The crisis check is signal-type agnostic and runs on every path including verse explanations and tool-router queries.
3

Madhhab context injection

If you have selected a school of thought (Hanafi, Shafi'i, Maliki, Hanbali, or mainstream), that preference is attached to the retrieval query. Results from your school are ranked first. Where schools diverge, the answer labels the difference explicitly rather than blending positions silently.
4

Hybrid retrieval

The retriever runs a combined semantic and keyword search over our canonical corpora: the full Quran with five translations, authenticated hadith collections with grading, and a scholar-reviewed dua dataset. The top-5 most relevant passages are selected. A similarity threshold is applied: if no passage clears 0.7 cosine similarity, the pipeline moves to abstention rather than proceeding with low-confidence material.
5

Abstention gate

If the retriever finds nothing above the threshold, or if the topic is on a curated list of scholar-required questions (inheritance splits, divorce rulings, medical-religious edge cases), the pipeline stops here. The response tells you plainly that we do not have a reliable source for the question and recommends consulting a qualified scholar. No answer is better than a fabricated one.
6

Constrained generation

Gemini generates an answer, but it is given only the retrieved passages to work with. It cannot draw on its general training data for Islamic content. The prompt explicitly instructs it to cite only references that appear in the provided material and to flag any claim it cannot support from those passages.
7

Citation validation

Before the answer reaches you, every cited reference is checked against the canonical corpus using exact lookups - not fuzzy matching. If a Quran verse reference does not resolve to the actual verse, or a hadith number does not exist in the collection, that citation is stripped from the answer. If no citations survive validation, the answer is withheld and replaced with an abstention. Citations that survive appear with source, collection, and number.
8

Response assembly

The validated answer is assembled with its citations, a madhhab label where applicable, and the standard disclaimer that responses are general information, not a fatwa. The full answer is then streamed to you - after validation, not before. You never see unverified text.

Verse explanation mode

Tapping any verse in the Quran reader opens a plain-language explanation (ELI5 mode). This uses the same pipeline with one adjustment: the retriever is seeded with the specific verse and related tafsir material rather than a free query. The crisis detector runs first, because a person reflecting on a particular verse may be processing something difficult.

Fiqh calculators - no AI involved

Zakat, inheritance (Faraid), fidya, kaffarah, mahr, and qurbani calculations are handled by deterministic rule engines, not the AI. The model is not invoked for these at all. You enter the parameters, the engine computes the result using exact-fraction arithmetic (no floating-point rounding in religious calculations), and the output is presented with a full computation trace you can verify.

  • The zakat engine is madhhab-aware and applies the correct nisab threshold and category treatment for your school.
  • The Faraid engine handles awl (proportional reduction), radd (residue distribution), and blocking rules across the four Sunni schools.
  • Results carry a Trust Receipt: a human-readable trace of every rule applied, which rule pack version was used, and the effective date.

The AI layer is forbidden from generating numbers for zakat or inheritance. This is enforced in the pipeline, not by convention. If the LLM were somehow to attempt a calculation, the tool-router layer intercepts and routes to the deterministic engine instead.

What the AI cannot do

  • Generate scripture from memory. It may only cite passages that exist in the retrieved material it was given.
  • Emit numbers for religious financial calculations. These are handled by deterministic engines.
  • Blend madhhab positions silently. Where schools differ, the difference must be labeled.
  • Respond to questions that require a scholar's judgment (inheritance edge cases, divorce rulings, medical-religious intersections). It abstains and directs to a qualified scholar.
  • Respond to jailbreak attempts, incitement requests, or questions designed to generate harmful religious content. These are detected and declined before generation.

How we test the AI

Every change to the AI pipeline runs against a suite of golden test cases before it can be deployed. The suite includes:

50 factual questions

100% must resolve a citation

10 scholar-required topics

100% must abstain

5 jailbreak prompts

100% must be declined

3 crisis signals

100% must trigger crisis response

20+ zakat cases

100% must match exact output

15+ inheritance cases

100% must match exact output

If any test case regresses below its threshold, the deployment is blocked automatically. Scores cannot decrease between releases.

For details on citation formats and what happens when a reference fails validation, see our citation standards. Common questions about the AI are answered on the FAQ page.