Legal Research & Compliance Assistant
In a regulated domain, an unsourced answer is worse than no answer, so this system is built around provenance rather than around a model. Sources are registered against a jurisdiction and an issuing authority before anything is fetched; a policy gate decides whether a given source may be ingested; and raw material is stored content-addressed by hash, so the exact bytes behind any citation can be produced later. It is explicitly positioned as decision support, not as a substitute for a licensed attorney — the output is a cited answer and a review packet, not advice.
Python package with subsystems for source registry, acquisition, normalisation, retrieval, guardrails, model gateway and attorney review
Documented as an architecture record. The provenance chain is the product; a hosted question box would hide exactly the part worth showing.
The chain from official source to cited answer
Every arrow preserves provenance. Follow either the ingestion path or the answering path and note that nothing skips the registry.
Jurisdictions, issuing authorities and their published sources, with uniqueness enforced.
Why nothing enters the corpus by accident.
Highlights
Provenance first, answers second
The pipeline runs registry → policy gate → acquisition → normalisation → retrieval → guarded answer. Nothing can be cited that was not first registered, permitted and snapshotted, which makes the trust chain auditable end to end.
Source registry
Records jurisdictions, the authorities that issue law within them, and the sources those authorities publish.
- Jurisdictions span country, subdivision, municipality, regulator and supranational scopes.
- Authorities are scoped to jurisdictions; sources are scoped to authorities.
- Uniqueness constraints prevent the same source being registered twice under different names.
Acquisition and policy gate
Decides what may be fetched, then fetches and stores it immutably.
- The gate is consulted before any request is made.
- Approved HTTP sources are acquired automatically; others are imported manually.
- Raw artifacts are stored content-addressed with hash metadata.
Normalisation and retrieval
Turns heterogeneous raw material into a traceable, searchable corpus.
- Normalisation preserves the link back to the originating artifact.
- Snapshots capture the state of a source at a point in time.
- Domain packs scope retrieval to a practice area.
Answering and review
Produces cited answers, issue checklists and attorney review packets.
- Guardrails constrain claims to what the corpus supports.
- The model gateway isolates provider specifics from the rest of the system.
- Output is framed as decision support requiring professional review.
Every subsystem in the provenance chain
Eleven subsystems, ordered by where they sit in the chain from official source to cited answer. Nothing can be cited that did not pass through the earlier stages. 11 units across 4 groups.
Registry
1Acquisition
3Answering
4Output & scope
3Stack by layer
Delivered work
Registry and acquisition
- Jurisdiction, authority and source records with uniqueness constraints.
- Ingestion policy gate consulted before any acquisition.
- HTTP acquisition for approved sources plus a manual import path.
- Content-addressed raw artifact storage with SHA-256 metadata.
- Administrative CLI for registering and listing sources.
Corpus and answering
- Normalisation preserving links back to originating artifacts.
- Snapshotting so a source's state at a point in time is recoverable.
- Retrieval scoped by domain packs.
- Guardrails, model gateway and attorney review packet generation.
Modules and demo strategy
Policy gate
Decides what is allowed into the corpus.
- Runs before acquisition, not after.
- Makes the corpus defensible rather than merely large.
Content-addressed storage
Makes citations resolvable to exact bytes.
- Hash addressing detects tampering and deduplicates naturally.
- The foundation of the whole provenance claim.
Jurisdiction model
Represents how legal authority actually nests.
- Country, subdivision, municipality, regulator and supranational scopes.
- Sources inherit meaning from the authority that issued them.