Agent Research Guide

Documentation spine · Getting started · Personas and journeys · Illustrated manual · Evaluation · Maintenance

This guide defines how an agent should use the UK Legislation OKF pack without loading the whole corpus or losing provenance.

Progressive discovery algorithm

  1. Fetch the canonical descriptor: https://chris-page-gov.github.io/okf-uk-legislation/okf-explorer.json. For cross-source discovery, fetch https://chris-page-gov.github.io/okf-uk-legislation/whole-law/okf-explorer.json.
  2. Read the descriptor, overview, counts, notices and available facets.
  3. Convert the user question into candidate title terms, citation terms, jurisdiction, time and document-type constraints.
  4. Search titles locally; use the official remote full-text search when wording rather than title is needed.
  5. Rank candidate works, but require identity confirmation from title/type/year/number/official ID.
  6. Load only the selected work's official CLML structure.
  7. Locate the smallest relevant subdivisions and retain their source IDs.
  8. Open selected-passage, work, contents and changes/effects links as required.
  9. Check version, commencement, extent and amendment context.
  10. Write discrete propositions with a citation ledger and explicit uncertainty.

Do not infer a raw repository path from either published URL. Read the descriptor's repository.raw_subpath (bundle for legislation or bundle/whole-law for the federation) and its declared Pages, raw-content and release/archive alternatives.

Source hierarchy

Prefer, in order:

  1. official selected passage and official work/version pages;
  2. official CLML/Atom/effects data;
  3. normalized OKF identity and navigation metadata;
  4. derived topic or quality metadata only as discovery context.

Never cite a derived topic as law. Never turn a catalogue absence into a claim that no legislation exists.

Minimum answer shape

{
  "question_id": "LQ001",
  "answer": "Answer-first synthesis with qualifications.",
  "propositions": [
    {
      "claim": "One material proposition.",
      "citations": [
        {
          "source_title": "Exact title",
          "url": "https://www.legislation.gov.uk/.../section/6",
          "passage": "Supporting passage",
          "version": "Current text checked on the stated date",
          "retrieved_at": "2026-07-11"
        }
      ]
    }
  ],
  "temporal_context": {
    "version": "...",
    "commencement": "...",
    "extent": "...",
    "amendments": "..."
  }
}

Guardrails

Evaluation

Use the evaluation and quality guide and the 100-question suite. Automated scores validate observable evidence structure; expert review remains necessary for substantive legal correctness and forensic utility.