From digging through folders to just asking
How a compliance advisory firm went from searching folders to asking a chat assistant that reads around every match, in three months.
01 At a glance
The short version
A compliance advisory firm wanted quick answers it could check from its own documents. We set up a chat assistant that reads each match together with the text around it.
Compliance advisory firm
About 35 people, 8 of them advisers. They hold around 1,200 PDFs of policies, contracts and regulator guidance.
Slow, risky document searches
Finding the right clause took about 18 minutes. A clause read on its own often gave the wrong answer.
A chat assistant that reads around
It finds the best passage, adds the paragraphs either side, and answers with the document title.
62 hours a month back
By month 3, research time dropped to 5 minutes a question, delivering $5,270 in reclaimed fee-earner time each month.
The shift
Before: advisers search folders, read one hit on its own and answer from memory. After: they ask in plain words and get an answer built from the match and the text around it, with the source named.
02 The pain
Finding the clause
takes longer than using it
The answer is nearly always in a document the firm already holds. The slow part is finding the right paragraph, and the paragraphs around it.
Search finds words, not meaning
Advisers type a term into the folder search and get hundreds of hits. The wording in the question rarely matches the wording in the policy.
One clause, read alone, misleads
A clause often depends on a definition three paragraphs up or an exception three paragraphs down. The hit alone gives the wrong answer.
Knowledge sits with a few people
Two senior advisers know where things live. Everyone else interrupts them, which slows both sides.
Answers are hard to check
An answer from memory has no source attached. Checking it later means starting the search again.
03 The solution
A chat assistant that
reads around the answer
The assistant, built in n8n, works like a fast colleague who has read every document in the folder. It finds the right passage, reads the paragraphs around it, and answers with the title of the document it used.
Advisers drop PDFs into a shared folder. The system reads each one, cuts it into small pieces and files them in a search index.
An adviser asks a question in plain words. The system finds the best matching piece, then adds the two pieces before it and the two after it.
The assistant reads that block and answers in plain words. It names the document it used, so the adviser can check it.
Human review stayed in
Every answer names its source document. The adviser opens it and confirms the wording before anything reaches a client. The assistant does not send anything to a client itself.
04 Implementation
What we set up,
and what it gave the team
Documents go in first, then the search, then the chat. Each part has one job.
| Part | What it gave the team |
|---|---|
Drive folder | Advisers drop in a PDF. The system checks the folder every minute and picks up anything new. |
PDF reader | Pulls the text out of each file. This build reads PDFs. |
Splitter | Cuts each document into pieces of about 300 characters, with a small overlap so sentences are not cut in half. |
Search index | Stores every piece with the document's title, date and publisher, and a row number in reading order. |
Chat box | Advisers ask in plain words. It can also sit inside a messaging app. |
Search tool | Finds the best match, then fetches the two rows before it and the two after. |
Answer model | Gemini writes the answer and names the document. Claude Sonnet steps in if Gemini times out or runs short of room. |
Memory | Keeps the last 20 messages, so follow-up questions make sense. |
The folder, search index and chat box are connected. The firm's PDFs go in.
Advisers' own past questions run through it. The window size is tuned until answers read right.
Two advisers start first. The rest join once they see it work.
05 The workflow
The three parts
behind the assistant
This is the build as it sits in n8n. One flow loads documents. One answers questions. A small third flow fetches the text around each match.
A new file in the Drive folder is picked up, read, cut into pieces and saved to the search index.
A question arrives in the chat box. The assistant remembers the last 20 messages and calls the search tool.
Finds the best match, works out the rows either side, fetches them and hands back one block of text.
06 Under the hood
Four lines that find
the surrounding text
The search finds the best piece. A short script then works out which rows sit either side of it, and the next step fetches them.
Reads the best match's row number. Every piece of text is saved with one, in reading order.
Sets the window: two rows before, two after. Change the 2 to widen or narrow it.
The next step fetches every row in that range, so a clause arrives with its conditions.
The settings behind it
| Setting | Value | What it does |
|---|---|---|
| Piece size | 300 characters | About two or three sentences per row. |
| Overlap | 50 characters | A small repeat between neighbours. |
| Window | 2 each side | Five rows reach the assistant for each match. |
| Matches per question | 1 to 4 | More matches mean more context, more cost and slower answers. |
07 The retrieval
A match, plus what
sits around it
| Part | Rows | What it covers |
|---|---|---|
| Before the match | 2 | The lead-in: the definitions and conditions the match depends on. |
| The best match | 1 | The piece closest in meaning to the adviser's question. |
| After the match | 2 | What follows: the exceptions and dates that often change the answer. |
Late delivery, early exit?
An adviser asks: can our client end a supply contract early if a delivery is late? In practice, this checks notice and material breach terms.
A clause on early exit
Read alone, it says either side may end the contract early. That sounds like a yes.
The condition and the exception
Two rows before define a "material breach". Two rows after add a 30-day written notice. So the answer is yes, but only after notice.
Plain words, with the source
The assistant gives that answer and names the contract's title, so the adviser can open it and confirm.
08 The outcome
What changes,
and what we delivered
Each pain point turns into a change you can count.
| Area | Before | After 90 days |
|---|---|---|
| Time per question | 18 minutes by hand | 5 minutes with the assistant |
| What the adviser reads | One clause on its own | The match plus 2 rows either side |
| Source | From memory, no link | Document title named every time |
| Adviser hours a month | 96 hours on document questions | 34 hours, so 62 given back |
The 90-day rollout
The library went live with two lead advisers. Half of all questions were routed through the system (160 of 320).
Context windows were refined against live questions and the full team onboarded (240 of 320 queries).
90% of routine research routed through the assistant (288 of 320), returning 62 fee-earner hours each month.
Verified operational return
These figures reflect verified search logs and time tracking across the advisory team over 90 days of live use.
09 The numbers
The results
at $5,137 a month
Across 320 monthly document inquiries, the assistant delivered measured returns across 90 days.
By hand, against assisted, including opening the source.
On document questions, by month 3.
Live adoption: 50%, 75%, then 90%.
Month by month
| Measure | Before | Month 1 | Month 2 | Month 3 |
|---|---|---|---|---|
| Questions assisted (of 320) | 0 | 160 | 240 | 288 |
| Adviser hours on questions | 96 | 61 | 44 | 34 |
| Hours given back | 0 | 35 | 52 | 62 |
| Value of those hours | $0 | $2,975 | $4,420 | $5,270 |
| Running cost | $0 | $114 | $126 | $133 |
| Net gain a month | $0 | $2,861 | $4,294 | $5,137 |
a month by month 3, after running costs.