Legal Tools
Sign in

Architecture · Hard-RAG · Fine-tuned LLM

How Advocate builds your brief.

A 7-step pipeline that turns your case description into a legally grounded partisan brief — adversarial sub-questions, hybrid retrieval from 220,000+ passages, and a fine-tuned Norwegian law model for synthesis.

220K+ legal passages indexed
8 corpus slices
7 pipeline steps
dbn fine-tuned model

Pipeline architecture

Seven steps from case facts to partisan brief.

Each step is visible in the Reasoning panel as the run progresses. No black-box generation — every retrieval pass, dedup, and synthesis is logged.

1

Query interpretation

The seed text is parsed for case type, parties involved, applicable acts, and time context. If the input is clear enough, this step is skipped and the raw seed is passed directly to expansion.

2

Query expansion

The agent generates 3–5 adversarial sub-questions, each framed to strengthen the selected party's position. Sub-questions target different legal angles: procedural obligations, proportionality, ECHR anchors, evidentiary standards.

3

Slice resolution

Active corpus slices are resolved into a Qdrant filter. Candidate documents from the selected slices constrain the vector search space — preventing retrieval from unrelated areas of law.

4

Upload indexing

Uploaded files are chunked into 512-token passages and embedded with nomic-embed-text. The resulting vectors are stored in an in-memory index — searched in the same retrieval pass as the legal corpus, then discarded at session end.

5

Retrieval

For each sub-question: hybrid BM25 + vector search → RRF fusion → reranker. Corpus hits and upload hits are merged, deduped, and trimmed to the configured "Sources kept" limit. Output: N unique ranked passages.

6

Synthesis

The selected engine (dbn-legal-agent or Azure gpt-4o) synthesises the full output: YOUR STRONGEST ARGUMENTS, the advocate brief, GAPS IN THE OPPOSING POSITION, uncertainties, and the next practical step. All framed for the selected party role.

7

Citation confidence

Each inline citation is verified against its source passage. A confidence score is computed and surfaced in the output header. Low-confidence citations are flagged. No hallucinated § numbers reach the final brief.

7-step reasoning panel showing query expansion, retrieval, and synthesis completing in sequence

Hard-RAG retrieval

Every claim traced to a source.

Hard-RAG means no citation appears in the brief unless it was retrieved from the corpus or your uploaded files. The retrieval pipeline is deterministic and logged.

Active slices → Qdrant payload filter
Sub-questions → BM25 keyword search
Sub-questions → vector similarity search
RRF fusion (rank-based merge)
Cross-encoder reranker
Upload chunks merged
Dedup → top N sources
Synthesis with citations
Sub-question research trail showing retrieved ECHR cases and uploaded document sources

Knowledge base

220,000+ passages across 8 corpus slices.

The same corpus that powers Korrespond. Indexed from Lovdata, ECHR HUDOC, Norwegian appellate decisions, and Bufdir guidance.

220K+passages indexed
8corpus slices
1,731tribunal decisions
23+ECHR judgments vs Norway
nomic-embedembedding model
HybridBM25 + vector search
family_core child_welfare echr hague_convention norwegian_courts bufdir_guidance broader_legal dbn_resources
Party role Recommended slices
Biological parentsfamily_core · child_welfare · echr · norwegian_courts
Foster carer / adoptive parentchild_welfare · echr · bufdir_guidance
Child (via representative)family_core · child_welfare · echr · dbn_resources
Extended familyfamily_core · echr · norwegian_courts
Barnevernetchild_welfare · bufdir_guidance · broader_legal
Cross-border / internationalhague_convention · echr · family_core

Fine-tuned model

dbn-legal-agent — trained for Norwegian child-welfare law.

Fine-tuned model

dbn-legal-agent

A QLoRA fine-tune trained on Norwegian child-welfare and administrative law text. dbn-legal-agent understands the procedural vocabulary of barnevernsloven and barneloven — the proportionality threshold for omsorgsovertakelse, how Barnevernet's § 4-1 / 4-4 duty of assessment can be challenged, what ECHR Art. 8 requires in care-order cases, and how the principle of barnets beste is weighed against parental rights in Norwegian courts.

QLoRA barnevernsloven barneloven ECHR Art. 8 child-welfare corpus gpt-4o co-pipeline
Pipeline step dbn-legal-agent role
Query interpretationClassifies case type, identifies applicable statute sets
Query expansionGenerates adversarial sub-questions framed for the selected party
Slice resolutionMaps case facts to relevant corpus slices
Synthesis — argument structureShapes YOUR STRONGEST ARGUMENTS using child-welfare procedural vocabulary
Synthesis — brief textDrafts partisan advocate brief in grounded legal register
Synthesis — gaps + uncertaintiesIdentifies weaknesses in opposing position from same retrieval pass
Citation confidenceVerifies each § number against source passage; flags low-confidence citations

Privacy by design

Your case data never leaves the request.

See it in action.

Free for Do Better Norge members. No credit card required.

Sign in to use Advocate → Register free