Large-Scale Legal RAG Implementation with Multimodal Data Infrastructure

harvey_/_lance · Legal · year n/a · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: High-stakes legal RAG over multimodal corpora

Harvey needed retrieval infrastructure for legal AI workflows where queries are expert, multi-part, jurisdiction-specific, and high stakes. The system had to span on-demand document uploads, matter-specific vaults, and country-scale legal corpora; combine semantic, keyword, filtering, and re-ranking behavior; support sensitive legal data with privacy and retention controls; and make retrieval quality measurable enough for rapid iteration.

Constraints:

Architecture

Harvey combines a legal AI assistant workflow with LanceDB's AI-native multimodal lakehouse. Harvey's side handles legal RAG across three data scales: small uploads, project vaults, and large knowledge corpuses. Retrieval development uses domain experts, legal query analysis, sparse/dense retrieval, filtering, heuristics, LLM processing, and a multi-tier evaluation strategy. LanceDB provides a unified storage and retrieval layer on object store for images, videos, audio, embeddings, text, tabular data, and time series data in one table. It supports offline preprocessing/training and online serving, compute-storage separation, multiple vector columns, vector plus full-text search, re-ranking, GPU indexing at billion-vector scale, and Lance format for random access, scans, blob data, schema evolution, and compatibility with Arrow, Spark, Ray, PyTorch, pandas, and Polars.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  assistant["Harvey legal AI assistant"] --> uploads["Small upload workspace"]
  assistant --> vaults["Project vaults"]
  assistant --> retrieval["Retrieval orchestration layer"]
  corpora["Legal corpora"] --> retrieval
  experts["Domain expert workflow"] --> corpora
  experts --> evals["Evaluation framework"]
  retrieval --> lance["LanceDB lakehouse"]
  lance --> format["Lance format"]
  lance --> gpu["GPU indexing"]
  lance --> privacy["Privacy and retention controls"]
  vaults --> privacy
  retrieval --> evals
  evals --> assistant
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Harvey legal AI assistant User-facing legal AI product for drafting, document analysis, legal workflows, and RAG over legal documents. Small upload workspace, Project vaults, Legal corpora, Retrieval orchestration layer
Small upload workspace On-demand assistant context for roughly 1-50 uploaded documents. Harvey legal AI assistant, Retrieval orchestration layer
Project vaults Larger matter or deal contexts containing contracts, litigation documents, emails, and data-room materials. Harvey legal AI assistant, Retrieval orchestration layer, Privacy and retention controls
Legal corpora Country- or domain-scale knowledge bases containing legislation, case law, taxes, and regulations. Retrieval orchestration layer, Domain expert workflow, LanceDB lakehouse
Domain expert workflow Lawyer and domain-expert guidance for understanding legal structure, query patterns, categorization, and evaluation criteria. Legal corpora, Evaluation framework, Retrieval orchestration layer
Retrieval orchestration layer Combines sparse, dense, semantic, exact-match, filter, and dynamic query decomposition techniques for legal RAG. Harvey legal AI assistant, Small upload workspace, Project vaults, Legal corpora, LanceDB lakehouse, Evaluation framework
LanceDB lakehouse AI-native multimodal lakehouse and serving layer for object-store-backed search, analytics, training, preprocessing, and feature engineering. Retrieval orchestration layer, Lance format, GPU indexing, Privacy and retention controls
Lance format Open source format supporting fast random access, scans, blob data, mixed scalar data, schema evolution, and Arrow-compatible data tooling. LanceDB lakehouse, GPU indexing
GPU indexing Billion-scale vector indexing path for very large LanceDB tables. LanceDB lakehouse, Lance format
Evaluation framework Multi-tier evaluation stack spanning expert reviews, expert-labeled criteria, synthetic or automated checks, and quantitative retrieval metrics. Domain expert workflow, Retrieval orchestration layer, Harvey legal AI assistant
Privacy and retention controls Customer segregation, retention policies, telemetry, and usage controls for sensitive legal data. Project vaults, LanceDB lakehouse

Data flow

Legal data enters as uploaded documents, matter vaults, or country-scale corpora. Domain experts help interpret structure, jurisdictions, explicit query fields, and implicit query patterns. Harvey uses heuristics and LLM processing to categorize and preprocess the data, then retrieval combines semantic search, exact keyword matching, filtering, vector/full-text search, and re-ranking. LanceDB stores multimodal source data, embeddings, text, scalar fields, and blobs together on object storage, enabling search, analytics, training, preprocessing, and feature engineering from a single source of truth. Evaluation runs at multiple fidelity levels: expert reviews, expert-labeled criteria, synthetic or automated checks, and quantitative precision/recall and deterministic retrieval criteria.

4 supporting quotes
“we handle data of all different sort of volumes and forms.”transcript, stated
“you want to be able to do that all together. So, what you really need is sort of this lakehouse architecture”transcript, stated
“combine multiple vector columns uh vector and uh full text search and then do re-ranking on top of that.”transcript, stated
“you can kind of ground that in evaluation where if you have good evaluation sets or either procedures or automation”transcript, stated

Why this architecture

Harvey needs hybrid retrieval and domain-specific processing because legal queries combine semantic meaning, exact citations, temporal filters, multiple regulations, and specialized jargon. LanceDB's lakehouse architecture fits because legal RAG is not only online vector search; teams also need preprocessing, analytics, training, feature extraction, schema evolution, random access, and multimodal data in one source of truth. The evaluation-heavy operating model is necessary because engineers cannot reliably judge legal correctness without expert feedback and retrieval-specific metrics.

4 supporting quotes
“there's a semantic aspect. There's sort of implicit filtering going on”transcript, stated
“there's kind of keyword matches of like the specific, you know, regulation directive ID.”transcript, stated
“all the data can be stored in one place on object store. Um, you can run search and retrieval workloads, you can run analytical workloads”transcript, stated
“investing in eval driven development is a huge huge key to building these systems and making sure they're good”transcript, stated

Models used: large language models · retrieval-augmented generation · dense retrieval · sparse retrieval · vector search · full-text search · re-ranking · LLM processing techniques · LanceDB · Lance format

Scale

Alternatives considered (roads not taken)

Use only generic semantic vector search

Rejected because: Legal queries also require implicit filters, exact regulation IDs, multi-part legal references, and domain jargon handling.

“there's a semantic aspect. There's sort of implicit filtering going on”transcript, stated
“there's kind of keyword matches of like the specific, you know, regulation directive ID.”transcript, stated

Treat retrieval quality as primarily an algorithm problem

Rejected because: Harvey says the team spends more effort validating systems than inventing algorithms or agentic techniques.

“that's actually where we spend a ton of time. It's, you know, not as much on the algorithms and the the fancy agentic techniques”transcript, stated
“but more like how to validate them.”transcript, stated

Store AI data across multiple specialized systems

Rejected because: LanceDB argues split copies force AI teams to spend effort keeping data glued together and synchronized.

“different copies of different parts of their data in different places”transcript, stated
“spending a lot of their time and effort just sort of keeping those um pieces glued together and in sync with each other.”transcript, stated

Use traditional Parquet/Iceberg-style storage alone for multimodal AI data

Rejected because: The speaker says those formats miss features needed for random access, blob data, and schema evolution in multimodal AI workloads.

“if you're doing that in let's say like web data set or iceberg parquet you're missing out on a lot of features”transcript, stated
“lack of random access or the inability to support large blob data or not being very efficient about schema evolution.”transcript, stated

Patterns

rag-retrieval (retrieval)

Harvey uses retrieval-augmented legal AI over uploaded documents, vaults, and country-scale legal corpora.

“working on rag um tough rag problems across massive data sets of complex legal docs and complex use cases.”transcript, stated
“data corpuses which are like knowledge bases around the world.”transcript, stated

hybrid-search (retrieval)

The retrieval layer combines semantic matching, exact keyword matches, filters, multiple vectors, full-text search, and re-ranking.

“semantic matches you want filters you might want sort of to sort of navigate it maybe yeah agentically or like in some dynamic way.”transcript, stated
“combine multiple vector columns uh vector and uh full text search and then do re-ranking on top of that.”transcript, stated

eval-driven-development (evaluation)

Harvey uses expert reviews, expert-labeled criteria, automated evaluation, precision/recall, and deterministic criteria to guide legal RAG iteration.

“investing in eval driven development is a huge huge key to building these systems and making sure they're good”transcript, stated
“more automated quantitative metrics like just you know retrieval, precision and recall”transcript, stated

privacy-preserving-processing (security)

The system accounts for sensitive legal data, customer segregation, and document retention limits.

“A lot of this data is sensitive for like confidential deals or confidential I don't know IPOs, financial filings”transcript, stated
“storage needing to be like segregated depending on the customer depending on the use case sort of retention policies”transcript, stated

retrieval-ranking (retrieval)

LanceDB exposes re-ranking on top of vector and full-text retrieval for complex legal query patterns.

“vector and uh full text search and then do re-ranking on top of that.”transcript, stated

data-quality-loop (data)

Domain experts and automation are used together to categorize, organize, preprocess, and evaluate legal data so retrieval can improve.

“work with domain experts for all of this, but also try to apply automation whenever possible”transcript, stated
“use their guidance to maybe come up with heristics or LLM processing techniques um to be able to categorize all this.”transcript, stated

Tradeoffs

Evaluation strategy

Chose Tiered expert and automated evaluations over Only expert review or only automated metrics.

Rationale: Expert reviews are highest fidelity but expensive, while automated metrics support faster iteration.

“higher fidelity but more costly and then the other direction it's like more automated evals that are faster to iterate on.”transcript, stated
“retrieval, precision and recall sort of different more deterministic success criteria”transcript, stated

Data architecture

Chose Multimodal lakehouse on object store over A vector database alone.

Rationale: The application needs search plus analytics, training, preprocessing, feature extraction, summaries, text descriptions, and multimodal storage.

“beyond what I call just a vector database but what we call an AI native multimodal lakehouse”transcript, stated
“you can run search and retrieval workloads, you can run analytical workloads, you can train off of that data”transcript, stated

Retrieval API surface

Chose Combined vector columns, full-text search, and re-ranking over Single-vector similarity search only.

Rationale: Legal query patterns need exact matches, semantic matches, filters, and dynamic navigation over complex data.

“exact matches you want semantic matches you want filters”transcript, stated
“combine multiple vector columns uh vector and uh full text search and then do re-ranking on top of that.”transcript, stated

Storage model for AI data

Chose One table with mixed blobs, embeddings, text, and scalar data over Separate synchronized copies across multiple systems.

Rationale: Keeping data in one place avoids glue code and synchronization work while supporting search, analytics, training, and preprocessing.

“You can put all of that in a single table.”transcript, stated
“spending a lot of their time and effort just sort of keeping those um pieces glued together and in sync with each other.”transcript, stated

Gotchas (what bit them)

Legal questions rarely map to one retrieval mode.

Root cause: A single query can combine semantic intent, dates, specialized datasets, exact legal IDs, multiple regulations, and domain abbreviations.

Resolution: Break down the query and use the appropriate retrieval and filtering technologies for each part.

“there's a semantic aspect. There's sort of implicit filtering going on”transcript, stated
“we sort of need a need a system that can tackle all this complexity and sort of break down this query”transcript, stated

Engineers cannot rely on intuition alone in specialized legal domains.

Root cause: Legal documents and queries contain domain-specific details that engineers or researchers may not inherently understand.

Resolution: Work with domain experts and invest in expert-driven evaluation procedures.

“it's a tough domain that like you don't inherently know much about as maybe an engineer or a researcher.”transcript, stated
“work with domain experts and try to sort of immerse yourself as much as possible in that.”transcript, stated

High-fidelity legal evaluation is expensive.

Root cause: The highest quality feedback requires experts to review outputs, analyze them, and write reports.

Resolution: Use a tiered evaluation strategy that balances expert review with curated criteria and automated quantitative metrics.

“expert reviews of just having them directly review outputs and analyze them and write reports.”transcript, stated
“that's like super expensive but super high quality.”transcript, stated

Multimodal AI data fragments across systems if storage is not designed for it.

Root cause: Traditional formats can lack random access, blob support, and efficient schema evolution for mixed embeddings, text, images, video, and scalar data.

Resolution: Use Lance format and a lakehouse architecture that stores multimodal data together as a single source of truth.

“you can put you know images and uh videos and audio track next to your embeddings next to text data”transcript, stated
“single source of truth for all the different workloads that you want to do that do on that data from search to analytics to training”transcript, stated

Privacy requirements affect the retrieval infrastructure itself.

Root cause: Legal customers may require segregated storage and legally constrained retention periods.

Resolution: Build flexible data privacy and retention capabilities into the database/infrastructure layer.

“flexibility and capabilities around data privacy and data retention.”transcript, stated
“storage needing to be like segregated depending on the customer depending on the use case sort of retention policies”transcript, stated

Evaluation

Harvey evaluates legal RAG with a layered approach: expert legal reviews and reports for highest fidelity, expert-labeled criteria that can be evaluated synthetically or automatically, and faster quantitative checks such as retrieval precision and recall, folder correctness, section correctness, and keyword matching.

Metrics: expert review quality · expert-labeled evaluation criteria · synthetic or automated evaluation over criteria · retrieval precision · retrieval recall · document folder accuracy · section correctness · keyword matching validation · online latency · offline ingestion and reingestion performance

4 supporting quotes
“expert reviews of just having them directly review outputs and analyze them and write reports.”transcript, stated
“expert labeled like set of criteria that you can maybe evaluate synthetically or evaluate in some automated way.”transcript, stated
“more automated quantitative metrics like just you know retrieval, precision and recall”transcript, stated
“am I pulling documents from the right folder? Is it the right section? Do they have the right keywords in them?”transcript, stated

Outcomes

The talk describes 1-50 document upload contexts, large matter vaults, country-scale corpora, tens of millions of documents per corpus, sensitive legal datasets, online and offline workloads, and LanceDB GPU indexing around three to four billion vectors in under two to three hours.

4 supporting quotes
“that's like a smaller 1 to 50 range.”transcript, stated
“one of these corpuses can be like yeah tens of millions of docs.”transcript, stated
“three or four billion vectors in a single table um that can in index in under uh two or three hours.”transcript, stated
“new data infrastructure has to recognize that there's sort of this new world we're entering with multimodal data”transcript, stated