← all corpora

uk-legislation

reference corpus · status live · domain LAW (Law and regulation) · lane A · refresh pinned · tags UK · LAW · STANDARDS

What an agent uses it for

an agent answering UK-law questions queries this for what the current statute actually says: Consumer Rights Act remedies, GDPR-adjacent DPA 2018 duties, Building Safety Act duties (demand: legal-courts Ask-HN volume 46; source chosen for best-in-class versioned OGL XML)

Use it
curl -fsSLO https://raw.githubusercontent.com/xerj-org/xerj/corpus-hub/tools/xerj-code/hub/uk-legislation.json
xerj corpus add --from ./uk-legislation.json
xerj corpus index uk-legislation then xerj code uk-legislation "your question"

Needs the xerj CLI and a local node running; the copy prompt covers both, checks each step, and shows how to stop only the node you started. No shell: the MCP tool xerj_code_search with corpus: "uk-legislation", once the corpus is indexed on the node.

Sources and pins

sourcepinlicencesizereview note
uk-legislation 0575db1cbcedOGL-3.0 62.8 MB / 21,292 files G4 at source: legislation.gov.uk publishes under the Open Government Licence v3.0 (stated on the site's using-legislation page); OGL requires the acknowledgement sentence, which is reproduced in the mirror README and here: 'Contains public sector information licensed under the Open Government Licence v3.0.' Mirror = pinned snapshot via hub/nonit/build_uk.sh + split_uk.py: all 418 ukpga acts 2015-2

62.8 MB across 21,292 files. Added 2026-10-02.

People behind this corpus

Upstream authors (1)

Owners of the pinned repositories, credited under each repository's licence. They have not signed up here; their pages are attribution.

All contributors.

Rights

OGL-3.0. Redistribution permitted with attribution per the licence review. The review block records a human opening each licence file at the pin. Detector output is a hint, never the verdict.

Retrieval spot-check (G7)

5.0/5 relevant. Graded 2026-10-02T23:05:00Z.

Q: How long does a consumer have the short-term right to reject goods?
expect: Consumer Rights Act 2015 s.20/s.22: 30 days, unless goods perish sooner
top-5: 2015-15/s22 / 2015-15/s20 / 2015-15/s23 / 2015-15/s23 / 2015-15/sched-1
grade: relevant
Q: What pre-contract information must a trader give for a distance contract?
expect: CRA 2015 Schedule 2: trader identity, address, main characteristics, total price incl. tax, delivery arrangements, right to cancel
top-5: 2024-13/s256 / 2024-13/s257 / 2024-13/sched-23 / 2024-13/s257 / 2024-13/s275
grade: relevant
Q: When may a data controller charge a fee for a subject access request?
expect: Data Protection Act 2018 s.45/s.46: generally free; reasonable fee for excessive or repeated requests
top-5: 2025-18/s75 / 2025-18/s76 / 2018-12/s53 / 2018-12/s12 / 2018-12/s54
grade: relevant
Q: Which payments to landlords or letting agents are banned as prohibited tenant fees?
expect: Tenant Fees Act 2019 s.1 and Schedule 1: banning deposits over set caps, admin, referencing fees
top-5: 2019-4/s15 / 2019-4/s10 / 2019-4/sched-1 / 2019-4/s5A / 2016-22/s14
grade: relevant
Q: What safety cases and reports must building owners prepare for higher-risk buildings?
expect: Building Safety Act 2022: safety case report, registration with the Building Safety Regulator (Part 4)
top-5: 2022-30/s20 / 2022-30/s85 / 2022-30/s86 / 2022-30/s61 / 2022-30/s95
grade: relevant

Agent score

From structured reviews that AI agents send after they use this corpus: through xerj hub pull, MCP queries, or the xerj_corpus_feedback tool. Each review rates usefulness 1–5, whether the answer was found, and freshness. This is not the human hub star count shown above. The two are never mixed.

Loading agent reviews…

Score = Bayesian mean of usefulness (prior 3.0 with weight 5), so a few reviews cannot swing it. One voice per installation per corpus per week; abnormal-volume reviewers are dropped. Coverage gaps appear only once 3 or more agents report the same one. How it works.

Traffic

Traffic stats load from /api/hub-traffic when this page runs JavaScript.

Views: visits to this page (search-engine crawlers excluded). Unique: distinct visitors per day, by a hash salted with the day, so the 14-day unique figure adds up daily uniques. Pulls: growth of the GitHub release download count of this corpus’s pack (xerj hub pull downloads from there; includes our own pack-verification downloads). Searches: hosted-hub queries for this corpus. Referring sites appear after 3 views. What is collected.

Agent usage

Usage stats load from /api/hub-usage when this page runs JavaScript.

Counted: requests agents send to the hosted hub API (hub.xerj.org/api/v1/code, /def) for this corpus. Queries on your own node (xerj code, xerj ask with a local pack, the MCP tools) never leave your machine and are not counted. Templates replace identifiers, versions, paths, numbers and quoted text with placeholders; one is shown only once it has been seen 3 times in 30 days, and any word asked fewer than 3 times shows as <term>. Raw queries are never published. What is collected.