Skip to content

tobiasbrummer/belegt

Repository files navigation

belegt

A hallucination-resistant assistant for German public-administration services. A user describes what they need in plain language; belegt finds the right official service and explains it — and nothing the model says is unsourced.

The name is the German word for sourced / backed by evidence, which is the core property the architecture enforces.

The problem

LLM demos for public administration have two failure modes:

  1. Wrong selection — the model suggests a service that does not exist in that municipality, reconstructed from world knowledge instead of the actual service catalogue.
  2. Wrong explanation — the selection is right, but the surrounding text invents details: deadlines, fees, responsibilities. Hard to spot because it sounds plausible.

belegt removes both structurally, not through better prompting — with two LLM stages that each have so little freedom that hallucination has no leverage:

  • Stage 1 — Fragment Selector: the model may only call tools (against the PVOG federal service catalogue) and produces no user-visible text.
  • Stage 2 — Grounded Generator: the model may write explanatory text, but every factual sentence must cite a [ref:id] to a deterministically built chunk of the API response. Unsourced sentences are dropped.

Full design in ARCHITECTURE.md — written to be read in about ten minutes.

Stack

  • Vite 7 + React 19 (SWC)
  • KoliBri@public-ui/components 4.1.2, the German public-sector design system (EUPL-1.2), via the typed React 19 wrappers
  • SSE streaming; the API runs as Vite middleware (no separate server)
  • Data source: PVOG (Portalverbund Online-Gateway)

Run

npm install
npm run dev

Dev server on http://localhost:4324. The API endpoints (/api/ask, /api/explain, /api/locations) run as Vite middleware, so the LLM API keys stay server-side and never reach the browser.

Keys are read from an external .env (MISTRAL_API_KEY, OPENROUTER_API_KEY) — see CLAUDE.md for the configuration and tooling notes.

Status

A working prototype. It grew out of a series of design-system experiments (Svelte/Carbon, Lit/kern-ux, this React/KoliBri variant); the two-stage grounded architecture is the part that matters and is the focus of ARCHITECTURE.md. The Vite middleware is a development setup — a production deployment would move the handlers into a real Node service.

About

Hallucination-resistant assistant for German public-administration services — two-stage grounded architecture over the PVOG catalogue (React 19 + KoliBri)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors