Datasets:
Sanad Law Pack
The searchable legal database used by Sanad, an open-source assistant that answers questions about Moroccan law and quotes the articles it relies on.
This repository holds one file, the law pack: a single signed SQLite database with the texts of Moroccan legislation (codes, laws, dahirs, decrees, orders and Bulletin Officiel material), split into articles with their dates of effect, plus the search indexes (keyword index and BAAI/bge-m3 embeddings). Sanad reads it to find the articles that answer a question, and shows the exact quotes.
This is not legal advice. The texts are compiled automatically from public sources and may contain errors, gaps or outdated versions. Always check the official text in the Bulletin Officiel / SGG before relying on it, and consult a lawyer.
Files
| File | What it is |
|---|---|
current.db |
The law pack (SQLite, about 2.3 GB). |
current.db.sig |
Ed25519 signature of the pack (hash, build date, version). |
Current version: 2026.11.08.1455-retire
SHA-256 of current.db: 6b8d461f7222dd749e4b52368abe55e5f2fe5fdfde1bcdd5f6ff155377fcf110
Publisher public key (Ed25519, hex): 086dbbbf9cc34d77f65c376b480be3ab83ad25e12194efee5445a4241aded15c
The app refuses a pack that is not signed by this key.
How to use it
You do not load this file with the datasets library. It is meant for the Sanad app.
- Get Sanad from GitHub:
https://github.com/YOUR-GITHUB-NAME/YOUR-REPO - Install the pack with the repository's installer, which downloads this file, checks the SHA-256 and the signature, and only then installs it:
py tools\install_pack.py
setx LEGALRAG_LAWPACK_PUBLIC_KEY_HEX 086dbbbf9cc34d77f65c376b480be3ab83ad25e12194efee5445a4241aded15c
- Restart the backend.
You need about 6 GB of free disk space while installing (download, new pack, and the previous pack kept for rollback). The download resumes if the connection drops.
To check the file by hand: compute the SHA-256 of current.db and compare it with the value above.
What is inside
- Instruments and articles with their versions over time, so a question can be answered with the law as it stood on a given date.
- Multilingual search data: Arabic text with an Arabic-aware keyword index, and dense vectors from
BAAI/bge-m3(multilingual, so French and English questions also find Arabic articles). - Source references: each article keeps its source (code, Bulletin Officiel number and date, law number) so answers can cite it.
The pack is rebuilt from time to time. Each rebuild has a new version number and a new signature.
Known limits
- Some laws were extracted from PDFs; a few articles may carry formatting damage (for example split words or notes inside an article). These are being corrected in later versions.
- Not every Moroccan legal text is included, and the pack does not contain case law unless stated in the release notes.
- Amendments published after the build date are not included.
Sources and rights
The texts come from official Moroccan publications (Bulletin Officiel and the General Secretariat of the Government) and other public legislative sources. The compilation, indexing and embeddings are produced by the Sanad project. Check the rules on reuse of official texts that apply to you, and open an issue on the GitHub repository if you believe something here should not be published.
Citation
Sanad Law Pack, version 2026.11.08.1455-retire, https://huggingface.co/datasets/Xdnh00p/sanad-lawpack
- Downloads last month
- 99