gwoe-antragspruefer/app
Dotty Dotter 1b5fd96e16 Embeddings prompt: include programme name in chunk citations
format_quotes_for_prompt previously rendered each retrieved chunk
as just "S. X: text", giving the LLM no way to know which
Bundesland or Wahlprogramm the passage came from. Result: even
when the embedding search correctly returned MV-only chunks, the
LLM hallucinated familiar source labels from its training set
(typically "FDP NRW Wahlprogramm 2022, S. 75") because that was
its strongest prior for budget/transparency policy citations.

Fix: prepend the fully-qualified PROGRAMME[programm_id]["name"]
to each quote and explicitly instruct the model to use these
labels verbatim. Discovered while smoke-testing MV after
indexing the new MV+BE programmes — embedding retrieval was
clean (sim ~0.6 chunks all from fdp-mv-2021), only the prompt
serialisation was lossy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 11:24:31 +02:00
..
kontext Activate LSA: Wahlprogramme + ingest + frontend (#2) 2026-04-07 22:12:32 +02:00
routers Initial commit: GWÖ-Antragsprüfer v1.0 2026-03-28 22:30:24 +01:00
static/referenzen Add MV+BE Wahlprogramme zur jeweils laufenden Legislatur (#4, #10) 2026-04-08 08:24:33 +02:00
templates Bundesland filter & transparency: stringent split + visible source (#8) 2026-04-07 23:00:39 +02:00
__init__.py Initial commit: GWÖ-Antragsprüfer v1.0 2026-03-28 22:30:24 +01:00
analyzer.py Refactor wahlprogramme/embeddings/analyzer for multi-state (#5) 2026-04-07 18:48:11 +02:00
bundeslaender.py Activate Mecklenburg-Vorpommern (ParlDok) — search-only MVP (#4) 2026-04-08 08:19:48 +02:00
config.py Initial commit: GWÖ-Antragsprüfer v1.0 2026-03-28 22:30:24 +01:00
database.py Bundesland filter & transparency: stringent split + visible source (#8) 2026-04-07 23:00:39 +02:00
embeddings.py Embeddings prompt: include programme name in chunk citations 2026-04-08 11:24:31 +02:00
main.py Bundesland filter & transparency: stringent split + visible source (#8) 2026-04-07 23:00:39 +02:00
models.py Initial commit: GWÖ-Antragsprüfer v1.0 2026-03-28 22:30:24 +01:00
parlamente.py Activate Mecklenburg-Vorpommern (ParlDok) — search-only MVP (#4) 2026-04-08 08:19:48 +02:00
report.py Append original Antrag-PDF to GWÖ-Report (#9) 2026-04-07 23:15:05 +02:00
wahlprogramme.py Add MV+BE Wahlprogramme zur jeweils laufenden Legislatur (#4, #10) 2026-04-08 08:24:33 +02:00