How Answers Are Generated

Ahkam101 answers are produced by a retrieval-augmented generation (RAG) pipeline grounded in the published rulings of Grand Ayatollah Sistani. This page explains, honestly and in plain language, how that pipeline works, what it does to stay accurate, and where its limits are. We share this because trust in a tool like this should rest on understanding how it works — not on a black box.

The Pipeline at a Glance

Query understandingTrilingual searchRerankGrounded generationCitation validationQuality control

1. Query Understanding

When you ask a question, Ahkam101 first works to understand it before searching. A language model rewrites your query into precise, semantically complete search expressions, expanding layperson wording into the technical fiqhi (jurisprudential) terminology used in the source texts — including the correct Arabic terms.

This step bridges the gap between how a question is asked and how the rulings are phrased, so a relevant ruling is found even when the wording differs.

2. Trilingual Retrieval

The corpus of rulings is searched using semantic (vector) retrieval across the languages the source material exists in — primarily Arabic, English, and Persian/Farsi. The same query can surface the ruling in whichever language it was published, then present it to you in your language.

Why this matters

Many rulings are authored in Arabic and translated later. Searching only one language would miss relevant material. Trilingual search ensures coverage of the full published record.

3. Reranking

The initial candidate rulings are then reranked by a dedicated multilingual reranker model that scores how genuinely relevant each passage is to your specific question. This second pass reorders the results by true semantic relevance rather than rough similarity, surfacing the most applicable rulings to the top.

The reranker is tuned for strong Arabic understanding, which is essential given the source material is predominantly Arabic.

4. Grounded Generation

Ahkam101 then composes an answer using a retrieval-grounded approach: the response is generated only from the retrieved, reranked source passages — not from the model's general training knowledge. A full prompt stack instructs the model to stay within the provided rulings, use the source's own terminology, and quote rather than paraphrase where precision matters.

Grounding, not invention

The model is constrained to the retrieved evidence. If the corpus does not contain a relevant ruling, the system is instructed to say so rather than fabricate one.

5. Citation Validation

Every answer is checked by a citation-validation layer. Before an answer reaches you, the system verifies that each cited ruling actually appears in the retrieved results. Any citation that cannot be traced back to a real retrieved passage is flagged and removed — a defense against the model inventing (hallucinating) references.

Cited, not asserted

Answers cite specific rulings with their references — for example a book name together with a page or ruling number, such as:

  • Islamic Laws, Page 42
  • Ruling #178 from the relevant collection

This lets you trace any answer back to its source.

6. Quality Control

The pipeline is evaluated against test suites of representative questions with known expected rulings, and retrieval quality is benchmarked independently of generation. This catches regressions — for example, if a change caused the system to stop surfacing a ruling it previously found.

7. Scope: Sistani's Rulings Only

One marjaʿ, by design

Ahkam101 covers only the published rulings of Grand Ayatollah Sayyid Ali al-Husayni al-Sistani, as available through sistani.org and his published works. It does not cover the rulings of other marajiʿ (scholars of emulation).

If you follow a different marjaʿ taqlid, this tool will not reflect their positions. Always confirm against the ruling of your marjaʿ.

Restricting the corpus to a single scholar's verified publications is itself an accuracy measure: it keeps answers within a known, authoritative body of work.

8. Important Limitations

Educational, not a marjaʿ

Ahkam101 is an educational assistant, not a marjaʿ, nor a substitute for one. Although we work hard for accuracy, you should be aware that:

  • Answers are generated by an AI system and may contain errors or omissions
  • Retrieval may occasionally surface an adjacent rather than the most directly applicable ruling
  • Complex or nuanced matters often require human scholarly judgment the system cannot provide
  • Personal circumstances can change how a ruling applies to you

For matters of consequence, please verify with your marjaʿ's office or a qualified scholar.

When in doubt, verify

This tool is a starting point for learning and research, not a final authority. Every cited answer links back to a source so you can confirm it directly.

In Summary

AHKAM101:

  1. Generates answers only from retrieved rulings of Ayatollah Sistani — never invents rulings
  2. Cites each answer to a specific source so you can verify it
  3. Validates citations against the retrieved evidence before showing them
  4. Covers only Sistani's published rulings, not those of other marajiʿ
  5. Is an educational tool, not a marjaʿ — confirm consequential matters with a qualified scholar

Copyright © 2025–2026 Ahkam101. All rights reserved.

Developed by Mārefa Source