The UK Law Knower V1

By Elliot Readman (sintaxsaint) β€” Part of the Black Ecosystem

Rule-based UK legal rights API. Zero hallucination. Every answer comes directly from verified UK law with the actual act and section cited. If it is not in the rules, it says so.

No model weights. No GPU. Instant responses. Never wrong about what it knows.


Live API

https://sintaxsaint-uk-law-knower.hf.space/ask?q=your+question

This API is free to call from any website. No API key required. CORS open.


Endpoints

GET /ask?q=question

Ask a legal question in plain English.

Example:

GET /ask?q=can+a+school+keep+my+phone+overnight

Response:

{
  "found": true,
  "question": "Can a school keep my phone overnight?",
  "answer": "Only if the school's published behaviour policy explicitly states they can keep confiscated items overnight. If it does not say this, keeping your phone overnight is unlawful. The policy must be publicly available β€” you have the right to read it.",
  "law": "Education Act 1996 s.91 | DfE Behaviour in Schools guidance 2023",
  "verdict": "DEPENDS β€” check your school's behaviour policy",
  "rule_id": "SCHOOL_PHONE_OVERNIGHT",
  "confidence": 4.0
}

Not found response:

{
  "found": false,
  "query": "your question",
  "message": "No rule found for this question yet.",
  "suggestion": "Try rephrasing or check /topics for what is covered.",
  "contribute": "github.com/sintaxsaint"
}

GET /topics

List every rule currently in the system.

GET /topics

Response:

{
  "total_rules": 20,
  "rules": [
    {
      "id": "SCHOOL_PHONE_OVERNIGHT",
      "question": "Can a school keep my phone overnight?",
      "verdict": "DEPENDS β€” check your school's behaviour policy"
    }
  ]
}

GET /

API info and usage summary.


Integrate into your website

JavaScript (fetch):

async function askLaw(question) {
  const res = await fetch(
    `https://sintaxsaint-uk-law-knower.hf.space/ask?q=${encodeURIComponent(question)}`
  )
  const data = await res.json()
  if (data.found) {
    console.log(data.answer)
    console.log(data.law)
    console.log(data.verdict)
  } else {
    console.log("Not covered yet")
  }
}

askLaw("can a school search my bag")

Python:

import urllib.request
import json

def ask_law(question):
    url = f"https://sintaxsaint-uk-law-knower.hf.space/ask?q={urllib.parse.quote(question)}"
    with urllib.request.urlopen(url) as r:
        data = json.loads(r.read())
    return data

result = ask_law("can a school keep my phone overnight")
print(result["answer"])
print(result["law"])

curl:

curl "https://sintaxsaint-uk-law-knower.hf.space/ask?q=can+school+keep+my+phone+overnight"

Coverage

Category Rules
Schools β€” phones, search, exclusion, restraint, bullying, detention, uniform 10
Family Law β€” parental responsibility, divorce, coercive control, domestic abuse 5
Children's Rights β€” medical, safeguarding, criminal responsibility, work 4
Consumer Rights β€” refunds, faulty goods 1

More rules added in each version. Suggest topics at github.com/sintaxsaint


Why rule-based?

UK law is precise. The answer to "can a school keep my phone overnight" is always the same β€” Education Act 1996 s.91. A generative model might get this right 90% of the time. This gets it right 100% of the time for everything it covers, and admits when it does not know rather than guessing.


Verdict codes

Code Meaning
ILLEGAL Criminal offence under UK law
UNLAWFUL Against the law but not necessarily criminal
LEGAL Permitted under UK law
DEPENDS Depends on specific circumstances β€” answer explains

Part of the Black Ecosystem

Free. Ad-free. No data collection. github.com/sintaxsaint

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support