harden token config

This commit is contained in:
team 1
2026-04-26 15:20:06 +02:00
parent f34bc6b988
commit e3fd4541e4
6 changed files with 171 additions and 4 deletions

View File

@@ -0,0 +1,47 @@
# 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:
```bash
php bin/console cache:clear
php bin/console mto:agent:config:validate
php bin/console mto:agent:regression:test
```