Use cases

RAG for Law Firms: Querying Statutes, Case Notes and Memos With Sourced Answers

The Kopik team11 min read

Law firms sit on huge volumes of statutes, case notes, client memos and internal precedent that no single associate can hold in memory. Retrieval-augmented generation (RAG) lets a firm search that material in plain English and get an answer with the exact passage it came from, instead of a generic summary from a public chatbot. Done right, it cuts research time without replacing the judgment only a licensed attorney can exercise. This guide covers what to retrieve, how to keep it confidential, and where the professional responsibility limits actually sit.

A general-purpose chatbot answers from whatever it was trained on, plus whatever you paste into the conversation. That creates two problems for a law firm. First, the model has no idea what is in your internal memo bank, your firm's past briefs, or the specific statute edition your jurisdiction uses this year, so it will either refuse to help or quietly invent something plausible. Second, pasting client material into a consumer chat tool to get around that problem is itself a confidentiality risk: you don't control where that text goes, how long it's retained, or whether it resurfaces in someone else's session.

RAG solves the first problem by grounding every answer in documents you actually uploaded, and the privacy concern by letting you keep the knowledge base private, queried only through your own account or API keys. For background on the mechanism itself, What Is RAG (Retrieval-Augmented Generation)? A Practical Guide walks through how retrieval and generation fit together.

What a law firm knowledge base should actually contain

The value of a legal RAG system depends entirely on what you feed it. Three categories cover most of what a litigation or transactional team needs on a daily basis.

Statutes and regulations

Statutory text is highly structured: sections, subsections, cross-references, defined terms that mean something different in Title 18 than in Title 26. A naive fixed-size chunker will cut a definition away from the clause that uses it, which produces answers that sound confident and are subtly wrong. If your firm is building a base on primary sources, it's worth reading Chunking Strategies for RAG: Fixed-Size, Semantic, and Structure-Aware Splitting Compared before uploading anything, because structure-aware splitting on section boundaries matters far more here than in a typical business document set.

Case notes and internal memos

These are the documents a general chatbot will never have seen: deposition summaries, internal research memos, client intake notes, past motion drafts. This is also where RAG earns its keep fastest, because an associate who asks "have we argued this exact standing issue in the Ninth Circuit before" gets back the actual memo paragraph, not a guess.

Client-facing documents and contracts

Engagement letters, executed contracts, amendments and exhibits belong in a separate, more tightly access-controlled base than general research material, since they carry client-specific confidentiality obligations that statutes and public case law do not.

Legal text is full of exact strings that matter character for character: statute numbers, docket numbers, defined terms in all caps, Latin phrases. Pure semantic (vector) search is good at finding conceptually related passages even when the wording differs, but it can miss an exact citation match buried in a long document. Pure keyword search catches the exact string but misses a question phrased differently from the source text. Legal retrieval needs both at once, which is why Hybrid Search: Why BM25 + Vectors Beats Either Alone for RAG is particularly relevant to this use case: a hybrid engine finds the section by its number and also surfaces the paragraph that answers the underlying question even when no keyword matches.

Answer mode vs. passages mode

Most RAG platforms, including Kopik, offer two response modes: a synthesized answer with cited passages, or raw passages only. For legal research, many teams default to passages mode for anything that will go into a filing, since it forces the reviewing attorney to read the actual source text rather than trust a paraphrase.

Confidentiality, privilege and private knowledge bases

The single biggest adoption blocker for legal AI is confidentiality, and it's a legitimate one. A knowledge base built from client files, privileged memos or settlement terms cannot sit in a public catalogue where anyone can pay to query it. The fix is straightforward but has to be deliberate: when you create a base, set it to private rather than public. A private base is queryable only by its owner and by whoever holds the owner's API keys, which means you can scope access by team, by matter, or by practice group without ever exposing the underlying documents outside the firm.

  • Keep client files, memos and privileged material in private bases, never public ones
  • Issue separate API keys per team or per matter so access can be revoked individually if someone leaves the firm
  • Treat a public catalogue base (if you ever publish one) as containing only material you'd be comfortable with a stranger reading, such as a public FAQ on a published statute
  • Confirm in writing with your AI vendor that uploaded documents are not used to train shared models

If you want a deeper look at what "private" actually guarantees from a technical standpoint, including who can query a base and how API keys scope that access, see A private knowledge base as your own RAG for AI agents, with zero infrastructure. The same reasoning that applies to any sensitive internal documentation applies here, just with a privilege analysis layered on top. For a broader walkthrough of rollout pitfalls across legal, HR and compliance functions, RAG for Legal, HR and Compliance Teams: Use Cases, Pitfalls and a Safe Rollout Plan is a useful companion piece.

Verifying answers before you rely on them

Several attorneys have been sanctioned in the past few years for submitting briefs with citations that a general chatbot invented out of whole cloth, cases that simply do not exist. That failure mode is specific to ungrounded generation: a model asked to produce a citation from memory will sometimes produce a fluent, correctly formatted, entirely fabricated one. A properly configured RAG system is structurally different, because it can only cite passages that are physically present in the documents you uploaded. If the answer cites a case, you can click through to the exact paragraph and confirm it exists in your own corpus.

That said, "the passage exists in the document" is not the same as "the passage is still good law" or "the passage answers your actual question correctly." A RAG answer still needs a human check before it goes anywhere near a filing. Document Q&A With Citations: How to Check an AI Answer covers the review habits worth building into a verification step: reading the cited passage in full context, not just the highlighted snippet, and checking whether the source document itself is current.

What RAG is and isn't good for in a law firm

TaskRAG handles it wellNeeds a human lawyer regardless
Finding a prior memo on a similar fact patternYes, fast full-text and conceptual search across the firm's archiveJudging whether the precedent actually applies to the new matter
Pulling the exact text of a statute sectionYes, if the base is structured by sectionInterpreting ambiguous language or conflicting amendments
Checking if a case is still good lawNo, a RAG base only reflects what's in itShepardizing or KeyCite-style citator checks on a live legal database
Drafting client-facing legal adviceNo, it can surface research, not give adviceAlways, this is practicing law and requires a licensed attorney
Searching across jurisdictions not in the baseNo, retrieval is limited to uploaded documentsSourcing and uploading the relevant jurisdiction's material first

The recurring theme is scope: a RAG system is only as current and as complete as the documents you put into it. It will not flag that a statute was amended last month if the amendment isn't uploaded, and it has no concept of whether a case has been overturned unless that information is in the corpus. Treat it as a very fast, very literal research assistant, not a citator and not a source of legal advice.

Professional responsibility: staying inside the lines

Most state bars have adopted some version of the duty of technology competence tied to Model Rule 1.1, which means attorneys are expected to understand the tools they use well enough to supervise them properly, not to avoid AI altogether. In practice that translates into a few concrete habits: disclose to clients if AI tools materially assist on their matter where your state or the client's engagement letter requires it, never submit a citation you haven't personally verified exists and says what the tool claims it says, and keep privileged material inside private, access-controlled bases rather than public or shared tools. None of this is unique to RAG, but RAG's citation-grounded design makes the verification step faster and the failure mode (a fabricated case) structurally much less likely than with an ungrounded chatbot.

  1. Decide the scope of your first base: a single practice group's memo archive is a better starting point than "everything the firm has ever produced"
  2. Gather the documents, PDFs, Word files or plain text all work, and upload them at /dashboard/bases/new
  3. Set the base to private so only firm accounts and API keys can query it
  4. Choose answer mode for quick research questions and passages mode for anything headed into a filing
  5. Connect the base to the tools your associates already use through the REST API or MCP server, so they can query it from inside Cursor, Claude or a case management workflow without copy-pasting documents around
  6. Review a sample of answers against the underlying documents before rolling it out firm-wide, and assign someone to own document updates as statutes and case law change

If your associates or paralegals already work inside an AI assistant for drafting, connecting that assistant to a scoped knowledge base through MCP is often the fastest adoption path, since it avoids a separate interface entirely. How to Connect Claude, Cursor or ChatGPT to a Knowledge Base covers the setup steps.

Build a private legal knowledge base

Upload your statutes, case notes and internal memos, keep the base private, and query it with cited passages through the web, API or MCP.

Public vs. private: when a firm might publish research

Not everything a firm produces needs to stay locked down. Some firms publish a base of general, non-privileged material, a plain-English explainer on a recently amended statute, a public FAQ for prospective clients, and list it in a catalogue such as /bases where visitors pay per question. That's a reasonable monetization path for marketing-adjacent content, but it only works for genuinely public material. The moment a document references a specific client, matter number or settlement term, it belongs in a private base, full stop.

The bottom line

RAG gives a law firm a fast, citation-grounded way to search its own statutes, case notes and memos without the fabrication risk of a generic chatbot and without the confidentiality exposure of pasting client material into a consumer tool. It shortens research time and surfaces internal precedent that would otherwise live in one associate's memory. It does not replace a citator check, it does not give legal advice, and it does not remove the attorney's duty to read and verify every cited passage before it goes into a filing. Used with that boundary in mind, it's one of the more defensible AI applications a firm can roll out this year.

Separate bases by sensitivity

Rather than one giant base, most firms do better with several: a public-statute base, a private internal-memo base per practice group, and a tightly scoped client-matter base with individually issued API keys. It keeps access control simple and makes an eventual audit far less painful.

Frequently asked questions

Is a RAG answer legal advice?

No. A RAG system surfaces passages from documents you uploaded and can summarize them with citations, but it does not exercise legal judgment, weigh facts against precedent, or advise a client. Only a licensed attorney can give legal advice, and any RAG output headed toward a client or a filing needs that attorney's review first.

Can we safely put privileged client documents into a RAG system?

Yes, as long as the knowledge base is set to private so only your firm's accounts and API keys can query it, and your vendor confirms uploaded documents are not used to train shared models. Public, pay-per-question bases are the wrong place for anything containing client-identifying or privileged material.

Does RAG fix the fake-citation problem that's gotten attorneys sanctioned?

It substantially reduces that risk because the system can only cite passages that physically exist in your uploaded documents, unlike an ungrounded chatbot generating a citation from memory. It does not eliminate the need to verify that the cited passage is current, correctly interpreted and still good law.

What's the difference between RAG and fine-tuning a model on our firm's documents?

RAG retrieves relevant passages at query time and keeps every answer traceable to a specific document, which makes it auditable and easy to update by simply adding or removing files. Fine-tuning bakes patterns from your documents into the model's weights, which is harder to audit, harder to update, and a much larger confidentiality surface for a law firm to manage.

How do we decide between answer mode and passages-only mode for legal research?

Use answer mode for quick internal questions where speed matters more than exact wording, such as an associate checking whether the firm has handled a similar issue before. Use passages-only mode whenever the output might inform a filing or client communication, since it forces direct reading of the source text rather than a paraphrase.

Can clients query our firm's knowledge base directly?

Only if you deliberately grant them access through a scoped API key or a dedicated public base containing nothing privileged or client-specific. Most firms keep client-matter material in private, internal-only bases and would only ever expose a separate, clearly non-confidential base to outside users.

Get the Kopik newsletter

New knowledge bases, RAG guides and product news. One email every week or two, unsubscribe in one click.

By subscribing you agree to receive our newsletter. We never share your address.