A retrieval-augmented Q&A system that answers UK tax questions grounded in official HMRC internal manuals — not an LLM's memory
View on GitHub ↗"Tax rules are precise, change often, and are a poor fit for an LLM to answer from memory." This project scrapes five HMRC internal manuals — corporation tax, VAT, PAYE, capital gains, and capital allowances — from GOV.UK, indexes every section, and answers questions using only retrieved context.
The pipeline runs query → index search → top-k retrieval → prompt building → LLM response, with the model declining to answer if the manuals don't cover the question, and every response linking back to its exact GOV.UK source page.
Query → index search → top-k retrieval → prompt → response, using minsearch (in-memory) or sqlitesearch (persistent)
Refuses to answer outside retrieved context, avoids hallucinated tax advice by design
Automated scraping via GOV.UK Content & Search APIs, modular scraping / indexing / agent-logic design
Pulled live from the GitHub repository — always in sync with the source.
Full pipeline detail and dataset are on GitHub.