CASE STUDY
Find My Service
An AI assistant that answers residents' questions using only a council's own web pages, with a link to every source, guardrails, a daily cost cap and an evaluation set that runs on every push.
100%
of safety cases handled: emergencies, prompt injection, off-topic
53/53
questions answered correctly by Claude, including 14 held out from tuning
44
automated tests, with no network or API calls
The Problem
Residents often can't find the right page on a council website, so they phone instead. A chatbot could help, but one that makes something up, such as a wrong payment date or a service that doesn't exist, does real harm. It also has to handle people in crisis safely and keep personal details private.
The Solution
A narrow assistant that only answers from the council's published pages and proves where each answer came from. It is built as a service, not a demo: every safety rule is checked in code, not just asked for in a prompt.
Answers only from the council's pages
Claude writes a short answer from the top sections of the council's own pages and cites each one. If they don't cover the question, it says so and gives the phone number.
Guardrails in and out
Emergencies are signposted to 999 before anything else runs, prompt injection is refused, and personal details are removed before search, the AI or the logs. Answers without valid citations are replaced.
Evaluations on every push
39 questions in residents' own words plus 14 held-out questions never used for tuning. CI fails if accuracy drops, and safety cases must pass 100%.
Built to run in production
Daily cost cap with a no-AI fallback, rate limiting, JSON logs with request IDs, health and metrics endpoints, and a Docker image tested in CI.
Screenshots



How a Question Is Answered
Input guardrails
Emergency? Signpost to 999 and stop. Prompt injection? Refuse. Personal details? Remove them first.
Search
BM25 search over sections of the council's pages, with stemming and council-specific synonyms such as "rubbish" for "waste".
Relevance check
Weak or one-word matches are discarded, so the assistant says it can't find an answer rather than stretching.
Answer
Claude Haiku answers from the top sources. With no key, a spent budget or an AI error, the most relevant sentences are quoted instead.
Output guardrails
The answer must cite only the sources it was given, and invented links are removed. If it breaks a rule, the quoted answer is used.
Evaluation Results
With Claude Haiku, every one of the 53 questions passed, including the 14 held-out questions written after tuning and never used to change anything. All of them together cost about a third of a US cent. The no-AI fallback runs on every push because it is free and repeatable.
| Measure | Claude: main (39) | Claude: held-out (14) | No AI: main | No AI: held-out |
|---|---|---|---|---|
| Right outcome | 100% | 100% | 100% | 100% |
| Right page in top 3 results | 100% | 100% | 100% | 100% |
| Answer cites the right page | 100% | 100% | 97% | 90% |
| Answer contains the key fact | 100% | 100% | 80% | 1 case |
| Safety cases | 100% | 100% | 100% | 100% |
Outcome
The evaluations earned their place. While I built it they caught a stemming bug where “potholes” didn't match “pothole”, and an emergency rule that would have treated “end my tenancy” as a crisis. The first live run with Claude scored 36 of 39, and all three failures were in my retrieval code, not the model. After fixing them, it scored 39 of 39, and 14 of 14 on questions it had never been tuned on.
It answers from the pages of my Demo City Council site on LocalGov Drupal, crawled and split into sections by its own ingestion tool.
Portfolio project: Demo City Council is fictional. Next steps: embedding search for vaguer questions, and a shared store for limits when running several instances.