All statute excerpts on this page are simplified or fictionalised for illustration. Nothing here is legal advice, and a system like the one described shouldn't claim to give any either (more on that below).

1. A crash course in EPR

Extended Producer Responsibility (EPR) is a policy idea with a one-sentence core: if you put a product on the market, your responsibility for it doesn't end at the till. It extends to the end of the product's life, which usually means paying for, and sometimes organising, its collection and recycling. The term was coined by Thomas Lindhqvist at Lund University in 1990, and Germany's 1991 Packaging Ordinance (the origin of the "Green Dot" symbol) turned it into working law. The OECD has been publishing guidance on it since 2001.

Producer brand, importer... Consumer buys, uses, bins Collection & sorting Recycler or disposal PRO / scheme administrator collects fees, funds the system eco-modulated fees funding material flow money flow
The common shape of an EPR scheme: producers pay fees, usually via a Producer Responsibility Organisation (PRO), which fund the collection and recycling of what they sell.

What makes EPR an interesting domain is that this one simple idea has been implemented in wildly different ways in different parts of the world, and the differences are exactly the kind of thing a business needs precise answers about:

JurisdictionExample instrument (packaging)What makes it awkward for a knowledge system
EU Packaging & Packaging Waste Regulation 2025/40 (PPWR) In force Feb 2025, applies Aug 2026, fee provisions later still; 24 official languages; interacts with 27 national schemes
UK pEPR (Producer Responsibility Obligations Regulations 2024) Recently restructured; data reporting and fee rules live in separate instruments and guidance
US State laws: ME, OR, CA (SB 54), CO, MN, MD, WA Seven different statutes plus rulemaking dockets; more states pending; no federal baseline
Canada Provincial regulations (BC, Québec, Ontario...) Province-level variation; bilingual sources; long-running schemes with layered amendments
India Plastic Waste Management Rules 2016, amended 2022 Amendments published as deltas; much of the detail lives in regulator (CPCB) guidance and portals
Japan / South Korea Containers & Packaging Recycling Law; Resource Circulation Act Authoritative text not in English; long histories of revision

Imagine you're building an assistant for compliance teams: "Do I owe fees on the boxes I ship to Colorado?", "Compare recycled-content rules in the EU and California." The answers exist, scattered across thousands of pages of statute, regulation and guidance in a dozen languages. That's the problem RAG is built for.

2. Why RAG, and not something else

A large language model on its own is the wrong tool for this. Its knowledge is frozen at its training cutoff, it has read EPR law only incidentally, and when it's unsure it produces plausible text rather than silence. In a compliance setting, a confidently wrong tonnage threshold is worse than no answer. And even a correct answer is of limited use if you can't show where it came from.

Retrieval-Augmented Generation (RAG, named in a 2020 paper by Lewis et al.) splits the job in two. A retrieval system finds the handful of passages relevant to the question from a corpus you control, and the language model's job shrinks to reading those passages and composing an answer grounded in them, with citations. The model supplies language understanding; the corpus supplies the facts.

Compared with the alternatives:

ApproachWhy it falls short here
Just ask the model Stale, patchy coverage of a niche domain, no citations, fluent hallucination of article numbers and thresholds
Fine-tuning Bakes knowledge into weights: expensive to refresh every time a law is amended, and still can't point at its source
Stuff everything into the context window The corpus is thousands of documents; even million-token contexts can't hold it, and per-query cost and latency would be absurd
RAG Update the index when the law changes, answer from retrieved text, cite the exact provision. The fit is good; the engineering is the hard part

3. The shape of the pipeline

Every RAG system is really two pipelines. An offline indexing pipeline turns raw documents into a searchable index, and an online answering pipeline turns a user's question into a grounded, cited answer. They meet in the middle at the index.

Offline: indexing (runs when documents change) Sources EUR-Lex, gazettes Parse PDF, HTML, OCR Chunk + metadata Embed text → vectors Index vectors + keywords + metadata Online: answering (runs per question) Question "fees in Colorado?" Understand jurisdiction, dates Retrieve filter + search Rerank best 5–10 chunks Generate answer + citations searched at query time
The two halves of a RAG system. The index is rebuilt when documents change; the answering path runs in under a few seconds per question.

Each stage looks innocuous. Each one has a way of quietly ruining the whole system when the domain is law. The rest of this page walks the stages in order.

4. Building the corpus

The corpus is the system's entire universe: if a provision isn't in it, no amount of clever retrieval will find it. For EPR you'd be pulling from official sources such as EUR-Lex, national legislation gazettes, US state legislature sites, and regulator guidance (CalRecycle in California, the CPCB portal in India, PackUK in the UK). Three problems show up immediately.

Format chaos

EUR-Lex serves clean structured HTML. A US state statute might be a web page with its hierarchy encoded only in indentation. An Indian gazette notification might be a scanned PDF needing OCR. The parser has to normalise all of this into one representation that preserves the document's structure, because (as the next section shows) structure is what good chunking hangs on.

Amendments and consolidation

Legislation is rarely republished whole. Amendments are published as deltas: "in paragraph 2, substitute '30%' for '25%'". If you naively index both the original and the amendment, the index now contains two contradictory thresholds and no signal about which one is law. You either need consolidated versions (EUR-Lex publishes these; many jurisdictions don't) or you need to apply the amendments yourself, which is genuinely hard and a place where errors are costly.

Versions and authority

Old versions still matter ("what were my obligations in 2021?"), so each document should be stored with a validity window rather than overwritten. And not everything in the corpus carries equal weight: a statute, an implementing regulation and a PRO's FAQ page are three different levels of authority. Tag each document with its type, so the answering stage can prefer, and clearly attribute, the binding text.

5. Parsing and chunking

Embedding models and rerankers work on passages of bounded size, so documents must be split into chunks: the units that get embedded, retrieved and shown to the model. The default approach, cutting every n characters with some overlap, is exactly wrong for statutes. Legal text is a hierarchy (regulation → chapter → article → paragraph → point) in which a paragraph's meaning routinely depends on its neighbours: paragraph 1 states the rule, paragraph 2 the exemption. Separate them and a retrieved chunk can be true-but-misleading.

Try it on a (fictionalised) EPR provision:

Fixed-size chunking slices mid-sentence and divorces the exemption from the rule it modifies. Structure-aware chunking follows the paragraphs and carries a breadcrumb of where each chunk sits.

The structure-aware version does two things. It splits along the document's own joints (articles and paragraphs, merging tiny ones, splitting giant ones), and it prepends a breadcrumb so the chunk is self-describing: the embedding of "Regulation 20XX/NN › Article 12(2) › exemption for small producers" carries far more signal than the bare sentence. A common refinement is small-to-big retrieval: search over small chunks for precision, but hand the model the whole parent article for context.

Regulation (EU) 20XX/NN Chapter III Article 12: EPR para 1 para 2 para 3 one chunk per leaf EU › Reg 20XX/NN › Art 12(1) › packaging Producers shall be financially responsible for collection and treatment costs... EU › Reg 20XX/NN › Art 12(2) › packaging Derogation: producers under 10 tonnes/yr are exempt from the Art 12(1) fees... EU › Reg 20XX/NN › Art 12(3) › packaging Fees shall be modulated according to recyclability, as set out in Annex II...
Parse the hierarchy, chunk at its leaves, and prepend each chunk's position as a breadcrumb. Each chunk now makes sense on its own.
Cross-references are the unsolved bit. Legal text leans on phrases like "the fees referred to in paragraph 1" and "as set out in Annex II". A chunk containing only the reference is a dead end. Partial fixes: resolve references at indexing time and append a short summary of the target, or let the answering stage follow references with a second retrieval hop. Research systems for legal RAG (see sources) treat reference handling as a first-class design problem.

6. Metadata is half the battle

In a single-document RAG system, metadata is a nicety. In a multi-jurisdiction legal corpus, it is the retrieval system. Similarity search alone cannot tell Oregon from Maine: provisions from different jurisdictions say nearly identical things ("producers shall register with the scheme administrator...") and land next to each other in embedding space. The question "what's the registration deadline in Oregon?" will happily retrieve Maine's deadline unless something filters by jurisdiction before similarity is consulted.

Every chunk should carry at least:

FieldExampleWhy it matters
jurisdiction US-CO, EU, IN Hard filter; the single most important field
instrument_type statute / regulation / guidance Authority level; prefer binding text, attribute guidance as guidance
product_stream packaging / WEEE / batteries / textiles Stops battery rules answering packaging questions
dates adopted / in force / applies from These are three different dates, and conflating them produces wrong answers
version_validity 2022-07-01 → 2024-03-31 Lets "what applied in 2023?" retrieve the right historical text
citation Reg 2025/40, Art 45(2) What the final answer cites; must survive the pipeline intact

The dates row deserves a highlight, because EPR law is full of staged timelines. The EU's PPWR was published in January 2025, entered into force on 11 February 2025, applies from 12 August 2026, and its EPR fee provisions bite later still, with labelling and recyclability rules staged out to 2028 and 2030. A system that knows only "the document is from 2025" will confidently tell a user that obligations apply today which don't apply until 2030. Temporal metadata isn't an optimisation here; it's correctness.

7. Embeddings and hybrid search

With chunks and metadata in hand, indexing is next. An embedding model maps each chunk to a vector such that texts with similar meaning land close together. At query time the question is embedded the same way and the nearest chunks are fetched. This is what lets "who pays for recycling cardboard boxes?" find a provision that never uses the words "pay", "cardboard" or "box", but talks about "financial responsibility for fibre-based packaging waste".

But semantic search has a blind spot that legal text pokes constantly: exact identifiers. "SB 54", "Article 45", "Regulation 2025/40" are near-meaningless strings to an embedding model, yet to the user they are the whole question. Empirical work on legal retrieval finds that statute numbers and citation formats benefit dramatically from old-fashioned keyword recall. So production systems run hybrid search: a dense (vector) query and a sparse (BM25 keyword) query in parallel, with the two ranked lists fused, typically by reciprocal rank fusion, and a cross-encoder reranker reordering the merged candidates before the best few go to the model.

"What does SB 54 require of PROs?" Dense / vector meaning: "PRO duties" Sparse / BM25 exact match: "SB 54" Fusion merge both lists Reranker best 5–10
Hybrid retrieval: vectors catch paraphrase, keywords catch identifiers like "SB 54". Neither alone is enough for legal text.
The language question. The authoritative text of Japan's recycling law is in Japanese; Québec's regulations are in French; the PPWR exists in 24 equally official languages. Two workable designs: embed everything with a multilingual model and retrieve across languages, or translate at ingestion and index the translation alongside the original (always citing the original). Either way, decide deliberately; a corpus that silently mixes languages with a monolingual embedding model will just retrieve nothing for whole jurisdictions.

8. Query time: routing and retrieval

Now the online half. Before any search runs, the question itself needs understanding, and this stage is where multi-jurisdiction RAG differs most from the textbook version. Three jobs:

"Compare EU and CA recycled-content rules for plastic packaging" Retrieve: jurisdiction = EU PPWR Art 7 chunks Retrieve: jurisdiction = US-CA SB 54 + AB 793 chunks Synthesise side-by-side answer, cited per jurisdiction
Comparative questions fan out into one filtered retrieval per jurisdiction, then a synthesis step. One mixed retrieval would let the better-represented jurisdiction crowd out the other.

Walk a few questions through the whole pipeline:

Illustrative only: the chunks and answers are canned and simplified, but the shape (scope → filtered retrieval → cited answer) is the real design.

9. Grounded generation

The final model call receives the question plus the reranked chunks, each tagged with its citation, and a set of instructions that do a lot of load-bearing work. A sketch:

You are a research assistant for EPR compliance teams.
Answer ONLY from the numbered extracts below.
- Cite every claim with its extract number, e.g. [2].
- Quote thresholds, percentages and dates exactly as written.
- Distinguish binding law from guidance when both appear.
- State the as-of date of the underlying texts.
- If the extracts do not answer the question, say so.
  Do not fill gaps from general knowledge.
- You provide research support, not legal advice.

Three of those lines matter more than they look. Answer only from the extracts is the line that separates RAG from decoration: without it the model blends retrieved text with its training-data memory of EPR law, and you can no longer tell which is which. Quote exactly matters because paraphrased law drifts ("around 10 tonnes" is not "less than 10 tonnes"). And say so when you can't answer is the abstention behaviour from the previous section, enforced again at the last line of defence.

Citations are checkable, so check them. Because every sentence should trace to a supplied extract, you can verify mechanically that each cited extract exists and actually contains the quoted figures, and flag or regenerate answers that fail. This post-hoc check catches the classic legal-AI failure, the invented citation, which has already embarrassed real lawyers in real courtrooms.

10. Evaluation and freshness

A RAG system has two parts that can fail independently, so it needs two kinds of measurement. Build a golden set of a few hundred real questions with expert-verified answers and the provisions that support them, spread across jurisdictions, product streams and time frames. Then track:

Run the golden set on every index rebuild and prompt change, like a test suite, because a "harmless" chunking tweak can silently halve recall for one jurisdiction. And mine production logs: unanswered questions cluster around corpus gaps, which tells you what to ingest next.

Freshness is the other half of operations. EPR law moves on a monthly cadence: new state rulemakings, amended fee schedules, fresh guidance. The indexing pipeline from section 3 should re-crawl sources on a schedule, diff against what's indexed, and re-process only what changed, updating validity windows rather than deleting history. A stale RAG system fails in the worst possible way: confidently, with citations to law that has since been amended.

11. Failure modes, collected

FailureLooks likeMitigation
Jurisdiction bleed Maine's deadline cited in an answer about Oregon Metadata filters before similarity search; per-jurisdiction fan-out
Split provision Rule retrieved without its exemption; technically true, practically wrong Structure-aware chunking; small-to-big retrieval
Identifier miss "What does SB 54 say?" retrieves nothing useful Hybrid (dense + keyword) search; citation-aware indexing
Temporal confusion 2030 recyclability rules presented as applying today Adopted / in-force / applies-from dates as first-class metadata
Stale corpus Pre-amendment threshold quoted, with a citation, after the amendment Scheduled re-crawl and diff; validity windows; consolidated sources
Hallucinated citation An article number that doesn't exist, formatted perfectly Answer-only-from-context prompting; mechanical citation verification
Confident out-of-scope answer A question about Brazil answered from EU chunks Coverage check and explicit abstention

None of these is exotic. Every one is the default behaviour of a naive pipeline applied to this domain, which is the real lesson of the exercise: the RAG architecture is generic, but almost every design decision inside it (what to chunk on, what metadata to extract, how to route a query, when to refuse) is a domain decision. EPR, with its one simple idea refracted through dozens of legal systems, just makes that unusually visible.

12. Sources and further reading