Home › Use Cases › HR leave, scoped to who is asking
Use caseUC0453
🧪 Use-case kit · runnable

HR leave, scoped to who is asking

A small, forkable project that does one job end to end. Run once for real, and every figure on these pages captured from that run.

The business caseThe problem this solves

A retrieval system answers what the corpus says. The moment the corpus holds records about people that is the wrong question, and the right one is what the corpus says that THIS PERSON may be told. The HR mailbox. Leave, review and salary questions go to a person who checks who is asking before answering; this answers them in about a second and applies the same check mechanically.

Audience

Anyone putting question-answering over HR, customer, patient or case records — where the same question has a different correct answer depending on who asks it. Every number on these pages came from one real run of this code, not from a vendor page.

The inputThe actual HR documents

The corpus is 100 HR documents, 0.02 MB (md 100). The smallest corpus that makes the interesting case unavoidable. Most of it belongs to everybody (40 policies), most of the rest to exactly one person, and 6 documents deliberately hold four kinds of information about one employee in one file — the case where a document-level decision is wrong whichever way you make it.

The corpus

  • The 100 HR documentsgenerated from a fixed seed, so no real record, person or institution appears in it.

Swap this folder for your own material and the kit is pointed at your HR documents. That is the whole change — there is no database to migrate.

One HR document, as the model receives itfile-E002.md · 1 of 100
# Employee file — Lena Cole (E002)

## Profile
Team: Engineering. Title: Engineering Manager. Joined 2021.

## Leave
Remaining 5 days as of 1 September 2026.

## Review
Exceeds on delivery.

## Salary
Annual salary $92,000, band D.

The outcomeWhat a good result looks like

The same question, asked by different people, returns different answers, and the records out of scope were never fetched.

And when it cannot

A colleague reads a salary. Or — just as bad and far more common — a manager cannot answer a question they are entitled to answer, the team goes back to the mailbox, and the system is switched off.

Where it fitsWhat did work

Every line below is a measured result from this kit's own runs, with the figure that supports it. The headline above is not softened by any of them.

  • HR, support or case records where the answer depends on who is asking — This shape, as it stands.
    The labels are per-subject and the hierarchy is shallow — exactly what the filter models.
  • A corpus already in a database with row-level security — Keep the grid; replace src/scope.py::visible with a query.
    The database can express the same rule and refuse in the query plan, which is faster and harder to bypass.
  • Millions of chunks — Not this. Take the first swap seam.
    The filter is O(corpus) per question and the corpus must fit in memory.

At a glanceHow the whole thing runs

100%answers whose every figure came from a readable passage
964 msp50, end to end
$3.70per 1,000 persona x question cells · Claude Fable 5

Run once, for real, on 2026-09-13. Every figure on these pages was captured from that run — nothing is written from intent.

14 steps, grouped by the question that sends you to them rather than by build order. Each tile carries the one figure that step is about, and opens the page behind it.

Should you use this?What you bring, where it stops, and when not to use it

Before you commit an afternoon to this, these are the answers that decide it. Each one is rendered from the record it lives in — and links the page that holds it in full.

What do I have to bring?Point data/corpus at your own markdown and write a corpus-manifest.json giving each file a subject and a kind. Do not hand it documents you have not labelled and expect it to infer the labels. Corpus lens →
When is this the wrong choice?Avoid: Nothing, beyond doing the labelling honestly. That is the case against the best-fitting scenario (“HR, support or case records where the answer depends on who is asking”). 3 scenarios scored in all, each with its own. Eval lens →
Where does it stop working?A document whose sections are not marked with headings. The chunker splits mixed files at their own ##; a scanned PDF with the salary in a footer has nothing to split on, so the whole document takes one label — which is the wrong label for part of it. 3 recorded failure modes, each from a run rather than a guess. Corpus lens →
What was never verified?THE LABELS ARE INVENTED. subject and kind were written by the corpus generator, so this kit cannot tell you how hard labelling is on real documents. 5 items this kit says it could not check. Eval lens →
Can I run this on a model I control?The shipped adapter is OpenAI-compatible endpoint; the Prompt lens states what swapping it costs. The published figures come from 2 models on the fast tier and the deliberating tier. Prompt lens →
And if it fits — what do I stand up?5 artifacts with a stated home and a stated egress, and 4 decisions each with what you provision past its ceiling — plus what was not measured. That is the next page, not this one. step 14 — Run it in your environment →

Not asked of this kit — 2 questions: clone (a fresh clone of this kit runs with nothing fetched); judge (nothing here is graded by a model).

Last verified 2026-09-13 — r005-flash — 50 cells, 27 model calls, the fast tier, reasoning disabled. Every figure on these pages was captured from that run.

Run itHow this reaches your data

Every result on this page was produced by pure code over checked-in files, with no API key — which is why you can read the numbers before anyone spends anything.

Run this on your own data

  • The pipeline, its eval harness and the runs behind every numberdeployed inside your environment, on your own model endpoints, against your own documents.
  • The corpus above is the shape, not the limitit is a folder swap, and there is no database to migrate.

Talk to us →

Checked before this shipped — git clone, then python3 tools/build_corpus.py && python3 src/chunker.py. No key, no network, no database, about a second.

A living map of modern AI — kept current every morning