This commit is contained in:
team 1
2026-05-06 16:02:42 +02:00
parent e02c885527
commit abe929bd20
5 changed files with 515 additions and 349 deletions

View File

@@ -167,6 +167,260 @@ parameters:
- '/^\s*(?:produkt(?:-|\s)?nummer|artikel(?:-|\s)?nummer|preis|verfügbar|verfuegbar|url|quellen?)\b/iu'
- '/^\s*(?:status|query|intent|datenbasis|shop(?:-|\s)?suche)\b/iu'
shop_runtime:
query_cleanup:
current_input_preservation:
enabled: true
# Terms that must be preserved from the current user input in the final
# Shopware search query. This prevents short domain terms from being
# dropped by query optimization or generic cleanup. Adapt vocabulary view
# defaults or add a local `terms` override instead of changing PHP code.
vocabulary_views:
terms: agent.shop_runtime.query_cleanup.current_input_preservation_terms
stopword_cleanup:
enabled: true
min_query_tokens_after_cleanup: 2
# Plain Shopware text search should contain product-relevant terms only.
# These terms are UI, instruction, presentation or sorting words and are
# removed after LLM query optimization. Keep this list simple and local.
terms:
- zeige
- zeig
- suche
- such
- finde
- find
- gib
- gebe
- nenne
- mir
- bitte
- ich
- wir
- im
- in
- shop
- für
- fuer
- nach
- mit
- ohne
- von
- zum
- zur
- der
- die
- das
- ein
- eine
- einen
- ordne
- sortiere
- sortiert
- sortierung
- liste
- tabelle
- übersicht
- uebersicht
- auflistung
- meter
- metern
attribute_cleanup:
enabled: true
# For direct product/accessory lookups with comparative attribute
# constraints, keep the concrete product type and application terms but
# do not send range words/numeric thresholds to the plain text shop
# search. Example: "Anschlusskabel pH/Redox länger 20m" becomes
# "anschlusskabel redox" so the shop can return 25m/50m/100m cables.
min_query_tokens_after_cleanup: 2
# Direct product/accessory cleanup terms are resolved from
# config/retriex/vocabulary.yaml. Local lists may still be added here
# as project-specific overrides, but the default source is vocabulary.
vocabulary_views:
product_type_terms: search_repair.direct_product_type_terms
stop_terms: search_repair.direct_product_attribute_stop_terms
comparative_constraint_patterns:
- '/\b(?:länger|laenger|kürzer|kuerzer|größer|groesser|kleiner|über|ueber|unter|mindestens|maximal|maximum|minimum|ab|bis|mehr\s+als|weniger\s+als)\s+(?P<value>\d+(?:[,.]\d+)?\s*[\p{L}µ°%]*)\b/iu'
context_resolution:
context_usage:
referential_terms:
- der
- die
- das
- den
- dem
- dazu
- davon
- dafür
- dafuer
- dieser
- diese
- dieses
- obige
- obigen
- oben
- vorher
- zuvor
- gleiche
- gleichen
- selbe
- selben
history_anchor_enrichment:
enabled: true
max_query_terms: 2
template: '{anchor} {query}'
vocabulary_views:
trigger_terms: agent.shop_runtime.context_resolution.history_anchor_enrichment.trigger_terms
anchor_patterns:
- '/\b(?:indikator(?:typ)?|indicator(?:\s+type)?|reagenz(?:satz|typ)?|reagent(?:\s+set|\s+type)?|typ|type)\s+[A-Za-zÄÖÜäöüß]{0,8}\s*\d{1,5}(?:\s*[A-ZÄÖÜ]{1,4})?(?:\s*%)?\b/iu'
meta_query_guard:
enabled: true
cleanup_profile: shop_context_fallback
context_fallback_enabled: true
context_fallback_question_limit: 12
context_fallback_history_budget_chars: 20000
context_fallback_use_full_history: true
context_fallback_max_terms: 6
# Legacy/domain override list. Generic stopwords, user-instruction
# phrases and presentation terms are provided by profile
# `shop_context_fallback`. Keep shop/price/domain terms here.
context_fallback_filter_terms:
- preis
- preise
- preisen
- kosten
- kostet
- grenzwert
- grenzwerte
- grenzwerten
- welche
- gut
- geeignet
- messen
- gemessen
meta_only_terms:
- shop
- preis
- preise
- preisen
- kosten
- kostet
- shopsuche
- shop-suche
rag_anchor_enrichment:
enabled: true
# Enriches overly narrow numeric shop queries with a product anchor from
# retrieved RAG records when the same record explicitly contains the
# requested numeric value/unit. This prevents queries such as "0,02"
# when RAG already identified a concrete product such as a device model.
min_score: 120
max_query_terms: 6
early_chunk_bonus_max: 10
template: '{anchor} {query} {subject}'
scores:
exact_value_with_unit: 120
exact_value_only: 40
anchor_bonus: 50
numeric_focus_patterns:
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?P<unit>°?\s*d\s*h|dh|dH)/iu'
product_title_patterns:
- '/#\s*Produkt\s+Titel:\s*`(?P<title>[^`]+)`/iu'
- '/\*\*Produktname:\*\*\s*(?P<title>[^\r\n]+)/iu'
anchor_bonus_patterns:
- '/\b[\p{L}][\p{L}\p{N}®+._-]*(?:\s+|[-_])\d{2,5}\b/u'
subject_terms:
- resthärte
- resthaerte
- wasserhärte
- wasserhaerte
- gesamthärte
- gesamthaerte
- härte
- haerte
- grenzwert
- messung
result_identity:
enabled: true
# Direct product-list answers should only list products whose primary
# identity (name/URL) matches the requested product type. This prevents
# devices from being listed as a requested consumable merely because the
# description mentions such consumables as accessories.
prefer_primary_identity_matches: true
compound_prefix_match:
enabled: true
# Some Shopware product names combine the requested product type with
# a noun suffix, for example "pH-Pufferlösung". Keep this list small
# and explicit so broad direct-result filtering remains safe.
terms:
- puffer
- kalibrierpuffer
primary_identity_repair:
enabled: true
min_query_tokens_after_cleanup: 2
# Only used for a retry query when the direct-result guard would
# otherwise suppress all shop results. Keep product words and context
# such as brand/pH/Redox, but remove target-device wording that can
# push Shopware ranking toward devices instead of the requested
# accessory/consumable.
stop_terms:
- messgerät
- messgeraet
- messgeräte
- messgeraete
- messgeräten
- messgeraeten
- gerät
- geraet
- geräte
- geraete
- geräten
- geraeten
- handmessgerät
- handmessgeraet
- handmessgeräte
- handmessgeraete
- messkoffer
- koffer
answer_constraints:
length_sort:
enabled: true
trigger_patterns:
- '/\b(?:ordne|sortiere|sortiert|sortierung)\b.{0,80}\b(?:meter|metern|m)\b/iu'
- '/\bnach\s+(?:meter|metern|m)\b/iu'
value_patterns:
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
length_filter:
enabled: true
min_patterns:
- '/\b(?:ab|mindestens|minimum|min\.?|>=|größer\s+gleich|groesser\s+gleich)\s*(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/\b(?:länger|laenger|größer|groesser|mehr)\s+(?:als\s+)?(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\s*(?:oder\s+)?(?:länger|laenger|mehr)\b/iu'
max_patterns:
- '/\b(?:bis|maximal|maximum|max\.?|höchstens|hoechstens|<=|kleiner\s+gleich)\s*(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/\b(?:kürzer|kuerzer|kleiner|weniger)\s+(?:als\s+)?(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\s*(?:oder\s+)?(?:kürzer|kuerzer|weniger)\b/iu'
direct_answer:
enabled: true
max_results: 10
intro: 'Aus den Shopdaten ergeben sich folgende passende Treffer:'
no_results: 'Ich finde in den Shopdaten keine passenden Treffer für die angefragte Produktsuche. Ich liste deshalb keine fachfremden Ersatzprodukte auf.'
sorted_by_length_note: 'Sortierung: aufsteigend nach erkannter Kabellänge.'
min_length_filter_note: 'Filter: nur Treffer ab {value} m.'
max_length_filter_note: 'Filter: nur Treffer bis {value} m.'
rag_evidence_guard:
cleanup_profile: rag_evidence
# Legacy/domain override list. Generic German stopwords are provided by
@@ -212,15 +466,6 @@ parameters:
vocabulary_maps:
synonyms: agent.rag_evidence_guard.synonyms
direct_shop_result_answer:
enabled: true
max_results: 10
intro: 'Aus den Shopdaten ergeben sich folgende passende Treffer:'
no_results: 'Ich finde in den Shopdaten keine passenden Treffer für die angefragte Produktsuche. Ich liste deshalb keine fachfremden Ersatzprodukte auf.'
sorted_by_length_note: 'Sortierung: aufsteigend nach erkannter Kabellänge.'
min_length_filter_note: 'Filter: nur Treffer ab {value} m.'
max_length_filter_note: 'Filter: nur Treffer bis {value} m.'
no_llm_fallback:
max_shop_results: 5
messages:
@@ -423,241 +668,6 @@ parameters:
- '- Do not revive older products unless the current user input clearly refers to them.'
- '- If the current input starts a new topic, ignore older product context.'
- '- Prefer the most recent product reference over older ones.'
current_input_preservation:
enabled: true
# Terms that must be preserved from the current user input in the final
# Shopware search query. This prevents short domain terms from being
# dropped by query optimization or generic cleanup. Adapt vocabulary view
# defaults or add a local `terms` override instead of changing PHP code.
vocabulary_views:
terms: agent.shop_prompt.current_input_preservation_terms
product_attribute_query_cleanup:
enabled: true
# For direct product/accessory lookups with comparative attribute
# constraints, keep the concrete product type and application terms but
# do not send range words/numeric thresholds to the plain text shop
# search. Example: "Anschlusskabel pH/Redox länger 20m" becomes
# "anschlusskabel redox" so the shop can return 25m/50m/100m cables.
min_query_tokens_after_cleanup: 2
# Direct product/accessory cleanup terms are resolved from
# config/retriex/vocabulary.yaml. Local lists may still be added here
# as project-specific overrides, but the default source is vocabulary.
vocabulary_views:
product_type_terms: search_repair.direct_product_type_terms
stop_terms: search_repair.direct_product_attribute_stop_terms
comparative_constraint_patterns:
- '/\b(?:länger|laenger|kürzer|kuerzer|größer|groesser|kleiner|über|ueber|unter|mindestens|maximal|maximum|minimum|ab|bis|mehr\s+als|weniger\s+als)\s+(?P<value>\d+(?:[,.]\d+)?\s*[\p{L}µ°%]*)\b/iu'
query_stopword_cleanup:
enabled: true
min_query_tokens_after_cleanup: 2
# Plain Shopware text search should contain product-relevant terms only.
# These terms are UI, instruction, presentation or sorting words and are
# removed after LLM query optimization. Keep this list simple and local.
terms:
- zeige
- zeig
- suche
- such
- finde
- find
- gib
- gebe
- nenne
- mir
- bitte
- ich
- wir
- im
- in
- shop
- für
- fuer
- nach
- mit
- ohne
- von
- zum
- zur
- der
- die
- das
- ein
- eine
- einen
- ordne
- sortiere
- sortiert
- sortierung
- liste
- tabelle
- übersicht
- uebersicht
- auflistung
- meter
- metern
direct_result_guard:
enabled: true
# Direct product-list answers should only list products whose primary
# identity (name/URL) matches the requested product type. This prevents
# devices from being listed as a requested consumable merely because the
# description mentions such consumables as accessories.
prefer_primary_identity_matches: true
compound_prefix_match:
enabled: true
# Some Shopware product names combine the requested product type with
# a noun suffix, for example "pH-Pufferlösung". Keep this list small
# and explicit so broad direct-result filtering remains safe.
terms:
- puffer
- kalibrierpuffer
primary_identity_repair:
enabled: true
min_query_tokens_after_cleanup: 2
# Only used for a retry query when the direct-result guard would
# otherwise suppress all shop results. Keep product words and context
# such as brand/pH/Redox, but remove target-device wording that can
# push Shopware ranking toward devices instead of the requested
# accessory/consumable.
stop_terms:
- messgerät
- messgeraet
- messgeräte
- messgeraete
- messgeräten
- messgeraeten
- gerät
- geraet
- geräte
- geraete
- geräten
- geraeten
- handmessgerät
- handmessgeraet
- handmessgeräte
- handmessgeraete
- messkoffer
- koffer
length_sort:
enabled: true
trigger_patterns:
- '/\b(?:ordne|sortiere|sortiert|sortierung)\b.{0,80}\b(?:meter|metern|m)\b/iu'
- '/\bnach\s+(?:meter|metern|m)\b/iu'
value_patterns:
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
length_filter:
enabled: true
min_patterns:
- '/\b(?:ab|mindestens|minimum|min\.?|>=|größer\s+gleich|groesser\s+gleich)\s*(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/\b(?:länger|laenger|größer|groesser|mehr)\s+(?:als\s+)?(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\s*(?:oder\s+)?(?:länger|laenger|mehr)\b/iu'
max_patterns:
- '/\b(?:bis|maximal|maximum|max\.?|höchstens|hoechstens|<=|kleiner\s+gleich)\s*(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/\b(?:kürzer|kuerzer|kleiner|weniger)\s+(?:als\s+)?(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\b/iu'
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?:m|meter|metern)\s*(?:oder\s+)?(?:kürzer|kuerzer|weniger)\b/iu'
context_usage:
referential_terms:
- der
- die
- das
- den
- dem
- dazu
- davon
- dafür
- dafuer
- dieser
- diese
- dieses
- obige
- obigen
- oben
- vorher
- zuvor
- gleiche
- gleichen
- selbe
- selben
context_anchor_enrichment:
enabled: true
max_query_terms: 2
template: '{anchor} {query}'
vocabulary_views:
trigger_terms: agent.shop_prompt.context_anchor_enrichment.trigger_terms
anchor_patterns:
- '/\b(?:indikator(?:typ)?|indicator(?:\s+type)?|reagenz(?:satz|typ)?|reagent(?:\s+set|\s+type)?|typ|type)\s+[A-Za-zÄÖÜäöüß]{0,8}\s*\d{1,5}(?:\s*[A-ZÄÖÜ]{1,4})?(?:\s*%)?\b/iu'
meta_query_guard:
enabled: true
cleanup_profile: shop_context_fallback
context_fallback_enabled: true
context_fallback_question_limit: 12
context_fallback_history_budget_chars: 20000
context_fallback_use_full_history: true
context_fallback_max_terms: 6
# Legacy/domain override list. Generic stopwords, user-instruction
# phrases and presentation terms are provided by profile
# `shop_context_fallback`. Keep shop/price/domain terms here.
context_fallback_filter_terms:
- preis
- preise
- preisen
- kosten
- kostet
- grenzwert
- grenzwerte
- grenzwerten
- welche
- gut
- geeignet
- messen
- gemessen
meta_only_terms:
- shop
- preis
- preise
- preisen
- kosten
- kostet
- shopsuche
- shop-suche
rag_anchor_enrichment:
enabled: true
# Enriches overly narrow numeric shop queries with a product anchor from
# retrieved RAG records when the same record explicitly contains the
# requested numeric value/unit. This prevents queries such as "0,02"
# when RAG already identified a concrete product such as a device model.
min_score: 120
max_query_terms: 6
early_chunk_bonus_max: 10
template: '{anchor} {query} {subject}'
scores:
exact_value_with_unit: 120
exact_value_only: 40
anchor_bonus: 50
numeric_focus_patterns:
- '/(?P<value>\d+(?:[,.]\d+)?)\s*(?P<unit>°?\s*d\s*h|dh|dH)/iu'
product_title_patterns:
- '/#\s*Produkt\s+Titel:\s*`(?P<title>[^`]+)`/iu'
- '/\*\*Produktname:\*\*\s*(?P<title>[^\r\n]+)/iu'
anchor_bonus_patterns:
- '/\b[\p{L}][\p{L}\p{N}®+._-]*(?:\s+|[-_])\d{2,5}\b/u'
subject_terms:
- resthärte
- resthaerte
- wasserhärte
- wasserhaerte
- gesamthärte
- gesamthaerte
- härte
- haerte
- grenzwert
- messung
language_preservation:
enabled: true
language_markers: