Skip to main content
Imagine you have thousands of emails and need to find those worth reading for an inquiry into a company’s lobbying. You cannot read them all first. You also cannot assume that an email about a law describes an effort to change it. This lesson uses eight lightly redacted messages from the public Enron email collection. Four were marked relevant and four irrelevant by reviewers in the TREC 2010 Legal Track. You will ask one question, check its answers, then revise the question. The eight cases were chosen to teach the workflow; they do not estimate how well it works on the full collection. Source and editing notes. You need uv and a TypeSafe API key. The commands below cap model spending at one cent each.
1

Get the eight emails

The three small files come from this repository, so the lesson works with the current hunch-ai release. emails.csv holds the messages, lobbying.yml holds the question, and NOTICE.md explains the sources. The model reads only the subject and redacted body of each email; the reviewers’ gold answers are kept for the test.
2

Ask one question

The spec asks: Does this email describe an attempt to influence a law, regulation, or public policy? run asks Jev that question of each email, shows how the answers split, and writes a table to .hunch/store.sqlite. To read the stored answers, run hunch show lobbying.yml; add --id e06 to see the email and its answer together.Run the command again. With the same model, question, and email text, the answers come from the cache and cost nothing. A new question or new email needs a new model answer.
3

Check against the reviewers

test compares the model’s answers with the eight published judgments. It says measured, because this starter spec has no acceptance threshold. Look at the disagreements, not only the accuracy number. For example, an email that merely reports a bill’s passage is different from one proposing comments to a regulator. The test uses cached answers, so --max-cost 0 refuses any missing model calls. Run hunch docs lobbying.yml --open for the shareable report.This is a deliberately balanced set of four yes and four no cases. Its score is useful for learning what the question means, not for claiming a real-world error rate. The document-review cookbook shows how to estimate one for a different legal request using a larger, sampled collection.
4

Change the question, then inspect the change

Save the first version beside the spec:
In lobbying.yml, replace the instructions: line with this more specific reading:
lobbying.yml
diff asks the revised question, lists the emails whose answers changed, and compares both versions with the same reviewer judgments. The changed question needs new answers; the old ones remain cached. Read the flips before deciding whether the rewrite helped. Eight chosen cases cannot settle that question for a larger archive.

What to try next

The document-review cookbook applies the same workflow to a different request over thousands of judged emails, and explains how many emails a person must still read. The review guide shows how your own decisions become an answer key. The command guard cookbook applies a judgment before a coding agent runs a shell command.