Kandil7/Athar-Datasets
π Athar Islamic QA Datasets 18.7M passages from classical Islamic books spanning 1,400 years of scholarship A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir, Aqeedah, Seerah, and more β sourced from the Shamela library and enriched with scholarly metadata for RAG-based Islamic QA systems. Based on the Fanar-Sadiq Architecture for grounded, citation-backed Islamic question answering. π Dataset Summary Metric Valueβ¦ See the full description on the dataset page: https://huggingface.co/datasets/Kandil7/Athar-Datasets.
π Athar Islamic QA Datasets
18.7M passages from classical Islamic books spanning 1,400 years of scholarship
A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir, Aqeedah, Seerah, and more β sourced from the Shamela library and enriched with scholarly metadata for RAG-based Islamic QA systems.
Based on the Fanar-Sadiq Architecture for grounded, citation-backed Islamic question answering.
π Dataset Summary
π Collections
π Schema
Each passage contains the following fields:
Example Entry
{
"content": "Ψ§ΩΨΩ
Ψ― ΩΩΩ ΩΨΩ
Ψ―Ω ΩΩΨ³ΨͺΨΉΩΩΩ ΩΩΨ³ΨͺΨΊΩΨ±ΩΨ ΩΩΨΉΩΨ° Ψ¨Ψ§ΩΩΩ Ω
Ω Ψ΄Ψ±ΩΨ± Ψ£ΩΩΨ³ΩΨ§...",
"book_id": 1234,
"book_title": "Ψ§ΩΩΩΨ§Ψ¦Ψ― Ψ§ΩΨΉΨ°Ψ§Ψ¨ ΩΩ Ψ§ΩΨ±Ψ― ΨΉΩΩ Ω
Ω ΩΩ
ΩΨΩΩ
Ψ§ΩΨ³ΩΨ© ΩΨ§ΩΩΨͺΨ§Ψ¨",
"category": "Ψ§ΩΨΉΩΩΨ―Ψ©",
"author": "ΨΩ
Ψ― Ψ¨Ω ΩΨ§Ψ΅Ψ± Ψ’Ω Ω
ΨΉΩ
Ψ±",
"author_death": 1225,
"collection": "aqeedah_passages",
"page_number": 1,
"section_title": "Ω
ΩΨ―Ω
Ψ© Ψ§ΩΩ
ΨΩΩ",
"hierarchy": ["Ψ§ΩΩΩΨ§Ψ¦Ψ― Ψ§ΩΨΉΨ°Ψ§Ψ¨", "Ω
ΩΨ―Ω
Ψ© Ψ§ΩΩ
ΨΩΩ"],
"title": "Ω
ΩΨ―Ω
Ψ© Ψ§ΩΩ
ΨΩΩ",
"chapter": null,
"section": null,
"page": 1
}π Collection Breakdown
Passages Distribution
hadith_passages ββββββββββββββββββββββββββββββββ 5,059,547 (27%)
general_islamic ββββββββββββββββββββ 3,410,436 (18%)
fiqh_passages ββββββββββββββ 2,397,988 (13%)
islamic_history_passages ββββββββββββββ 2,850,288 (15%)
quran_tafsir ββββββββββββ 2,128,606 (11%)
arabic_language_passages ββββββ 1,015,311 (5%)
aqeedah_passages ββββ 738,003 (4%)
spirituality_passages ββ 438,776 (2%)
usul_fiqh β 368,388 (2%)
seerah_passages β 294,623 (2%)π§ How to Load
Using HuggingFace Datasets
from datasets import load_dataset
# Load full dataset
ds = load_dataset("Kandil7/Athar-Datasets")
# Access specific collection
for row in ds['train']:
if row['collection'] == 'fiqh_passages':
print(row['content'][:200])
break
# Filter by collection
hadith_ds = ds['train'].filter(lambda x: x['collection'] == 'hadith_passages')Streaming Mode (Memory Efficient)
from datasets import load_dataset
# Stream without downloading
ds = load_dataset("Kandil7/Athar-Datasets", split="train", streaming=True)
for i, passage in enumerate(ds):
if i >= 5:
break
print(f"{passage['collection']}: {passage['title']}")Direct JSONL Access
import json
# Load specific collection
with open('hadith_passages.jsonl', 'r', encoding='utf-8') as f:
passages = [json.loads(line) for line in f]
print(f"Loaded {len(passages):,} hadith passages")π‘ Usage Examples
Example 1: Semantic Search with RAG
from sentence_transformers import SentenceTransformer
import numpy as np
import json
# Load embedding model
model = SentenceTransformer('BAAI/bge-m3')
# Load a sample collection
with open('fiqh_passages.jsonl', 'r', encoding='utf-8') as f:
passages = [json.loads(line) for line in f][:1000]
# Create embeddings
texts = [p['content'] for p in passages]
embeddings = model.encode(texts)
# Search
query = "Ω
Ψ§ ΨΩΩ
Ψ΅ΩΨ§Ψ© Ψ§ΩΨ¬Ω
Ψ§ΨΉΨ©Ψ"
query_embedding = model.encode([query])[0]
# Find most similar
scores = np.dot(embeddings, query_embedding)
top_idx = np.argsort(scores)[-5:][::-1]
for idx in top_idx:
print(f"Score: {scores[idx]:.3f}")
print(passages[idx]['content'][:200])
print("---")Example 2: Filter by Era
# Filter classical era scholars (200-500 AH)
classical_passages = [
p for p in passages
if 200 <= p.get('author_death', 0) <= 500
]
# Filter by author
imam_bukhari = [
p for p in hadith_passages
if 'Bukhari' in p.get('author', '')
]Example 3: Citation-Enhanced QA with Athar
# Use the Athar system for grounded answers
# See: https://github.com/Kandil7/Athar
from Athar import FiqhAgent
agent = FiqhAgent()
result = await agent.execute(
query="Ω
Ψ§ ΨΩΩ
Ψ΅ΩΨ§Ψ© Ψ§ΩΨ¬Ω
Ψ§ΨΉΨ©Ψ",
filters={"era": "classical"}
)
# Result includes citations
for citation in result.citations:
print(citation.source)
print(citation.text)π Source: ElShamela Library (Ψ§ΩΩ ΩΨͺΨ¨Ψ© Ψ§ΩΨ΄Ψ§Ω ΩΨ©)
This dataset is derived from ElShamela Library (Ψ§ΩΩ ΩΨͺΨ¨Ψ© Ψ§ΩΨ΄Ψ§Ω ΩΨ©) β the largest comprehensive digital library of Islamic texts.
About ElShamela
ElShamela (Ψ§ΩΩ ΩΨͺΨ¨Ψ© Ψ§ΩΨ΄Ψ§Ω ΩΨ©) is a free, open-access digital library that has been digitizing and preserving classical Islamic texts for over two decades.
Website: https://shamela.ws/
Processing Pipeline
- Extracted books from ElShamela Library format
- Converted from proprietary Shamela format to plain text
- Split into pages and passages for granular retrieval
- Enriched with metadata:
- Author names and death years (Hijri)
- Book titles and categories
- Chapter and section headings
- Page numbers
- Organized into 10 scholarly collections
ποΈ Scholarly Eras
π€ Related Projects
- [Athar](https://github.com/Kandil7/Athar) β Production-ready Islamic QA system using this dataset
- [Fanar-Sadiq Architecture](docs/Fanar-Sadiq%20A%20Multi-Agent%20Architecture%20for%20Grounded%20Islamic%20QA.pdf) β Research paper
π Citation
@misc{athar-datasets-2026,
title={Athar Islamic QA Datasets},
author={Kandil, Ahmed},
year={2026},
url={https://huggingface.co/datasets/Kandil7/Athar-Datasets},
note={18.7M passages from 10 Islamic collections}
}β οΈ Usage Notes
- Scholarly Context: These texts represent classical Islamic scholarship. Always consult qualified scholars for religious rulings.
- Hadith Authenticity: Hadith passages include chains of narration (esnad). Use authenticity grading to evaluate reliability.
- Fiqh Diversity: The fiqh collection represents multiple schools of thought (Hanafi, Maliki, Shafi'i, Hanbali).
- Language: Primary content is in Classical Arabic. Metadata includes English translations.
- Licensing: MIT License β free for research and commercial use.
π File Structure
Athar-Datasets/
βββ hadith_passages.jsonl # 5,059,547 passages (11 GB)
βββ general_islamic.jsonl # 3,410,436 passages (6.1 GB)
βββ fiqh_passages.jsonl # 2,397,988 passages (6.6 GB)
βββ islamic_history_passages.jsonl # 2,850,288 passages (5.6 GB)
βββ quran_tafsir.jsonl # 2,128,606 passages (4.9 GB)
βββ arabic_language_passages.jsonl # 1,015,311 passages (2.2 GB)
βββ aqeedah_passages.jsonl # 738,003 passages (1.7 GB)
βββ spirituality_passages.jsonl # 438,776 passages (1.1 GB)
βββ usul_fiqh.jsonl # 368,388 passages (874 MB)
βββ seerah_passages.jsonl # 294,623 passages (755 MB)π Contact & Support
- GitHub: https://github.com/Kandil7/Athar
- HuggingFace: https://huggingface.co/Kandil7
<div align="center">
Built with β€οΈ for the Muslim community
π Athar Islamic QA β’ 18.7M passages β’ 10 collections β’ 1,400 years of scholarship
</div>
