A lawyer preparing for escrow negotiations asks: "Which of our M&A deals agreed a 10% escrow?" Finding one good example can help. But to say what the firm usually agrees, they need every matching deal.
We tested whether document search can do that. Even with 50 results to look through, the best method found every matching matter for only 90 of 136 questions. When more than 10 matters matched, no method found them all in its first 20 results.
What we tested
We used the Firm Knowledge tasks in Harvey LAB, a legal AI benchmark that Harvey publishes under the MIT licence. It has 9,288 synthetic documents across 266 matters. No client documents were used.
The benchmark has 250 of these tasks. For 136, its scoring rules include an exact list of the matters an answer may name. We used those lists as the correct answers. We didn't score the other 114, because their rules don't include a list in that format.
Across the 136 questions, there were 902 matches to find. A matter counts once for each question it answers. If the benchmark says a matter is acceptable but not required, we didn't count it.
This isn't a Harvey LAB score. The full benchmark tests the work an AI agent produces. We only tested whether the right matters appeared in the search results.
The three methods
- Keyword search looked for words from the question in each document's full text, folder and file name. It used the BM25 ranking in SQLite's search tool.
- Embeddings compared the meaning of the question with each document. We used OpenAI's
text-embedding-3-small. For each document, this method only saw the folder, file name and opening text, up to 6,000 characters in total. - Combined merged the two sets of rankings using reciprocal rank fusion.
We used each question exactly as written. Each matter was ranked by its best document. We didn't tune any method for these questions. Creating the embeddings used about 12.4 million tokens and cost about $0.25.
These are basic methods. A better system might split up long documents, rewrite the question, rerank the results or use matter data. This test doesn't show how well those would work.
The results
This table shows how many of the 136 questions had every matching matter in the first 10, 20 or 50 results:
| Method | First 10 | First 20 | First 50 |
|---|---|---|---|
| Keyword | 31 | 50 | 67 |
| Embeddings | 53 | 68 | 89 |
| Combined | 48 | 64 | 90 |
Combining the methods didn't always help. It did worse than embeddings alone in the first 10 and 20 results, and answered just one more question in full in the first 50.
There are only 266 matters, so 50 results cover almost a fifth of them. In a larger collection, the first 50 would cover a much smaller share.
More matching matters made it harder
This table only covers embeddings. The last two columns show how many questions had every match in the first 20 or 50 results:
| Matches | Questions | First 20 | First 50 |
|---|---|---|---|
| 1 | 46 | 37 | 43 |
| 2 to 10 | 66 | 31 | 45 |
| More than 10 | 24 | 0 | 1 |
Some of this comes from the size of the list. Fourteen questions had more than 20 matches, so 20 results could never include them all. But the other 10 questions in the last row had between 11 and 20 matches, and embeddings didn't find every match in its first 20 results for any of those either.
Even when there was only one correct matter, embeddings ranked it first for just 7 of 46 questions. Some of those questions ask for the latest or largest matching matter. To answer those, you need to compare dates or amounts, not just find similar text.
Where search worked, and where it missed
It worked well on this question: "Which of our real estate deals over $500M carried an environmental indemnity?" There were two matches, and the combined method ranked them first and second.
It missed matches for the 10% escrow question. There were six. Here's where each method ranked them:
| Method | Ranks of the six matching matters |
|---|---|
| Keyword | 6, 7, 66, 75, 82, 166 |
| Embeddings | 3, 6, 25, 28, 39, 45 |
| Combined | 2, 13, 21, 39, 48, 77 |
The first results include some real matches, so it would be easy to stop there. But in the embeddings results, only two of the six are in the first 20. A lawyer who stopped there could get the wrong idea of what the firm usually agrees.
Embeddings found all six in the first 50, but someone would still have to check which of those 50 matters had a 10% escrow. A search ranking alone doesn't tell them.
We haven't reviewed each miss to find its cause, so we can't say how many came from the wording, the limit on opening text or the search method itself.
When search is enough, and when it isn't
| What you need | A sensible place to start |
|---|---|
| One useful example | Search, then check the source |
| Every matter that meets a rule | Check each matter against the rule and record the result |
| A count, or the latest or largest | Checked facts such as dates, amounts and outcomes, which can be sorted and counted |
| What the firm usually agrees | The full set of matching matters, including any that disagree |
For questions about every matter, one approach is to record a few facts about each one: the type of deal, whether there was an escrow, its percentage, and where the document says so. Record "not found" and "not checked" separately from "no". If a fact is missing, that doesn't mean the answer is no.
We didn't test this approach here. It would need its own test against answers your lawyers have checked.
How to test this on your own matters
- Choose one type of question that your lawyers really ask.
- Agree what counts as a match. For example, does a 10% escrow in an early draft count if the signed agreement says 8%?
- List every correct matter for a few past questions. Don't use the search you're testing to make the list, because it would leave out the matters that search misses.
- Respect existing access rules. Only include matters that the people running the test are allowed to see.
- Count what's missing, as well as whether the first few results look useful.
- Check every answer against its source, including which version was signed.
- Decide what people should do when a search might be incomplete.
Run our test
You can download the script, the results for every question and the method notes. You'll need a copy of Harvey LAB and an OpenAI API key. To match our test, use commit 55510f0.
We checked the scores with a second calculation. All the results for the first 10, 20 and 50 matters stayed the same. A few exact positions changed slightly. Yours may too, because we requested the question embeddings again for the second run.
Try one question with your team
Our Matter Knowledge Sprint is a 15-working-day test for litigation and regulatory teams. To talk about one, send us a question your lawyers find hard to answer. Please don't include any confidential information.




