Spaces:
Running
Running
Update index.html
Browse files- index.html +104 -15
index.html
CHANGED
|
@@ -107,9 +107,10 @@
|
|
| 107 |
<div class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 ml-3 mt-6">Orchestrierung & Code</div>
|
| 108 |
<ul class="space-y-1 text-sm font-medium">
|
| 109 |
<li><a href="#orchestration" class="block py-2 px-3 text-gray-600 rounded-lg hover:bg-gray-200 hover:text-gray-900 transition">7. Routing & Tool-Calling</a></li>
|
| 110 |
-
<li><a href="#repo" class="
|
| 111 |
-
|
| 112 |
-
|
|
|
|
| 113 |
</a></li>
|
| 114 |
</ul>
|
| 115 |
</div>
|
|
@@ -341,9 +342,7 @@ router = ConditionalRouter(routes)</code></pre>
|
|
| 341 |
|
| 342 |
<!-- KAPITEL 8: REPOSITORY UND CODE -->
|
| 343 |
<section id="repo">
|
| 344 |
-
<h2
|
| 345 |
-
<span>📁</span> 8. Repository-Struktur: Der Master-Plan
|
| 346 |
-
</h2>
|
| 347 |
<p>Alle Code-Schnipsel aus Kapitel 3 bis 7 fügen sich nun zusammen. Ein komplexes MAS sollte <strong>niemals ein Monolith</strong> sein (alles in einem Skript). Eine monolithische Architektur würde das Testen einzelner Pipelines fast unmöglich machen und zu Spaghetti-Code beim Routing führen.</p>
|
| 348 |
|
| 349 |
<p>Dank der modularen Architektur von Haystack 2.0 spiegelt sich die fachliche Trennung direkt im Repository wider:</p>
|
|
@@ -395,7 +394,7 @@ def main():
|
|
| 395 |
coordinator.add_component("llm", llm)
|
| 396 |
coordinator.add_component("invoker", invoker)
|
| 397 |
|
| 398 |
-
# Zyklische Verbindung für iteratives Arbeiten
|
| 399 |
coordinator.connect("llm.replies", "invoker.messages")
|
| 400 |
coordinator.connect("invoker.tool_messages", "llm.messages")
|
| 401 |
|
|
@@ -406,8 +405,6 @@ def main():
|
|
| 406 |
print(f"🤖 Koordinator startet Aufgabe: {user_prompt}")
|
| 407 |
|
| 408 |
# Run Loop
|
| 409 |
-
# Im echten MAS läuft dies in Verbindung mit dem Router in einer Schleife,
|
| 410 |
-
# bis das LLM entscheidet: "Ich bin fertig, hier ist das finale HTML."
|
| 411 |
result = coordinator.run({"llm": {"messages": messages}})
|
| 412 |
|
| 413 |
print("Fertiges Ergebnis:", result["llm"]["replies"][0].text)
|
|
@@ -417,17 +414,102 @@ if __name__ == "__main__":
|
|
| 417 |
</div>
|
| 418 |
|
| 419 |
<div class="mt-8 p-5 bg-blue-50/50 rounded-xl text-sm text-gray-700 border border-blue-100 flex items-start gap-4 shadow-sm">
|
| 420 |
-
<span class="text-2xl">💡</span>
|
| 421 |
<div>
|
| 422 |
<strong class="text-gray-900 block mb-1">Die Architektur-Philosophie:</strong>
|
| 423 |
Diese Aufteilung erlaubt es dir, das Modell in <code>main.py</code> auszutauschen, die Such-Logik in <code>researcher.py</code> komplett neu zu schreiben oder an der HTML-Karte zu basteln, ohne dass die anderen Teile des Multi-Agenten-Systems zerbrechen. Das ist die Stärke von Haystack 2.0!
|
| 424 |
</div>
|
| 425 |
</div>
|
|
|
|
| 426 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
</section>
|
| 428 |
|
| 429 |
-
<
|
| 430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 431 |
</footer>
|
| 432 |
</div>
|
| 433 |
</main>
|
|
@@ -456,13 +538,20 @@ if __name__ == "__main__":
|
|
| 456 |
|
| 457 |
// Active State Styling Update
|
| 458 |
document.querySelectorAll('#sidebar a').forEach(a => {
|
| 459 |
-
a.classList.remove('bg-hfYellow/20', 'text-yellow-800', 'font-semibold');
|
| 460 |
-
a.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 461 |
});
|
| 462 |
|
| 463 |
-
if(this.getAttribute('href') !== '#repo') {
|
| 464 |
this.classList.remove('text-gray-600');
|
| 465 |
this.classList.add('bg-hfYellow/20', 'text-yellow-800', 'font-semibold');
|
|
|
|
|
|
|
|
|
|
| 466 |
}
|
| 467 |
|
| 468 |
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
|
|
|
| 107 |
<div class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 ml-3 mt-6">Orchestrierung & Code</div>
|
| 108 |
<ul class="space-y-1 text-sm font-medium">
|
| 109 |
<li><a href="#orchestration" class="block py-2 px-3 text-gray-600 rounded-lg hover:bg-gray-200 hover:text-gray-900 transition">7. Routing & Tool-Calling</a></li>
|
| 110 |
+
<li><a href="#repo" class="block py-2 px-3 text-gray-600 rounded-lg hover:bg-gray-200 hover:text-gray-900 transition">8. Repositorystruktur</a></li>
|
| 111 |
+
<li><a href="#outlook" class="flex items-center gap-2 mt-2 py-2 px-3 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition">
|
| 112 |
+
<svg class="w-4 h-4 text-hfYellow" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
|
| 113 |
+
9. Fazit: Die KI-Küchenbrigade
|
| 114 |
</a></li>
|
| 115 |
</ul>
|
| 116 |
</div>
|
|
|
|
| 342 |
|
| 343 |
<!-- KAPITEL 8: REPOSITORY UND CODE -->
|
| 344 |
<section id="repo">
|
| 345 |
+
<h2><span>📁</span> 8. Repository-Struktur: Der Master-Plan</h2>
|
|
|
|
|
|
|
| 346 |
<p>Alle Code-Schnipsel aus Kapitel 3 bis 7 fügen sich nun zusammen. Ein komplexes MAS sollte <strong>niemals ein Monolith</strong> sein (alles in einem Skript). Eine monolithische Architektur würde das Testen einzelner Pipelines fast unmöglich machen und zu Spaghetti-Code beim Routing führen.</p>
|
| 347 |
|
| 348 |
<p>Dank der modularen Architektur von Haystack 2.0 spiegelt sich die fachliche Trennung direkt im Repository wider:</p>
|
|
|
|
| 394 |
coordinator.add_component("llm", llm)
|
| 395 |
coordinator.add_component("invoker", invoker)
|
| 396 |
|
| 397 |
+
# Zyklische Verbindung für iteratives Arbeiten
|
| 398 |
coordinator.connect("llm.replies", "invoker.messages")
|
| 399 |
coordinator.connect("invoker.tool_messages", "llm.messages")
|
| 400 |
|
|
|
|
| 405 |
print(f"🤖 Koordinator startet Aufgabe: {user_prompt}")
|
| 406 |
|
| 407 |
# Run Loop
|
|
|
|
|
|
|
| 408 |
result = coordinator.run({"llm": {"messages": messages}})
|
| 409 |
|
| 410 |
print("Fertiges Ergebnis:", result["llm"]["replies"][0].text)
|
|
|
|
| 414 |
</div>
|
| 415 |
|
| 416 |
<div class="mt-8 p-5 bg-blue-50/50 rounded-xl text-sm text-gray-700 border border-blue-100 flex items-start gap-4 shadow-sm">
|
| 417 |
+
<span class="text-2xl mt-1">💡</span>
|
| 418 |
<div>
|
| 419 |
<strong class="text-gray-900 block mb-1">Die Architektur-Philosophie:</strong>
|
| 420 |
Diese Aufteilung erlaubt es dir, das Modell in <code>main.py</code> auszutauschen, die Such-Logik in <code>researcher.py</code> komplett neu zu schreiben oder an der HTML-Karte zu basteln, ohne dass die anderen Teile des Multi-Agenten-Systems zerbrechen. Das ist die Stärke von Haystack 2.0!
|
| 421 |
</div>
|
| 422 |
</div>
|
| 423 |
+
</section>
|
| 424 |
|
| 425 |
+
<!-- NEUES GRAND FINALE (KERNPRINZIP MAS & KÜCHENMETAPHER) -->
|
| 426 |
+
<section id="outlook" class="mt-20 pt-8 border-t border-gray-200">
|
| 427 |
+
<div class="bg-gray-900 text-white rounded-3xl p-8 md:p-12 shadow-2xl relative overflow-hidden">
|
| 428 |
+
<!-- Dekoration -->
|
| 429 |
+
<div class="absolute -top-24 -right-24 w-64 h-64 bg-hfYellow rounded-full mix-blend-multiply filter blur-3xl opacity-20"></div>
|
| 430 |
+
<div class="absolute -bottom-24 -left-24 w-64 h-64 bg-blue-500 rounded-full mix-blend-multiply filter blur-3xl opacity-20"></div>
|
| 431 |
+
|
| 432 |
+
<div class="relative z-10">
|
| 433 |
+
<div class="flex items-center gap-3 mb-6">
|
| 434 |
+
<span class="text-3xl">👨🍳</span>
|
| 435 |
+
<h2 class="text-3xl font-bold m-0 border-none !text-white">Fazit: Die KI-Küchenbrigade</h2>
|
| 436 |
+
</div>
|
| 437 |
+
|
| 438 |
+
<p class="text-gray-300 text-lg leading-relaxed max-w-2xl mb-6">
|
| 439 |
+
Man sagt oft: <em>»Viele Köche verderben den Brei.«</em> In der Welt der Künstlichen Intelligenz gilt jedoch genau das Gegenteil – vorausgesetzt, man hat die richtige Architektur.
|
| 440 |
+
</p>
|
| 441 |
+
|
| 442 |
+
<p class="text-gray-300 text-lg leading-relaxed max-w-2xl mb-8">
|
| 443 |
+
Das "Infinite Cookbook" illustriert das <strong>Grundprinzip eines Multi-Agenten-Systems (MAS)</strong> perfekt. Anstatt ein einziges, riesiges "Gott-Modell" mit einem gigantischen Prompt zu überlasten (und zu hoffen, dass es gleichzeitig fehlerfrei recherchiert, programmiert, layoutet und malt), etablieren wir eine hochspezialisierte, arbeitsteilige Küchenbrigade:
|
| 444 |
+
</p>
|
| 445 |
+
|
| 446 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-10">
|
| 447 |
+
<div class="bg-white/5 border border-white/10 rounded-xl p-5 hover:bg-white/10 transition">
|
| 448 |
+
<h3 class="!text-white text-base font-semibold mt-0 mb-2 flex items-center gap-2">
|
| 449 |
+
<span>👔</span> Der Küchenchef (Koordinator)
|
| 450 |
+
</h3>
|
| 451 |
+
<p class="text-gray-400 text-sm m-0">
|
| 452 |
+
Er kocht nicht selbst. Er nimmt die Bestellung des Gastes entgegen, plant die Schritte und delegiert die Aufgaben an sein Team (Tool Calling).
|
| 453 |
+
</p>
|
| 454 |
+
</div>
|
| 455 |
+
<div class="bg-white/5 border border-white/10 rounded-xl p-5 hover:bg-white/10 transition">
|
| 456 |
+
<h3 class="!text-white text-base font-semibold mt-0 mb-2 flex items-center gap-2">
|
| 457 |
+
<span>🛒</span> Der Einkäufer (Forschung)
|
| 458 |
+
</h3>
|
| 459 |
+
<p class="text-gray-400 text-sm m-0">
|
| 460 |
+
Er weiß, auf welchen Märkten (Web) es die besten und authentischsten Zutaten (Daten) gibt. Er sortiert den Müll aus und bringt nur das Beste in die Küche.
|
| 461 |
+
</p>
|
| 462 |
+
</div>
|
| 463 |
+
<div class="bg-white/5 border border-white/10 rounded-xl p-5 hover:bg-white/10 transition">
|
| 464 |
+
<h3 class="!text-white text-base font-semibold mt-0 mb-2 flex items-center gap-2">
|
| 465 |
+
<span>🔪</span> Der Postenchef (Struktur)
|
| 466 |
+
</h3>
|
| 467 |
+
<p class="text-gray-400 text-sm m-0">
|
| 468 |
+
Er ist besessen von Präzision. Er nimmt die losen Zutaten und formatiert sie exakt nach der strikten Pydantic-Rezeptvorlage. Keine Halluzinationen, nur Fakten.
|
| 469 |
+
</p>
|
| 470 |
+
</div>
|
| 471 |
+
<div class="bg-white/5 border border-white/10 rounded-xl p-5 hover:bg-white/10 transition">
|
| 472 |
+
<h3 class="!text-white text-base font-semibold mt-0 mb-2 flex items-center gap-2">
|
| 473 |
+
<span>📸</span> Der Food-Stylist (Visionär)
|
| 474 |
+
</h3>
|
| 475 |
+
<p class="text-gray-400 text-sm m-0">
|
| 476 |
+
Er interessiert sich nicht für Grammatik oder HTML. Er malt mit Diffusionsmodellen atemberaubende Bilder, die das Gericht perfekt in Szene setzen.
|
| 477 |
+
</p>
|
| 478 |
+
</div>
|
| 479 |
+
</div>
|
| 480 |
+
|
| 481 |
+
<p class="text-gray-300 text-lg leading-relaxed max-w-2xl mb-8 font-medium border-l-4 border-hfYellow pl-4">
|
| 482 |
+
Die wahre Stärke eines MAS ist die <strong>Isolation von Komplexität</strong>. Wenn das HTML bricht, reparieren wir den Meta-Agenten. Wenn wir ein besseres Open-Source-Modell für JSON finden, tauschen wir den Postenchef aus, ohne dass der Rest der Küche stehenbleibt. <span class="text-hfYellow">Haystack 2.0 liefert uns dafür die Küche – und die Infrastruktur von Hugging Face das Personal.</span>
|
| 483 |
+
</p>
|
| 484 |
+
|
| 485 |
+
<div class="flex flex-wrap items-center gap-4">
|
| 486 |
+
<a href="https://haystack.deepset.ai/" target="_blank" class="px-6 py-3 bg-hfYellow text-gray-900 font-bold rounded-lg hover:bg-hfYellow-hover transition-colors flex items-center gap-2 no-underline">
|
| 487 |
+
Erforsche Haystack 2.0
|
| 488 |
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path></svg>
|
| 489 |
+
</a>
|
| 490 |
+
<a href="https://huggingface.co/models" target="_blank" class="px-6 py-3 bg-gray-800 text-white border border-gray-700 font-semibold rounded-lg hover:bg-gray-700 transition-colors flex items-center gap-2 no-underline">
|
| 491 |
+
🤗 HF Modelle entdecken
|
| 492 |
+
</a>
|
| 493 |
+
</div>
|
| 494 |
+
</div>
|
| 495 |
+
</div>
|
| 496 |
</section>
|
| 497 |
|
| 498 |
+
<!-- ÜBERARBEITETER FOOTER -->
|
| 499 |
+
<footer class="mt-16 py-8 border-t border-gray-200 flex flex-col md:flex-row items-center justify-between gap-6">
|
| 500 |
+
<div class="flex items-center gap-3">
|
| 501 |
+
<span class="text-2xl opacity-80">🤗</span>
|
| 502 |
+
<p class="text-sm text-gray-500 m-0 leading-tight">
|
| 503 |
+
<strong>The Infinite Cookbook Konzept</strong><br>
|
| 504 |
+
Ein Architektur-Beispiel für Multi-Agenten-Systeme.
|
| 505 |
+
</p>
|
| 506 |
+
</div>
|
| 507 |
+
|
| 508 |
+
<div class="flex items-center gap-6 text-sm font-medium text-gray-500">
|
| 509 |
+
<a href="#" class="hover:text-gray-900 transition-colors no-underline">Source PDF</a>
|
| 510 |
+
<a href="https://github.com/deepset-ai/haystack" target="_blank" class="hover:text-gray-900 transition-colors no-underline">Haystack GitHub</a>
|
| 511 |
+
<a href="https://huggingface.co/docs/inference-providers/index" target="_blank" class="hover:text-gray-900 transition-colors no-underline">Inference Docs</a>
|
| 512 |
+
</div>
|
| 513 |
</footer>
|
| 514 |
</div>
|
| 515 |
</main>
|
|
|
|
| 538 |
|
| 539 |
// Active State Styling Update
|
| 540 |
document.querySelectorAll('#sidebar a').forEach(a => {
|
| 541 |
+
a.classList.remove('bg-hfYellow/20', 'text-yellow-800', 'font-semibold', 'bg-gray-900', 'text-white', 'hover:bg-gray-800');
|
| 542 |
+
if (a.getAttribute('href') === '#outlook') {
|
| 543 |
+
a.classList.add('bg-gray-900', 'text-white', 'hover:bg-gray-800');
|
| 544 |
+
} else {
|
| 545 |
+
a.classList.add('text-gray-600');
|
| 546 |
+
}
|
| 547 |
});
|
| 548 |
|
| 549 |
+
if(this.getAttribute('href') !== '#outlook' && this.getAttribute('href') !== '#repo') {
|
| 550 |
this.classList.remove('text-gray-600');
|
| 551 |
this.classList.add('bg-hfYellow/20', 'text-yellow-800', 'font-semibold');
|
| 552 |
+
} else if (this.getAttribute('href') === '#repo') {
|
| 553 |
+
this.classList.remove('text-gray-600');
|
| 554 |
+
this.classList.add('bg-hfYellow/20', 'text-yellow-900', 'font-semibold');
|
| 555 |
}
|
| 556 |
|
| 557 |
document.querySelector(this.getAttribute('href')).scrollIntoView({
|