← Generative AI Mastermind for EngineersAll programsHomeSearch
Generative AI Mastermind for Engineers·Session Recordings·0:44:17

Bonus: Agentic RAG the Uber Way - Chunking, Query Optimiser, Source Identifier, Hybrid Retrieval, and LLM-as-Judge

Om Asnani Trainer (probable) - not named on air; the whole session

The short version

  1. Simple RAG: build the knowledge base once (chunk, embed, store), then query -> retrieve -> generate every time; re-feeding a whole document to a chatbot loses everything beyond the context window (0:04-0:09). The storage-room picture: chunks are files, embeddings are the drawer labels (0:06-0:09).
  2. Five chunking strategies - fixed, sliding window, sentence, semantic (the ~90% default), recursive by headings and paragraphs (0:09-0:13).
  3. Uber's benchmark of 100 SME-answered queries found inaccurate answers and poor retrieval. Agentic RAG puts an agent at every stage: a Query Optimiser rewrites 'certificate?' into 'when will I receive the certificate of this mastermind?'; a Source Identifier uses metadata and keywords to cut ~2,000 chunks to ~100 before retrieval (0:14-0:27). The knowledge base itself was fixed first: a structure-preserving loader instead of a PDF loader, plus LLM-generated summaries, FAQs, keywords and an index (0:17-0:21).
  4. Retrieval: BM25 keyword (precision), vector (meaning), graph (relationships), hybrid with reranking. Uber combined vector breadth with BM25 depth - 50 + 15 = 65 chunks - then a post-processor deduplicated to 35 and reordered by relevance before generation (0:28-0:35).
  5. Evaluation: faithfulness, relevance, and system KPIs (latency, cost, throughput, recall, precision, MRR, DCG). SMEs graded 100 cycles once into a golden test set; from then on an LLM judge batch-evaluates daily and feeds notes back into the system prompt. Reported ~27% accuracy gain overall, 60% from retrieval and indexing fixes (0:38-0:44).

At a glance, three clicks deep

Skim here first: the closed row is the glance, open is the study card with the key points and timestamps, and the ↓ link drops to that concept's full write-up below.

01Simple RAG and the five ways to chunkBuild once, query many;›

Build once, query many; semantic chunking by default; sliding window when continuity matters.

Query -> retrieve -> generate vs re-feeding documents (0:04-0:06)

Drawers and files analogy (0:06-0:09)

Five chunking types; semantic ~90% (0:09-0:13)

↓ Full write-up of this concept

02Fix the knowledge base before the model: structure-preserving loading and LLM enrichmentStructure-preserving loader + LLM-generated summaries / FAQs / keywords + a metadata index.›

Structure-preserving loader + LLM-generated summaries / FAQs / keywords + a metadata index.

PDF loader loses structure (0:17-0:18)

Summaries, FAQs, keywords per section (0:19-0:20)

Index: title, description, page, metadata (0:20-0:21)

↓ Full write-up of this concept

03Agentic RAG before retrieval: the query optimiser and the source identifierRewrite the query with context;›

Rewrite the query with context; pre-filter sources by index; then retrieve.

Agent at every stage (0:14-0:17)

Optimiser rewrite example (0:21-0:24)

Identifier: 2,000 -> ~100 chunks (0:24-0:27)

↓ Full write-up of this concept

04Hybrid retrieval (vector + BM25), then dedupe and reorderVector + BM25 -> union -> dedupe -> reorder by relevance -> generate.›

Vector + BM25 -> union -> dedupe -> reorder by relevance -> generate.

Four retrieval strategies (0:28-0:31)

50 + 15 = 65 chunks (0:32-0:33)

Dedupe to 35, reorder (0:33-0:35)

End-to-end diagram (0:36-0:38)

↓ Full write-up of this concept

05Evaluate with a golden test set once, then an LLM judge every dayFaithfulness + relevance + KPIs;›

Faithfulness + relevance + KPIs; golden set once; LLM judge in batches; feedback into the prompt.

Faithfulness, relevance, KPIs (0:38-0:40)

100-cycle golden set (0:41-0:42)

Daily LLM-as-judge batches (0:42-0:43)

~27% overall, 60% from retrieval fixes (0:43-0:44)

↓ Full write-up of this concept

06Read the case study as a reconstruction, not a screen recordingArchitecture = taught;›

Architecture = taught; figures = reported second-hand.

Disclaimer at 0:02-0:04

No source link read aloud (0:44)

↓ Full write-up of this concept

The concepts in full

01

Simple RAG and the five ways to chunk

A 20,000-line document in a 2,000-line window remembers only the last 2,000 lines. RAG is how you stop losing the rest.

The knowledge base is built once - chunk, embed, store in a vector database - and the query -> retrieve -> generate loop runs per question, unlike a custom GPT that re-reads the whole file. The storage-room analogy: one unsorted pile retrieves badly; drawers (embeddings) labelled by meaning hold files (chunks). Chunking choices: fixed length; sliding window with overlap for continuity; sentence-based; semantic, split by meaning with embeddings and recommended for ~90% of cases despite the compute; recursive, by headings then paragraphs then sentences.

Why it matters

Chunking is the first design decision in any RAG build and the one most people default badly.

02

Fix the knowledge base before the model: structure-preserving loading and LLM enrichment

Uber's biggest gain was not a smarter agent. It was a loader that kept the tables.

PROCEDURE as told: replace a plain PDF loader (which drops headings, tables and the table of contents) with a structure-preserving one - Uber used a loader on Google's Python document API that recursively extracts paragraphs, tables and TOC; run an LLM pass that adds a summary, FAQs and keywords to each section; build an index of title, description, page number and metadata so retrieval consults a light index before reading full chunks. This is where the reported 60% improvement came from.

Why it matters

The data-quality lever that outperforms adding more agents.

03

Agentic RAG before retrieval: the query optimiser and the source identifier

The user typed 'certificate?'. The system answered a question the user never wrote.

PROCEDURE with the worked example. Query Optimiser: rewrite the vague query using who is asking and when - 'certificate?' becomes 'When will I receive the certificate of this mastermind?'. Source Identifier: use keywords and metadata against the index to narrow ~2,000 chunks to about 100 candidates before any vector search. Both are agents added to a pipeline that used to be a single pass-through; the same idea adds agents at retrieval, post-processing and generation.

Why it matters

Solves garbage-in at the point most RAG systems ignore - the query itself.

04

Hybrid retrieval (vector + BM25), then dedupe and reorder

Vector search for breadth, BM25 for the exact phrase, and a post-processor so the best chunk goes first.

Four strategies: BM25 keyword matching (precise phrases), vector search (meaning), graph retrieval (entity relationships), hybrid (combine and rerank, top-k). Uber's fix was hybrid: vector returned 50 chunks, BM25 15, 65 combined; a post-processing agent removed duplicates to 35 and reordered by relevance to the optimised query so the most relevant reaches the model first; then generation ('you will receive the certificate in 48 hours only if you attend 80% live'). Vector-only retrieval was named as a root cause of the original failures.

Why it matters

The concrete recipe most teams skip by defaulting to vector-only.

05

Evaluate with a golden test set once, then an LLM judge every day

Humans graded a hundred answers exactly once. After that a model does the grading.

Metrics: faithfulness (answer consistent with retrieved context), relevance (answer and context address the query), and system KPIs - latency, cost, throughput, recall, precision, MRR, DCG. PROCEDURE: subject-matter experts review 100 real query / answer cycles once to create a fixed golden dataset; thereafter an LLM-as-judge batch-evaluates new queries against it (daily, not per query) and its notes feed back into the system prompt. Reported result: ~27% more acceptable answers overall, the largest share from retrieval and indexing, enough to deploy to Uber's internal security and privacy support.

Why it matters

A scalable evaluation loop for any RAG you ship to other people.

06

Read the case study as a reconstruction, not a screen recording

'I don't have Uber's end-to-end product... I can take an example.' Said on air.

The trainer states plainly that the 'certificate?' walkthrough is his own illustration of Uber's published approach, not their system; the 100-query benchmark, the 27% and 60% figures and the chunk counts are attributed to Uber without a link on air. Treat the architecture as the lesson and the numbers as claims to check against Uber's engineering blog.

Why it matters

Keeps the record honest about what was demonstrated versus reported.

Tools referenced

ToolCoverageMomentContext
BM25explainedKeyword retriever in the hybrid
SlackmentionedFront end of the internal RAG tool

Action items

    Resources mentioned

    Resources
    • docProgram logistics (opening chat relay)

    Extraction notes

    This page was built from an auto-generated transcript, which garbles product and people's names. Those were corrected silently in everything above and logged here for transparency. The warnings flag claims that were true on the recording day but change fast.

    Transcript corrections applied

    The transcript saysThe trainer actually means
    you don't do it if you don't know codingunresolved fragment in the opening logistics

    True on recording day — verify before relying