optimize retrieve logic

This commit is contained in:
team 1
2026-04-14 08:55:01 +02:00
parent c23cfc664f
commit 41aadbddea
11 changed files with 89 additions and 29 deletions

BIN
public/assets/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@@ -19,19 +19,19 @@ body {
font-size: 0.85rem;
}
h1 {
font-size: 1.49rem;
h1,.h1 {
font-size: 1.75rem;
}
h2 {
font-size: 1.31rem;
h2,.h2 {
font-size: 1.35rem;
}
h3 {
font-size: 1.13rem;
h3,.h3 {
font-size: 1.35rem;
}
h4, h5, h6 {
h4, h5, h6,.h4,.h5,.h6 {
font-size: 0.95rem;
}
@@ -414,4 +414,52 @@ span.think {
.bubble img {
max-width: 50px;
max-height: 50px;
}
}
/*####################################*/
.example-1,
.example-2 {
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.example-1 .inner,
.example-2 .inner {
position: relative;
z-index: 1;
width: 100%;
}
.example-2 .inner {
margin: 2px;
}
.example-2::before {
content: "";
display: block;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(102, 102, 102, 0.75) 50%,
rgba(255, 255, 255, 0) 100%
);
height: 300px;
width: 100px;
transform: translate(0);
position: absolute;
animation: rotate 5s linear forwards infinite;
z-index: 0;
top: 50%;
transform-origin: top center;
}
@keyframes rotate {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}

View File

@@ -18,7 +18,12 @@
<div class="container">
<div class="header">
<h1>RetrieX KI-Agent</h1>
<div>
<div class="d-flex">
<img src="/assets/img/logo.png" style="max-width: 100px;">
</div>
<div class="text-info fw-bold">KI-Agent</div>
</div>
<div class="small">powered by mitho®</div>
<div class="spacer"></div>
<button id="clear" class="btn btn-trans">Diesen Chat löschen</button>

View File

@@ -70,7 +70,7 @@ final readonly class AgentRunner
- Maximal 6 Keywords, besser weniger.
- Entferne Füllwörter, Höflichkeitsformen und irrelevante Wörter.
- Erhalte Produktnamen, Marken, Modellnummern und zusammengesetzte Begriffe exakt, wenn sie relevant sind.
- Zahlen, die zu einem Produktnamen oder Modell gehören, müssen erhalten bleiben.
- Zahlen, die zu einem Produktnamen oder Modell gehören (zb Indikator 300 oder Testomat 808), müssen erhalten bleiben.
- Trenne die Begriffe nur durch Leerzeichen.
Ausgabeformat:
@@ -114,7 +114,7 @@ final readonly class AgentRunner
$knowledgeChunks = $this->retriever->retrieve($prompt);
// ---------------------------------------------------------
// 4) Optional commerce/shop search
// 4) commerce/shop search
// ---------------------------------------------------------
$commerceMeta = $this->commerceIntentLite->detect($prompt);

View File

@@ -29,7 +29,7 @@ final class NdjsonHybridRetriever implements RetrieverInterface
private const THRESHOLD_FLOOR = 0.83;
private const THRESHOLD_CEIL = 0.92;
private const EMPTY_RRF_FALLBACK_TOPN = 5;
private const EMPTY_RRF_FALLBACK_TOPN = 1;
public function __construct(
private readonly NdjsonChunkLookup $lookup,

View File

@@ -121,6 +121,7 @@ final class QueryEnricher
'Wasserhärte' => "Resthärte",
'Gerät' => 'Modell',
'Indikator' => 'Chemie',
'Indikatoren' => 'Indikator',
'Wasserhärte-Grenzwert'=>'Resthärte',
'Resthärte-Grenzwert'=>'Wasserhärte'
];

View File

@@ -84,7 +84,7 @@ final class ShopwareCriteriaBuilder
}
if ($query->searchText !== '') {
$criteria['term'] = $query->searchText;
$criteria['search'] = $query->searchText;
}
$filters = [

View File

@@ -31,7 +31,7 @@ final readonly class StoreApiClient
*/
public function searchProducts(array $criteria): array
{
$url = rtrim($this->baseUrl, '/') . '/store-api/product';
$url = rtrim($this->baseUrl, '/') . '/store-api/search';
$response = $this->httpClient->request('POST', $url, [
'headers' => [

View File

@@ -18,14 +18,17 @@
{# ============================= #}
{# Top Navigation #}
{# ============================= #}
{% if app.user %}
<nav class="navbar navbar-dark bg-black border-bottom border-secondary px-3">
<div class="navbar-brand fw-semibold text-info">
<div>
<img src="/assets/img/logo.png" style="max-width: 120px;">
</div>
<div class="fs-6">RAG-System</div>
</div>
<div class="small">powered by mitho®</div>
<div class="ms-auto d-flex align-items-center gap-3">
<nav class="navbar navbar-dark bg-black border-bottom border-secondary px-3">
<div class="navbar-brand fw-semibold text-info">
RetrieX RAG-System
</div>
<div class="small">powered by mitho®</div>
<div class="ms-auto d-flex align-items-center gap-3">
{% if app.user %}
<span class="small text-light">
{{ app.user.userIdentifier }}
</span>
@@ -34,10 +37,10 @@
href="{{ path('admin_logout') }}">
Logout
</a>
{% endif %}
</div>
</nav>
</div>
</nav>
{% endif %}
{# ============================= #}
{# Layout Container #}
{# ============================= #}

View File

@@ -192,7 +192,7 @@
des aktiven Modells aus. Pro Modell kann nur eine Version aktiv sein.
</div>
<hr>
<h2 class="h4 mb-4" id="agentLiveTest">KI-Agent Live-Test</h2>
<h3 class="h3 mb-4" id="agentLiveTest">KI-Live-Test</h3>
<div class="card bg-black border-secondary">
<div class="card-body p-0">

View File

@@ -10,10 +10,13 @@
<div class="card bg-black border-secondary text-info">
<div class="card-body">
<h1 class="h3 mb-2 text-center text-info">
Heyl Neomeris
</h1>
<h2 class="h6 mb-2 mt-1 text-center text-info">KI/RAG System-Login</h2>
<header class="text-center ">
<h1 class="mb-2 text-info">
Heyl Neomeris
</h1>
<img src="/assets/img/logo.png" style="max-width: 100px;">
<h2 class="h6 mb-2 mt-1 text-info">KI/RAG System-Login</h2>
</header>
{% if error %}
<div class="alert alert-danger">