Overview
Most companies are sitting on years of expertise that nobody can search. It lives in call recordings, in personal folders, and in documents named however the author felt that day.
One of our clients, a UK specialist practice with around thirty clinicians, had exactly that. They asked us to build an AI assistant grounded in their own expertise, not the open internet. Before any of that could work, the expertise had to come out of the archive and into a shape software can use.
This post is the story of that ingestion job: what we were handed, what we set out to achieve, the conversations that shaped it, how we gathered the data, the pipeline that processed it, and where it all ends up.
The client stays anonymous here, and so does everyone in their data. Keeping that second promise turned out to be most of the engineering.
What we were handed 📦
Three sources, none of them designed to be read by a machine.
- A video library. Around 1,300 educational videos the practice had produced for its own clients.
- Call recordings. Every remote consultation since 2022, sitting in Zoom's cloud. The only label on each one was a meeting title typed by whoever started the call.
- Notes folders. Each clinician kept their own Google Drive folder of consultation notes, referral letters and plans: Word documents, PDFs, Google Docs, photos of whiteboards and a few hundred Apple Pages files.
There was also a spreadsheet: the practice's own framework, a structured vocabulary of the problems they see, the causes behind them and the strategies they prescribe. It becomes important later.
What there wasn't was anything linking a recording to its notes. No client IDs, no CRM export, no naming convention. Across 29 clinicians we counted 27 different ways of naming a client's folder:
Jane Smith - Notes
Smith, Jane
SMITH (JANE) from 21
2026 Consults/4.2.26 - Smith (Jane)
S/SMITH - Jane
Referral Smith 14.11.24.docx ← no folder at allOne clinician had no client folders whatsoever: 2,300 loose files, with the client's identity buried in each file name.
That is a normal starting point. If the valuable work in your business happens in conversations, yours probably looks similar.
What we wanted to achieve 🎯
The product goal was simple to say: an assistant inside the client's app that answers from the practice's own material, and a way for the team to pull up past cases similar to the one in front of them.
Underneath that sat five engineering goals:
- One case per client engagement, with its recordings and its notes together, so anything reading it sees the whole story.
- Everything as text. Audio can't be searched, compared or summarised until it has been transcribed.
- No personal details stored. Not "locked down" - absent. Names, addresses and contact details are removed before anything touches the database.
- Cheap to ask again. A new question of the archive next year should not mean transcribing 21,000 hours a second time.
- Keeps running. New consultations each month go through the same pipeline as the backlog.
The conversations that shaped it 💬
Most of the important decisions were made in conversation with the client, not in code.
Privacy first
Before any data moved we agreed with the client where it may live and which providers may touch it. Every cloud account is in the client's name, so they own the infrastructure and the data.
That ruled out the easy option. Hosted transcription APIs would have received raw audio, with every name in it, before we had any chance to clean it. So we ran open-source Whisper on a GPU we controlled, in London.
Store now, analyse later
The practice was still finalising its framework. Analysing 6,000 cases against a draft would have meant paying for the analysis twice.
So we split the job in two:
- Storing is the slow, GPU-heavy, irreversible part: download, transcribe, redact, keep the clean text. It doesn't depend on the framework at all, so it could start straight away.
- Analysing runs over the stored text, takes about a day, and can be repeated whenever the framework or the question changes.
Every future round costs the analysis and nothing else.
Measure, then quote
We didn't want to hand the client a guess. Before proposing a budget we ran around 120 real cases end to end, trying different models and collection techniques and metering every AI call. The budget the client received was built from those measurements.
Never merge on a guess
When a recording and a folder of notes might belong to the same client but we couldn't be sure, we kept them apart and flagged the pair for a person to look at. A missed match leaves two thinner cases. A wrong match puts one client's history into another's record. Those are not equally bad, so the pipeline doesn't treat them equally.
The experts check the output
The practice's clinicians edited and signed off the prompts that read their consultations, and a sample of results goes back to them for review before the app relies on any of it. They are the only people who know what a correct reading of a case looks like.
Gathering the data 🗂️
Index first, download nothing
The first pass over the archive downloaded no content at all. It walked the Zoom and Google Drive APIs and wrote down what exists: names, dates, durations and file IDs. Zoom took twenty minutes. Drive took hours, backing off every time Google's rate limits pushed back.
That index paid for itself immediately. It gave us the archive's true size, which is what the budget was built on. And it surfaced the questions only the client could answer, weeks before they could block anything: a folder that had never been shared with us, two clinicians who kept their notes somewhere else entirely, and 246 files in a format nothing in the pipeline could read.
Matching recordings to notes
Identity on both sides was free text typed by a busy person. A naive comparison of names matched 35% of folders to a set of recordings.
The approach that worked uses an LLM where rules break down, and rules everywhere else:
- An LLM reads the folder names. Given a clinician, a folder name and its first few file names, it returns the client's identity as structured data. That covered all 27 naming styles in about 40 batched calls, cached so a re-run only pays for new folders.
- Plain code does the matching. Each pair is scored on clinician, name tokens and dates: a note written within a week of a call is good evidence the two belong together.
- Confidence decides what happens next.
- Exact: full name plus a matching date. Merged.
- Strong: full name alone, or surname plus a matching date. Merged, with a sample checked by hand.
- Weak: surname only. Kept apart and flagged for review.
We deliberately did not ask an LLM to judge the matches. Scoring in code is free, gives the same answer every time, and can explain itself when someone asks why two things were joined.
The finished matcher reached 77%. For two clinicians whose folders never included a first name, the "surname plus a date" rule alone took their match rate from zero to around 90%. What stayed unmatched was mostly not a matching problem: older recordings from before notes were kept, and sessions that were never recorded.
Recordings that were not consultations at all, such as staff meetings, interviews and training sessions held on the same accounts, were filtered out.
The result was about 6,100 cases, each labelled by what it is made of: recordings and notes, recordings only, or notes only. Matching decides how things are grouped, never whether they are processed.
The pipeline ⚙️
INDEX list what exists, download nothing
↓
MATCH group recordings and notes into cases
↓
FETCH one case at a time, straight from the source
↓
TRANSCRIBE reuse an existing transcript, else ffmpeg → Whisper
↓
REDACT patterns → known names → AI pass (fails closed)
↓
STORE clean text only; audio and raw text are discarded
↓
ANALYSE repeatable passes over the stored textThe queue is a database table
Every recording and every document is a row with a status: pending, processing, complete, error or skipped. The worker picks up pending rows, so it can be stopped at any moment and carry on where it left off. No queue service, just Postgres. That decision earned its keep later.
Transcription 🎙️
Don't transcribe what is already transcribed. The index showed that Zoom already held a caption or transcript file for 45% of the audio hours. The worker downloads those, converts them to the same timestamped format Whisper produces, and skips the GPU entirely. That one check nearly halved the GPU time.
For the rest, ffmpeg strips out the audio (an hour of video is around 1GB, an hour of 16kHz mono audio around 60MB) and a self-hosted whisper.cpp server does the work. The GPU matters more than you might expect: a 45-minute recording took 108 seconds on a MacBook's GPU and 109 minutes on a CPU engine.
Three things we only learnt by measuring:
- The small model loses content. On a test call it fell into repetition loops and dropped a 100-word stretch of the conversation.
large-v3-turbotook 1.5 times as long and didn't. The audio is deleted afterwards, so a lost passage can never be recovered. This is the one place we refused to economise. - Silence makes Whisper hallucinate. Even the larger model looped over long silences in 14 of 186 transcripts. Voice activity detection removes the silence before decoding. The loops went away and transcription got about 30% faster.
- Pin the language. With auto-detect on, quiet openings were occasionally transcribed as Welsh 🤷
whisper-server -m ggml-large-v3-turbo.bin \
--vad -vm ggml-silero-v5.1.2.bin -mc 0 \
--host 0.0.0.0 --port 8080Redaction is a trust boundary 🔒
Personal details are removed in three layers, ordered by how certain we are:
- Patterns. Emails, phone numbers, postcodes and ID numbers are matched with regular expressions.
- Known names. The index already tells us who each case's client is, so those names are replaced in code. The names we are surest about never depend on a model noticing them.
- An AI pass. A model reads the text in 25,000 character windows and lists every remaining string that identifies a person. Code then replaces every occurrence.
That third layer is worth a closer look. The model never rewrites the document. It returns a short list:
const spanSchema = z.object({
names: z.array(z.string()),
addresses: z.array(z.string()),
identifiers: z.array(z.string()),
other: z.array(z.string()),
})
const { output } = await generateText({
model: redactModel,
output: Output.object({ schema: spanSchema }),
system: 'List every string that identifies a person, exactly as it appears in the text.',
prompt: textWindow, // one 25,000 character slice of the document
})
// Longest first, so "Jane Smith" is replaced before "Jane" and "Smith"
const { text } = applySpans(document, output) // → [NAME] [ADDRESS] [ID] [PII]Listing is about ten times cheaper than asking the model to rewrite the document, because the reply is a few words and not the whole text. It is also safer: a model rewriting a long document can quietly stop early, and you would never know.
If redaction fails, nothing is stored. The audio is deleted once it has been transcribed, and the database holds a one-way hash in place of the client's name, so a future recording can still be attached to the right case.
Redaction took a few rounds to get right. We compared models on real documents and wrote a separate audit that counts every known client name still present in the stored text, then kept closing gaps until nothing slipped through.
Across the finished archive, the audit found 0 of 18,987 known client-name tokens in 52,000 stored documents.
Two tracks after redaction
What happens next depends on who the text is for.
- The video library is knowledge the app's users are meant to see. It is split on paragraph and timestamp boundaries into passages of about 1,000 characters, embedded, and stored in pgvector: around 27,000 passages, each keeping its timestamp so an answer can point to the moment in the video it came from.
- Consultations are stored whole and never chunked. They are for the practice's internal use, and the unit that matters is the case, not the paragraph: each case gets one embedded summary. The search function behind the user-facing assistant only reads the video library, so consultation text cannot reach a user's answer, whatever the prompt says.
Running it for real
We priced more than a dozen ways to host the run, from dedicated servers to our own Mac ($0, five weeks). The winner was a single NVIDIA L4 on Google Cloud in London at spot pricing, under 50 cents an hour, plus a small always-on worker. Spot means the machine is cheap because Google can take it back whenever it likes.
Four Whisper processes shared the card, getting through around 3,000 minutes of audio an hour. Eleven days later the archive was stored. The AI bill for redacting 1.5 billion characters came to about $70, and the whole storing step cost in the low hundreds of dollars of cloud and AI spend. That figure is infrastructure, not our time, but it makes the point: compute is not the barrier to a project like this.
What went wrong 🏔️
A run this size never goes cleanly. Ours had three problems worth sharing.
Google took the GPU back more than twenty times, ten of them in a single day. That is the deal with spot pricing, and it is why the queue lives in the database: a scheduled job restarted the machine, the worker picked up where it stopped, and each interruption cost minutes, not work.
Our watchdog attacked healthy workers. We added a script to restart any transcription process that had hung. A log line torn by a reboot convinced it that a busy process was a stuck one, and it restarted that process 378 times, throwing away the file in progress each time. Throughput dropped by up to a fifth before we found it.
A rehearsal setting reached production. During rehearsals the worker skipped any case with more than five hours of audio. Nobody removed that limit for the real run, which finished with a clean exit code and left the 1,300 longest cases, more than half the audio, untouched. The status tables showed it straight away; the exit code never would have. It cost five more days of GPU time, and the worker now logs every case a limit excludes.
At the end, 82 cases still held a document we could not read, mostly corrupt Word files and broken PDFs. They are listed for the client, not hidden.
Where it ends up 🚀
The stored text is the foundation. Some of what sits on it is built and some is next.
- An assistant that cites the practice's own material. The video track is in place, so answers can come from, and point back to, what the practice itself has taught.
- Structured insight from every case. Each document is read against the framework, and every item it records must come with a supporting quote from the text. Anything a clinician describes that the framework has no entry for is collected into a gap report, so the archive improves the framework as well as being read through it.
- Similar-case search. With one embedded summary per case, the team can ask for past cases that resemble the one in front of them and see what was tried.
- An open-ended read. A separate pass reads the consultations with the framework deliberately hidden, to find what the clinicians do in practice and not only what the framework expects.
- New consultations, automatically. Around 900 hours of calls and 2,000 documents arrive each month, and will go through the same matcher and the same pipeline.
- Asking the archive questions. If staff want to query it directly, our design keeps two kinds of answer apart. "How often does X appear alongside Y?" is a database query with an exact answer. "What have clinicians said about X?" is a search that returns examples. Mixing the two is how a plausible but wrong number ends up in a serious conversation.
Closing thoughts
What we would tell another company
- Index before you plan. A list of what exists costs almost nothing and replaces every assumption with a number.
- Decide what you will never store before you decide what you will.
- Split the expensive, irreversible step from the cheap, repeatable ones. New questions then stay cheap for good.
- Measure on a real sample and budget from the measurements.
- Use LLMs to read messy human text, and plain code for anything you need to audit.
- Build to be interrupted. Something will stop your run. It should cost you minutes.
Could we do this for you? 🤝
If your company's expertise is locked up in recordings, inboxes and shared drives, this is work we enjoy. Get in touch and tell us what you're sitting on.