Architecture · Hard-RAG · Fine-tuned LLM
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.
Pipeline architecture
Each step is visible in the Reasoning panel as the run progresses. No black-box generation — every retrieval pass, dedup, and synthesis is logged.
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.
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.
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.
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.
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.
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.
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.
Hard-RAG retrieval
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.
Knowledge base
The same corpus that powers Korrespond. Indexed from Lovdata, ECHR HUDOC, Norwegian appellate decisions, and Bufdir guidance.
| Party role | Recommended slices |
|---|---|
| Biological parents | family_core · child_welfare · echr · norwegian_courts |
| Foster carer / adoptive parent | child_welfare · echr · bufdir_guidance |
| Child (via representative) | family_core · child_welfare · echr · dbn_resources |
| Extended family | family_core · echr · norwegian_courts |
| Barnevernet | child_welfare · bufdir_guidance · broader_legal |
| Cross-border / international | hague_convention · echr · family_core |
Fine-tuned model
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.
| Pipeline step | dbn-legal-agent role |
|---|---|
| Query interpretation | Classifies case type, identifies applicable statute sets |
| Query expansion | Generates adversarial sub-questions framed for the selected party |
| Slice resolution | Maps case facts to relevant corpus slices |
| Synthesis — argument structure | Shapes YOUR STRONGEST ARGUMENTS using child-welfare procedural vocabulary |
| Synthesis — brief text | Drafts partisan advocate brief in grounded legal register |
| Synthesis — gaps + uncertainties | Identifies weaknesses in opposing position from same retrieval pass |
| Citation confidence | Verifies each § number against source passage; flags low-confidence citations |
Privacy by design
Free for Do Better Norge members. No credit card required.