Files
MtoRagSystem/patch_history/RETRIEX_PROMPT_PRECISION_PRIORITY_FIX_README.md
2026-05-04 19:15:22 +02:00

1.7 KiB

RetrieX Prompt Precision Priority Fix

This patch intentionally avoids retrieval changes.

It does not add hard-coded keyword lists to the retriever and does not introduce a new core retrieval special case.

Goal

For technical questions where the retrieved chunk already contains the exact answer plus nearby comparison values, the model should answer the requested fact first and avoid adding runner-up products or adjacent values unless the user explicitly asks for comparison or alternatives.

Example:

  • Question: Was ist der niedrigste Grenzwert fuer die Wasserhaerte, welcher mit einem Testomaten ueberwacht werden kann?
  • Retrieved chunk may contain both Testomat 808: 0,02 °dH and Testomat 2000: 0,05 °dH.
  • Expected answer should focus on 0,02 °dH / Testomat 808 and should not add the runner-up value unless requested.

Changed files

  • config/retriex/prompt.yaml
  • src/Agent/PromptBuilder.php
  • src/Config/PromptBuilderConfig.php
  • src/Config/RetriexEffectiveConfigProvider.php

What changed

  • Added configurable output_priority.technical_rules in prompt.yaml.
  • PromptBuilder now emits the OUTPUT PRIORITY block for technical questions even when no shop results are present.
  • The technical priority rules are loaded through PromptBuilderConfig with PHP fallback defaults.
  • The effective config/regression provider now exposes and guards the technical output-priority rules.

Not changed

  • No retrieval logic changed.
  • No vector search logic changed.
  • No shop logic changed.
  • No core hard-coded domain keyword list added.
  • No scoring behavior changed.

After applying

Run:

php bin/console cache:clear
php bin/console mto:agent:config:validate
php bin/console mto:agent:regression:test