Skip to content

Legal RAG with citations, in every language your practice works in

DocsGPT gives legal teams and legal-tech products retrieval with page-level citations across millions of pages and multiple languages, with guardrails and lawyer review as the final step. It powers LexEU's EU-law research over 2.5M+ pages in 6 languages and, at Balt Alnoor, IP drafting that went from 6+ hours to under 5 minutes. Legal-tech companies use DocsGPT as the retrieval and agent layer behind their own product.

Last updated:

Research and drafting pipeline
  1. 01Client submission / corpusfilings · PDFs · images
  2. 02Parsing & extractiondocument parser · OCR · vision model
  3. 03LLM research or drafthybrid retrieval · GraphRAG
  4. 04Cited answer or drafttitle + page · DOCX artifact
  5. 05 · humanLawyer reviewapproval before release
Text version

Five stages: a client submission or the corpus comes in as filings, PDFs or images; the document parser produces text, with OCR or a vision model where a scan needs it; the model researches across the corpus or drafts against a template; the output is a cited answer or a near-final draft; a lawyer reviews and approves before anything leaves the system.

The situation

  • Citations

    The central risk in legal AI is a hallucinated citation, so generation must be grounded in retrieved passages and every citation must link to a real page.

  • Languages

    Multilingual legal terminology defeats general-purpose embeddings; retrieval has to be tuned to the domain and to each language the practice works in.

  • Review

    AI output in legal work is a near-final draft, not a decision: a lawyer's review is the final stage of the pipeline, by design.

What DocsGPT does here

Workflow 01

Research with citations

Hybrid retrieval (BM25 + vector) finds the passage; GraphRAG follows multi-hop questions across regulations and case law; every answer cites title, source and page. The Research agent handles multi-step questions with budget controls.

Hybrid retrieval (BM25 + vector) · GraphRAG · citations (title, source, page) · Research agent

Search & Retrieval →Agents →

Workflow 02

Multilingual corpora

Any Sentence Transformers or remote embedding model can be used; retrieval is language-aware; chunking and query rephrasing are set per source, so a German statute and an Italian judgment do not share one setting.

Sentence Transformers / remote embeddings · language-aware retrieval · per-source chunking and rephrasing

Built for the client · fine-tuned legal embeddings and a domain fine-tuned LLM, as in LexEU.

Models & BYOM →Knowledge & Connectors →

Workflow 03

Drafting with lawyer review

A Workflow takes the intake (images, PDFs, filings), extracts text with OCR or a vision model, has an AI Agent node draft a structured description, renders the template as a versioned DOCX or PDF artifact, and stops at a human-approval step before release. This is the IP drafting pattern.

Workflow builder · OCR / vision extraction · AI Agent node · artifact_generator (DOCX, PDF) · human approval

Workflows →Artifacts →Guardrails →

Workflow 04

Hallucination controls

Anti-hallucination prompts constrain generation to retrieved passages; guardrails run on retrieved sources and on the final answer (banned terms, link policy, LLM-judge policies); human-in-the-loop gates responses and tool calls; per-domain benchmarks assert that answers cite the expected sources before a change ships.

Anti-hallucination prompts · source and answer guardrails · LLM-judge policies · human-in-the-loop · docsgpt-cli bench

Guardrails & Human-in-the-loop →Benchmarks & Evals →

Controls against hallucinated citations

Five controls, in the order they act on a question. None is absolute on its own; together they make a wrong citation detectable and reviewable.

  1. 01

    Grounding

    Answers are generated only from retrieved passages; anti-hallucination prompts refuse when the corpus does not contain the answer.

  2. 02

    Page-linked citations

    Every citation carries title, source and page number and opens the source panel on that page.

  3. 03

    Source guardrails

    Guardrails check retrieved sources and the final answer: banned terms, link policy, LLM-judge policies.

    flag · redact · block

  4. 04

    Human-in-the-loop

    Responses and tool calls can require approval; drafting ends at a lawyer's approval step.

  5. 05

    Benchmark assertions on sources

    A per-domain suite asserts that answers cite the expected sources before any change ships.

    docsgpt-cli bench

docsgpt — chat

application-draft.docx

artifact · append-only versions

  1. v1rendered from template · 4 sources10:02
  2. v2reviewer edits applied10:40
  3. v3final · signed off11:15current

Evidence

Results from named deployments, with the source.

2.5M+ pages · 6 languages

Multilingual EU-law research over 2.5M+ pages, answers in 6 EU languages with full source citations, 100–200 ms retrieval.

Source: LexEU

6+ h → under 5 min

IP application drafting: 6+ hours to under 5 minutes per application, with lawyer review as the final step.

Source: Balt Alnoor

How it is deployed

Managed is the usual posture here: a private instance without operating it.

Law firms typically take a dedicated managed instance or the Cloud plan — the IP drafting deployment runs on cloud models. Firms with residency rules run DocsGPT on-premises with a local model. Legal-tech companies run it in their own cloud as the backend of their product.

What a first project looks like

Scope, measure, then decide.

  1. 01

    Select one corpus and one drafting type

    One jurisdiction or practice area for research; one document type for drafting.

  2. 02

    Lawyers write 30–50 benchmark questions

    Each with the expected sources, so citation accuracy is testable from day one.

  3. 03

    Ingest, configure retrieval, run the benchmark

    Iterate on embeddings, chunking and rephrasing until the source assertions pass.

    docsgpt-cli bench

  4. 04

    Build the drafting workflow with a review step

    Intake, extraction, draft, versioned artifact, lawyer approval.

  5. 05

    Pilot with a small group

    Measure citation accuracy and time per draft against the current process.

For legal-tech products the commercial model is a subscription plus an engineering retainer — see For AI product builders. Firms: Cloud at $20/seat/month or a Managed instance from $2,000/month — see pricing.

Frequently asked questions

How do you stop AI from hallucinating legal citations?

Answers are generated only from retrieved passages and every citation links to a title and page number; guardrails check retrieved sources and the final answer; a benchmark suite asserts that answers cite the expected sources before any change ships. A lawyer reviews drafts before they leave the system.

Can AI do legal research in multiple languages?

Yes. DocsGPT works with multilingual embedding models and language-aware retrieval; one EU-law platform built on it answers in 6 EU languages over 2.5M+ pages with 100–200 ms retrieval.

Does the lawyer still review the output?

Yes, and the workflow is built so that they must: drafting ends at an approval step, and nothing is released until a lawyer approves. In the IP drafting case this cut drafting from 6+ hours to under 5 minutes per application.

Can we use DocsGPT inside our own legal product?

Yes. It exposes an OpenAI-compatible API, a streaming API, webhooks and white-label widgets under the MIT licence; see For AI product builders.

See DocsGPT on your documents

A 30-minute demo on your use case, or a free on-premises review with an engineer.