Ask a question about banking regulation, then watch how the answer gets made.
Your question goes through the same pipeline as the self-hosted system I built for the SPG Innovation Challenge 2026: a German rewrite, hybrid keyword and vector search over 12,186 real chunks of GwG, KWG, MaRisk, DORA, DSGVO and EBA/ESMA texts, rank fusion, and an LLM that has to cite its sources.
What's real: the corpus, the BGE-M3 vectors, and the retrieval, fusion, citation checks and confidence score. All of it runs in your browser. What's simulated: the LLM. GitHub Pages can't host a 24B model, so the page builds the exact prompt and then shows how the model would answer it.
Try oneMore example questions
- RewriteEN → DE
- BM25keywords
- DenseBGE-M3
- FuseRRF · top 8
- Prompt8 sources
- LLMsimulated
- Verifycitations
- Auditlogged
Ask something and this tab shows every ranked list: BM25 on your words, BM25 on the German rewrite, the vector search, and the fused top 8 that go to the LLM.
The exact prompt the backend sends to the model, with the system rules from generate/prompts.py and the eight numbered sources.
Citation validation and the confidence score, using the same formula as generate/answer.py.
Every request is written to an append-only audit trail. In production that's PostgreSQL; here it's this list, and it disappears when you close the tab.
Click any dot in the 3D view, or any source under an answer, to read the full chunk.
The pipeline
- Ingest. 50 PDFs (3,387 pages) are parsed with Docling and cut into 12,186 chunks that never cross a § / Artikel / AT boundary, so every citation can say
01_GwG.pdf | § 10 | p. 17-18. - Embed + index. BGE-M3 (1024-d) dense vectors plus BM25 sparse vectors go into Qdrant.
- Retrieve. Most questions are in English and most of the law is in German, so each question also gets a German query (an LLM rewrite plus an EN→DE compliance glossary). Four ranked lists, fused with weighted Reciprocal Rank Fusion, capped at 4 chunks per document.
- Generate. Mistral Small 3.1 24B (Ollama) or Llama 3.3 70B (vLLM), inside the bank's tenant. It must cite
[n]after every statement. - Verify. Citations to sources that don't exist are removed. Fewer than 2 citations triggers a retry.
NOT_IN_SOURCESproduces an honest refusal. - Audit. Every question, source and answer is logged under its request id.
What this page does differently
- Same data. The texts and BGE-M3 vectors come from the repo's prebuilt
rag_db. The vectors are PCA-compressed 1024 → 96 dimensions (int8), which keeps about 75% of each chunk's true top-20 neighbours. - Same keyword search. The tokenizer is ported line by line, so
§ 25h,Art. 5bandAT 4.4.2stay single tokens. Scoring is BM25 with Qdrant's IDF. - Approximate question vector. Your browser can't run BGE-M3 (2.2 GB), so the question's vector is the average of its top keyword hits (pseudo-relevance feedback). The cosine search over all 12,186 real vectors is real.
- Simulated LLM. The answer is built from the best-matching sentences of the retrieved sources, like the deterministic stand-in the repo's test suite uses. The citations point to the chunks that were actually retrieved, and the confidence score is computed from them. The example questions add hand-written German search terms in place of the LLM's German rewrite.
- On the 30 in-scope evaluation questions, this browser retrieval puts an expected source document in the top 8 for 26 of 30.
Sources
All 50 documents are public, official texts, reproduced here unmodified as extracted text with their source named:
- German federal laws and ordinances (GwG, KWG, WpHG, BGB, AWG, AWV, HinSchG, BDSG, ZKG, ZAG): gesetze-im-internet.de, Federal Ministry of Justice.
- EU regulations and directives: EUR-Lex, © European Union. Only the Official Journal editions are authentic.
- Guidelines and guidance: EBA, ESMA and the EBA/ESMA Joint Committee, the European Commission (sanctions FAQ), BaFin (MaRisk, MaComp, circulars, AuA) and the Deutsche Bundesbank (sanctions FAQ), each from its official website.
- Texts are machine-extracted from PDFs and may contain extraction errors. Versions are those collected in September 2026. Nothing here is legal advice.