Use Cases + Implementation

How do you build legal assistants with RAG?

A legal assistant built on RAG answers questions from contracts, memos and policies by retrieving the governing provision and citing it precisely. Chunk by clause and section, embed with plugsky-embed or plugsky-embed-multilingual, store matter and version metadata, then generate cited answers through the live chat completions endpoint — while documents stay inside your region and access model.

Key facts

PipelineClause-level chunking → embeddings → cited answers
Embeddingsplugsky-embed and plugsky-embed-multilingual via /v1/embeddings (live)
GenerationCited answers with JSON mode on /v1/chat/completions (live)
MetadataMatter, counterparty, version and clause number per chunk
Models30+ models, including plugsky-longctx for long agreements
AccessMatter-level filters applied before retrieval
ResidencyRegion-locked planes, VPC, on-prem and air-gapped options
Free tierplugsky-micro and plugsky-lite on the free plan, no card required

TL;DR

  • Chunk by clause so every retrieved passage maps to an identifiable provision.
  • Cite clause numbers, not page numbers, so citations survive renegotiation drafts.
  • Filter retrieval by matter before ranking to preserve confidentiality walls.
  • Keep version and execution date metadata so superseded drafts do not win.
  • Have lawyers verify answers; the assistant prepares, it does not opine.

How it works, step by step

  1. Assemble the corpus for one practice area — executed agreements, templates, memos and policies — with matter and version metadata.
  2. Chunk by clause and section, numbering each chunk and keeping headings, definitions and execution dates.
  3. Embed chunks with plugsky-embed, or plugsky-embed-multilingual for cross-border matters in multiple languages.
  4. Build retrieval that resolves the lawyer's matters and applies matter and version filters before ranking.
  5. Generate answers constrained to retrieved clauses, requiring citations to clause numbers and document names.
  6. Return structured output with answer, cited provisions and a note when documents conflict or are silent.
  7. Run a closed-matter evaluation and review flagged conflicts with the practice group before rollout.
1Assemble the corpusfor one practicearea — executed2Chunk by clause andsection, numberingeach chunk and3Embed chunks withplugsky-embed, orplugsky-embed-multilingual4Build retrievalthat resolves thelawyer's matters5Generate answersconstrained toretrieved clauses,6Return structuredoutput with answer,cited provisions

Original data

plugsky-embed EmbeddingsCited answers Generation30+ models, inModelsSource: Plugsky facts table · updated 2026-09-26

Try it yourself

Open the chat with PDF tool →

Legal work depends on the exact words of a provision, so retrieval must return identifiable text rather than vague similarity. RAG fits because the unit of value is the clause: retrieval finds it, generation explains it, and the citation lets a lawyer verify it in seconds. Coverage and citations beat fluency every time.

The model layer is live on Plugsky: /v1/embeddings for indexing and /v1/chat/completions for answers with JSON mode. Documents, matter walls and retention stay in your document management and security systems, which is where privilege requires them.

Chunking contracts and case files

Contracts have structure that generic splitters destroy: definitions, numbered clauses, schedules and signature blocks. Chunk along those boundaries and keep identifiers in metadata so citations are stable across drafts.

  • Clauses and schedules: one chunk per clause or schedule item, carrying the clause number.
  • Definitions: attach defined terms to the clauses that use them, or index a definitions block the answer can cite.
  • Versions: store version and execution date, and apply the current version by default.
  • Cross-references: preserve internal references as text so the answer can follow them.

Privilege, retention and evaluation

Confidentiality shapes the pipeline. Matter filters must be enforced in your retrieval service before ranking, keys should be scoped per team, and prompts should carry only the passages the task needs. Where policy requires, deployment moves to a region-locked plane or fully on-prem, and retention for logs and embeddings follows matter policy rather than platform defaults.

Evaluate on closed matters with known outcomes: does retrieval surface the governing clause, does the citation point to the right provision, and does the assistant refuse when the corpus lacks an answer. Conflicts between documents should be surfaced, not resolved silently. Track reviewer edit rates to see where retrieval or chunking needs refinement, and re-index on every contract version.

Honest comparison

CapabilityPlugsky RAGKeyword contract searchModel with no retrieval
Answer basisRetrieved clauses with citationsRanked documentsModel memory
Citation precisionClause and document levelDocument levelNone
ConfidentialityMatter filters before retrievalIndex ACLsVendor-controlled
Version handlingExecution date and draft version metadataManualTraining cutoff
ResidencyRegion-locked planes, VPC, on-prem, air-gappedYour systemsVendor-controlled

Frequently asked questions

Can the assistant tell us whether a clause is enforceable?

It can retrieve and summarise the clause and related provisions, but enforceability is a legal judgement for a qualified lawyer. Keep answers descriptive and cite the source text.

How do you cite precisely?

Chunk by clause with the clause number and document name in metadata, and require citations in that form. Clause-level citations stay valid while a matter is still being redrafted.

Which embedding model fits cross-border work?

plugsky-embed works for English-language matters; plugsky-embed-multilingual handles mixed-language files where questions and documents differ in language.

How do matter walls work?

Your retrieval service resolves the lawyer's matters and filters before ranking. Never let model output or supplied parameters change which matter is queried.

Can documents stay on-prem?

Yes. Plugsky supports region-locked cloud planes plus VPC, on-prem and air-gapped deployment, so privileged files can remain inside the firm's environment.

What about superseded drafts?

Store version and execution date on every chunk and prefer the current version by default. Historical versions remain retrievable for comparison when requested.

How do we measure quality?

Use closed matters with known answers and score clause retrieval, citation accuracy and refusal behaviour, plus how often reviewers edit the draft materially.