harden history find tokens and shops earch

This commit is contained in:
team 1
2026-04-26 19:59:31 +02:00
parent ff273ff9a0
commit 308e980b4a
11 changed files with 1230 additions and 75 deletions

View File

@@ -0,0 +1,36 @@
# RetrieX shop query meta guard hotfix
This patch hardens the Shopware query optimizer after the language-preservation fix.
## Problem
A pure shop command such as `suche im shop` could be optimized to the meta word `shop` and then executed as an actual Store API search query.
## Fix
- Adds a configurable `shop_prompt.meta_query_guard` section in `config/retriex/agent.yaml`.
- Rejects optimized queries that consist only of generic command/meta terms such as `shop`, `suche`, `im`, `bitte`.
- If the current user input is only a shop command, RetrieX tries to use the latest meaningful user question from the recent conversation context as a generic fallback.
- If no meaningful context exists, the shop search is skipped and a clear message is shown instead of searching for `shop`.
- Keeps the previous language-preservation behavior for German search terms.
## Scope
Changed files only:
- `config/retriex/agent.yaml`
- `src/Agent/AgentRunner.php`
- `src/Config/AgentRunnerConfig.php`
- `src/Config/RetriexEffectiveConfigProvider.php`
No retrieval, vector, scoring, prompt-builder, vocabulary, Shopware API or product-family-specific logic was changed.
## Validation
Run after installing:
```bash
php bin/console cache:clear
php bin/console mto:agent:config:validate
php bin/console mto:agent:regression:test
```