← All work

The retrieval pipeline behind the copilot

Crehana · Senior Machine Learning Engineer · Feb 2025 – Sep 2026 · 2 min read

10K+ docs/week1.2M+ vectors200-question golden set

RAG · Qdrant · OpenAI embeddings · Python

Problem
The copilot answers from each company's own documents: 10K+ new documents a week, 1300+ organizations, and no company may ever see another's data.
My role
I built and ran the ingestion pipeline, enforced per-organization filtering, and rebuilt preprocessing per format when companies started uploading every kind of file.
Result
A search corpus of 1.2M+ vectors on Qdrant, reindexed every weekend, with every change scored against a 200-question golden set.

What flows in

Information flowed continuously from the platform's HR modules into the master database as companies edited, uploaded, and generated records, more than 10K documents a week. Every weekend the pipeline reindexed that into a search corpus of 1.2M+ vectors on Qdrant, using OpenAI embeddings over overlapping chunks.

Multi-tenancy

1300+ organizations share the platform, and no company may ever see another company's data. Retrieval enforces metadata filtering per organization on the vector side, on top of tenant schemas in the relational database. I also evaluated moving to separate collections per tenant, which buys stronger isolation and much simpler offboarding when a customer leaves, at the cost of operational overhead across that many organizations. Filtered search won at our scale; separate collections become the better call once isolation matters more than operating cost.

Every weekend HR platform records edited and created continuously Files companies upload docs, slides, sheets, PDFs, audio Preprocessing per format Chunking with overlap, embedding Vector store 1.2M+ vectors, reindexed weekly 10K+ documents a week At question time Question, from one company Retrieval filtered to that company searched Answer grounded in that company's own text
The pipeline. Retrieval is filtered to the asking organization, so one company's question can only ever be answered from that company's own material. Everything above that gate is shared plumbing; the gate is what makes it safe to share.

When companies started uploading every format

Companies started uploading every kind of file: Word, PowerPoint, Excel, PDFs, even audio, far beyond the HR documents the system was designed for, and they expected answers from all of it. We rebuilt preprocessing per format, redesigned chunking and indexing, and replaced single-pass similarity search with a retrieval approach that held up across all those formats. Each change had to hold up on the 200-question golden set, with no loss in speed.

How I evaluated it

Every change was scored for answer accuracy against a golden set of 200 questions before it counted as an improvement. The next step would be retrieval-level metrics such as hit rate and MRR, to tell search misses from generation misses. Qdrant held up at 1.2M+ vectors, so the effort went into retrieval quality, not the database.

More case studies