Design a Citation-Verified Legal Research Agent

Last updated: November 29, 2026

Quick Overview

Design an agent that answers a lawyer's legal research question by planning searches across case law, legislation and the firm's own documents, then writes a memo where every proposition is backed by a verified citation.

Legora
ML System Design
Machine Learning Engineer
Legora
November 29, 2026
Machine Learning Engineer
System Design Round
ML System Design
Hard

0

0

0 solved


Design an agent that answers a lawyer's legal research question by planning searches across case law, legislation and the firm's own documents, then writes a memo where every proposition is backed by a verified citation.

Legora's Agent and Workflows combine planning with tools such as research search and citation checking, and a fabricated case citation is the most damaging failure a legal AI can have. The interviewer probes agent orchestration, retrieval design, verification of grounding, evaluation with lawyers, and latency and cost control.

What the Interviewer Expects
  • Frames hallucinated or mis-cited authority as the primary risk and designs against it
  • Describes a plan, retrieve, read, draft, verify loop with bounded steps
  • Uses hybrid retrieval over sources with jurisdiction and date filters
  • Verifies each claim against retrieved text and checks citations exist and are still good law
  • Defines offline evaluation with expert-labelled sets and online quality signals
  • Addresses tenant isolation, cost per query and latency budgets
Key Topics to Cover
agents
retrieval augmented generation
grounding verification
evaluation
legal citations
latency budgets
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
  • How would you detect that a cited case was overturned or distinguished later?
  • How do you evaluate a memo when two senior lawyers disagree on the right answer?
  • What would you cut to bring a 4 minute research run down to 60 seconds?
  • How would you let a firm plug in its own knowledge bank without leaking it across clients?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice ML System Design Problems
Sample Answer
Requirements

Input: question, jurisdiction, optional matter documents. Output: a memo with an answer, reasoning, and citations to specific passages (case, paragraph; statute, section), plus explicit uncertainty. H...

High-Level Design

Planner (strong LLM) decomposes the question into sub-issues and search queries. Tools: legal database search (licensed case law and legislation, with jurisdiction, court and date filters), fi...


Submit Your Answer
Markdown supported

Related Questions