Technology · RAG
Answers from the case file, with proof.
Retrieval-Augmented Generation searches the case file semantically instead of by keyword — every answer with a citation, not a bare claim.
The business benefit
Proof instead of guesswork.
A generic chatbot answers questions from its general training knowledge — it doesn't know your case file and can freely make things up. For legal practice, that's a liability risk. RAG bases every answer exclusively on text passages actually present in the case file, with citation and page reference.
- Verifiable: Every statement can be traced back to the original source in the case file.
- Faster: Minutes instead of hours to review thousands of pages.
- Current: The context comes from the actual case file, not from outdated training knowledge.
- Differentiating: Answers from your own case record instead of generic chatbot answers.
Analogy
RAG is like a lawyer with a perfect memory for exactly this one case file: it invents nothing, but looks up the right documents for every question and cites the source.
Generic chatbot vs. RAG
| Chatbot | With RAG | |
|---|---|---|
| Where does the answer come from? | From general training knowledge | From the specific case file, retrieved on demand |
| Proof for the statement? | None | Citation with page and document reference |
| Knows your own case file? | No | Yes, semantically indexed |
| Risk if the answer is wrong | Unnoticed hallucination | Verifiable against the source |
Technical deep dive
Not guessing — looking it up deliberately.
A language model normally answers only from what it learned during training. Retrieval-Augmented Generation adds a step before that: before the model answers, the most relevant text passages from the respective case file are retrieved (Retrieval) and given to the request as context (Augmentation).
What is an embedding?
An embedding is a numeric representation of a text passage as a vector — a long series of numbers that encodes its meaning. Passages with similar meaning get computationally "close" vectors, regardless of which specific words were used. That's exactly what semantic search builds on.
Phase 1 · Indexing per case file
Every case file gets its own semantic fingerprint.
On intake and continuously during processing, DEPLAW breaks every document in a case file into searchable sections (chunking) and encodes their meaning as an embedding. The origin, page number and document type of each section are preserved, so later answers stay exactly citable.
From case file to index
How DEPLAW chunks
For chunking itself, DEPLAW relies on a combination of two techniques that proved to be the best solution in our own tests:
Late Chunking
Instead of first cutting a document into pieces and embedding each piece in isolation, the entire document is processed as context first — only then are the individual chunk vectors created. Each section keeps its connection to the rest of the document, instead of losing it when it's cut apart.
Semantic Chunking
The boundaries between sections don't follow a rigid character or word count, but content-based topic shifts. A section stays a self-contained unit of thought, instead of being cut off in the middle of an argument.
Both effects reinforce each other: Late Chunking ensures that every section incorporates the document's overall context, semantic chunking ensures that the section boundaries themselves fall in content-sensible places. The result: vector search finds more precise, more citable passages — exactly what matters for evidenced answers in legal practice.
Phase 2 · Query at runtime
A question finds its supporting passages.
When a question comes in, it is itself turned into an embedding and compared against the case index. Only the sections with the greatest semantic closeness — usually a handful out of thousands — go to the language model as context. This same index delivers exactly the right semantic context to every connected model, regardless of which model ultimately answers.
Flow of a query
Retrieval · ordered by semantic closeness
Why semantic, not keyword-based
Same meaning, different words.
A pure keyword search only finds literal matches. Semantic search also recognizes contextually matching passages with completely different wording:
Question
"Who is liable for the damage?"
Passage in the case file
"Responsibility for the defect that occurred lies with the contracting party."
No shared keyword — "liable" ≠ "responsibility", "damage" ≠ "defect". A keyword search wouldn't find this passage. RAG recognizes the contextual closeness and delivers it as context anyway.
What this looks like in the case file
Every answer with a source reference.
A question to the case file, an answer backed by evidence: every statement carries a reference to document and page — verifiable down to the original passage in the report.
Behind the answer
Composed from multiple source passages.
The answer doesn't come from a single passage: RAG brings together the relevant text passages from multiple documents in the case file and keeps, for each one, the reference to document and page number.
Frequently asked questions
RAG, explained briefly.
A generic chatbot doesn't know your case file and answers from general training knowledge — without proof. RAG searches specifically within the actual case file for the relevant sections and delivers every answer with a citation and source reference.
No. With thousands of pages that would be impractical. The semantic search first selects only the most relevant sections and gives exactly those to the model as context.
Yes. The case index is independent of the responding model — it delivers the same semantically matching context to every connected LLM, whether external, self-hosted or local.
Precisely recognized text from every document. That's why RAG indexing builds directly on DEPLAW's AI-optimized OCR.
Technology
Artificial Intelligence at DEPLAW
Which language models DEPLAW integrates and how pseudonymization keeps data protection intact.
Technology
OCR: every document automatically readable
The foundation of every RAG index: reliably recognized text from every incoming document.
Ask your own case file a question.
We'll show live how DEPLAW indexes one of your real case files and answers questions from it with source references.
Book a demo