Experience

Two layers of the same platform: the structure, and the measurement.

I have worked on one retrieval platform from two directions: building structure into it, and then building the measurement that says whether the structure helped. Both case studies below are about the same product at different layers.

Case study 01

GraphRAG: what it takes to turn a prototype into a module the platform keeps

Graph constructionOntology extractionEntity resolutionHybrid retrieval

Context

The company’s agentic RAG framework answered questions over document collections. Retrieval at the time was chunk similarity plus keyword matching: good at “what does this document say about X”, weak at questions whose evidence is spread across documents and whose answer depends on which entities are the same entity. A question like “which of these suppliers also appear in the incident reports” needs a graph, not a better embedding.

I proposed a GraphRAG module, built the prototype, and took it into the framework. The work below is that module, not the platform around it.

Problem

Three problems had to be solved before a graph was worth having:

  1. What counts as an entity. Extraction without a type system produces noise that resolves into the wrong things. We needed an ontology the domain actually uses.
  2. Which mentions are the same thing. “Vendor A”, “A Ltd”, and “A Limited” arrive as three nodes unless resolution is explicit and auditable.
  3. How retrieval uses the graph. A graph that only serves graph-shaped queries is a sidecar. It has to feed the same retrieval path that already worked.

My contribution

Proposed and led a GraphRAG module and took it from prototype into the company’s agentic RAG framework, where it now runs in production.

Concretely: the module’s design, the ontology iterations, the entity-resolution rules, the hybrid retrieval path, and the evaluation of each version. The framework, the ingestion pipeline and the customer documents were already there; the platform team owns them.

The requirement that shaped everything else

The questions that motivated the module are joins, not lookups. “Which of these suppliers also appear in the incident reports” has no single document that answers it: one side of the join lives in a vendor list, the other in a set of reports, and the thing that makes them the same is an entity, not a phrase. A chunk-similarity retriever can find both halves and still fail the question, because nothing in the ranking knows that two differently spelled names are one company.

So the module’s output was never meant to be a picture of a graph. It had to hand retrieval something it could use: a set of candidate chunks narrowed by the join, with provenance back to where each claim came from, so an answer can be checked instead of trusted. Everything downstream of that requirement follows - extraction has to be typed, resolution has to be explicit and auditable, and the type list has to stay small enough that a reviewer can still hold it in their head.

Deciding that first was the most useful week of the project. Most graph work I have seen dies because it is built as a separate query mode with its own interface: it looks impressive, nobody uses it, and it drifts away from the retrieval path that actually ships. Making the graph a constraint on an existing path gave it a reason to exist and a testable definition of done.

How the ontology changed, and why it keeps changing

An ontology is not a document you write once. The first version was a flat list of entity types and relation groups, drawn from what the customer documents seemed to contain. Extraction then produced near-duplicates that resolved into separate nodes, so the second version did the opposite of what a type list usually does: it cut the top level and pushed the precision into subtypes and relation categories underneath. Fewer things at the top, more discipline lower down.

The rule I ended up with is that a type has to earn admission. It went in only if it appeared on both sides of a relation the documents actually showed, and the questions from the labelled set filled the gaps the documents did not argue for; everything else stayed out of the list. That kept the type set small enough to review and small enough to re-extract, which are the same constraint seen from two sides. A stronger extraction model did not settle it either: it produced far more candidates and a weaker relative trim on relations, so more is not the same as better. I left that as an open question, because neither mapping had been scored on a downstream task.

The real cost is maintenance, and it grows with the corpus. Every new document genre arrives carrying entities the list has never seen - a new kind of contract, a product name, an internal team - and each addition is paid for twice: once in extraction, and again in the review that decides whether the new node is a real distinction or noise. The graph is cheap to query and expensive to keep honest, which is why the list is kept smaller than the evidence rather than equal to it.

Later versions of that ontology were adopted and kept being iterated by the team as the corpus grew. I designed the admission rule and ran the versions described here; the shape of the problem - keep the list smaller than the evidence, let subtypes carry the detail - did not change.

Results

The module runs inside the company’s RAG framework, and the simplified structure is the one that survived: the top-level list got smaller, the precision moved into subtypes and relation categories, and the first ones built were the ones with support from both the documents and the user questions.

What I cannot point to is an end-to-end answer-quality number for the module. That measurement belongs to the platform, not to me, and I am not going to quote it as mine.

What I would do differently

I built the extraction before the label set. The ontology would have converged a round earlier if I had spent the first two weeks labelling 200 documents and looking at what the domain owner called the same thing, instead of building extraction and asking afterwards.

Case study 02

The reranker was the easy part. The number in front of it was wrong.

Eval designBenchmarkingModel servingLatency budgets

Context

Before a reranker can be chosen, the metric that judges it has to be right. Ours was not: chunk scores were normalised by how many chunks their parent document had been split into. One-chunk documents were never divided and sat at the top permanently, while documents split into two, three, four or many chunks collapsed into roughly one band - so the ranking was ordered by chunk count instead of relevance, and cross-document comparison stopped meaning anything.

I found the fault while comparing two retrieval configurations whose difference was smaller than it should have been, and fixed the scoring at the chunk level. Recall@15 on the 55-query set went from 49.3% to 85.1%, and on the 43-query set from 47.9% to 86.8% - the combined number the evaluation reports, at NR = 15 (fifteen results per query). The per-stage rows are what made it visible: on the 55-query set the same run read 0.1517 at the document level and 0.7512 at the chunk level, and the rescoring stage returned a row identical to the one before it. Two scoring paths disagreeing that widely, with a stage in between that changes nothing, is the shape of a broken measurement rather than a ranking result. A full write-up is in the note: the recall number that was wrong.

Everything below depends on that fix. Every benchmark I ran afterwards used the corrected evaluation as its baseline; how that benchmark was staged - one variable per round, and why the order of the rounds mattered - is in the benchmark note.

My contribution

The evaluation the platform’s retrieval work now measures against; the reranker benchmark (design, harness, analysis, the recommendation); the serving configuration for the model that shipped; the integration of the reranking and entity-extraction calls into the pipeline.

Problem

Two datasets, 55 and 43 labelled queries, an internal set with no public equivalent, and five reranker architecture families served four different ways. A hard budget: median latency under two seconds per query. Picking the best model on the biggest dataset was not the question. The question was which configuration is still the best one when the budget, the pool size and the sequence length are all allowed to move.

Experiments

The screening round was twenty models across sixty-six configurations, run on a ranking benchmark whose pool already held the gold chunks: it answers who ranks well given good candidates, not what a real pool retrieves. The numbers below come from the sweeps that followed on the two labelled sets, with every surviving model at a fixed serving setup, then sequence-length and batch sweeps, then pool-size changes on the two best.

55-query set43-query set
baseline (no reranker)83.6%91.5%
nvidia/llama-nemotron-rerank-vl-1b94.6%98.8%
median / p95 per query1.267 s / 1.304 s1.671 s / 1.739 s
shipped configpool 100 → 15, max_length 512, batch_size 32same
Recall@15 on both labelled sets. The baseline row is the same retrieval without a reranker. Deltas are computed on unrounded values; the columns are rounded to one decimal.

Four things the sweeps settled:

  • Sequence length mattered more than batch size. At max_length 128 recall fell to 70.3%, at 256 to 81.2%, at 512 to 94.6%. Going past 512 bought 96.4% at full context and cost the latency budget outright.
  • Batches from 4 to 128 left Recall@15 unchanged and degraded ranking quality at 64 and above. MRR and nDCG both dropped, so the throughput win was not free.
  • Pool size 50 still reaches 94.6% at 0.954 s per query; top-30 drops to 88.2%. That is the honest shape of the trade-off: you can halve the latency, but not below a pool of about 50 without losing recall.
  • A two-stage cascade never beat a single strong model. I tried it because it should have won on cost. It did not, so the recommendation was one model and no cascade.

Why this is the job, not the paperwork around the job

Evaluation is where the bugs that no unit test catches show up. Ours were not the kind that throw: a rescoring stage that was a no-op because the ranking was already pinned by a divisor, scores divided by chunk count so that one-chunk documents never lost, a comparison whose arms were rebuilding their own dependencies on every query. None of those would have surfaced in review, and all of them were visible in a per-stage table.

The same measurements buy speed, not just correctness. Knowing which knob is free is what makes a configuration decision possible at all: sequence length had to go to 512 before the ranking numbers meant anything, batch size turned out to matter to ranking but not to recall, and the pool could be halved without losing the winner. A team that cannot see those three things either overfits one model or pays for capacity it does not need.

This is the part of the work I want to be hired for. Building the retriever or wiring the model is an afternoon; deciding what evidence would make the change worth keeping, then producing that evidence and living with the answer, is the part that decides whether a system improves or just changes. Research training makes the measurement rigorous, and engineering makes it cheap enough to run before every release instead of after the incident.

Deployment

The winner is a 1.1 B parameter model that is not compatible with the vLLM build we had, so on the GPU cluster I served it separately behind a /v1/rerank endpoint, one model per MI250X card, with the remaining candidates served through vLLM for comparison. Each measurement ran with one warmup and three repeats.

The served path is a different environment: the reranker runs with vLLM on AWS GPU inference inside the pipeline, with the entity-extraction models integrated as services alongside it. I did not own monitoring or the surrounding infrastructure.

Results, stated carefully

  • The reranker improves cross-document recall by 10.9 and 7.4 points on the two labelled sets, and stays inside the two-second budget with median 1.3 s and 1.7 s.
  • The numbers are calibrated on two internal query sets of 55 and 43 queries. They are priors for what a similar corpus behaves like, not laws.
  • Recall is a retrieval metric. Nothing here says the generated answer is better; that measurement does not exist yet.

What I would do differently

I would have written the evaluation down before the benchmark started: which arm is frozen, which variable moves per round, and what result would make me stop. Two of the three sweeps re-ran configurations whose only difference was a setting I had already shown not to matter.