Leanpub Header

Skip to main content

KI-Anwendungen mit PHP entwickeln

Ein praxisorientierter Leitfaden mit PapiAI, Laravel und Symfony

Echte KI-Agenten in PHP entwickeln — ganz ohne Python. Zwei vollständige Projekte, zehn LLM-Anbieter und alles, was in der Produktion zählt.

This book is a translation into German of Building AI Applications with PHP which was originally written in English

Minimum price

$9.00

$15.00

You pay

$15.00

Author earns

$12.00
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.

Buying multiple copies for your team? See below for a discount!

PDF
EPUB
About

About

About the Book

PHP-Entwickler bauen jeden Tag anspruchsvolle Anwendungen mit Laravel und Symfony — doch sobald KI ins Spiel kommt, heißt es plötzlich, man müsse zu Python greifen. Dieses Buch zeigt, dass das nicht nötig ist.

KI-Anwendungen mit PHP entwickeln führt Sie Schritt für Schritt durch die Entwicklung von zwei vollständigen, produktionsreifen KI-Anwendungen von Grund auf: einem intelligenten Kundensupport-Agenten mit Laravel und einer KI-gestützten Content-Generierungspipeline mit Symfony. Beide basieren auf PapiAI, einer Open-Source-PHP-Bibliothek ohne Laufzeitabhängigkeiten, mit Unterstützung für 10 LLM-Anbieter und einer echten agentischen Laufzeitumgebung.

Sie lernen alle Aspekte der KI-Anwendungsentwicklung kennen, die in der Produktion wirklich zählen: Antworten in Echtzeit zu streamen, Agenten mit Tools auszustatten, die Ihre Datenbank abfragen, Konversationsspeicher über mehrere Requests hinweg zu verwalten, strukturierte Ausgaben mit Schemas zu validieren, RAG-Pipelines mit Embeddings und Vektorsuche aufzubauen, Aufgaben asynchron mit Queues zu verarbeiten, sich gegen Prompt Injection zu schützen, Kosten zu kontrollieren und sicher zu deployen.

Dies ist keine Tour durch API-Endpunkte. Es ist ein Leitfaden zu Architektur, Mustern und hart erarbeiteten Erkenntnissen, die eine Demo von einem produktiv einsetzbaren Produkt unterscheiden — vollständig geschrieben in der Sprache, die Sie bereits beherrschen.

This book is a translation into German of Building AI Applications with PHP which was originally written in English

Team Discounts

Team Discounts

Get a team discount on this book!

  • Up to 3 members

    Minimum price
    $47.00
    Suggested price
    $72.00
  • Up to 5 members

    Minimum price
    $76.00
    Suggested price
    $116.00
  • Up to 10 members

    Minimum price
    $133.00
    Suggested price
    $203.00
  • Up to 15 members

    Minimum price
    $190.00
    Suggested price
    $290.00
  • Up to 25 members

    Minimum price
    $285.00
    Suggested price
    $435.00

Author

About the Author

Marcello Duarte

Marcello Duarte was awarded Best UK Agile Coach in 2014. He has helped teams across Europe adopt Agile ways of working and improve engineering practices such as Scrum, TDD, refactoring, collaborative product ownership, and software quality. He is also the co-creator of PhpSpec, a well-known tool for TDD/SpecBDD in PHP, and brings many years of experience as a software engineering leader, consultant, trainer, and open-source author.

Translations

Translations

Contents

Table of Contents

KI-Anwendungen mit PHP entwickeln

  1. Ein Praxisleitfaden mit PapiAI, Laravel und Symfony

Teil I: Grundlagen

Kapitel 1: Die KI-native PHP-Anwendung

  1. Was Sie bauen werden
  2. Für wen dieses Buch ist
  3. Was Sie benötigen
  4. Die Anatomie einer KI-Anwendung
  5. PapiAI installieren

Kapitel 2: Ihr erster Agent

  1. Der Provider
  2. Der Agent
  3. Die Antwort
  4. Streaming
  5. Provider wechseln
  6. Failover

Kapitel 3: Tools — Der KI Hände geben

  1. Wie Tool Calling funktioniert
  2. Tools mit Closures erstellen
  3. Tools mit PHP-Attributen erstellen
  4. Prinzipien für das Tool-Design
  5. Die agentische Schleife und maxTurns

Kapitel 4: Konversationen und Speicher

  1. Das Conversation-Objekt
  2. Nachrichten
  3. Warum Kontextmanagement wichtig ist
  4. Strategien für das Kontextfenster
  5. Konversationen persistieren

Kapitel 5: Strukturierte Ausgabe

  1. Das Schema-System
  2. Schema-Typen
  3. Einschränkungen und Modifikatoren
  4. Validierung

Kapitel 6: Retrieval-Augmented Generation (RAG)

  1. Wie RAG funktioniert
  2. Embeddings mit PapiAI
  3. Der Vektorspeicher
  4. Eine RAG-Pipeline aufbauen
  5. RAG als Tool
  6. RAG-Qualität optimieren
  7. Produktionsüberlegungen

Kapitel 7: Middleware

  1. Das Middleware-Interface
  2. Eingebaute Middleware
  3. Middleware stapeln
  4. Eigene Middleware

Teil II: Das Laravel-Projekt entwickeln

Kapitel 8: Projekteinrichtung — Der Support-Agent

  1. Grundgerüst
  2. Konfiguration
  3. Datenbankeinrichtung
  4. Der System-Prompt

Kapitel 9: Die Tools entwickeln

  1. OrderLookup
  2. KnowledgeBase
  3. InventoryCheck
  4. Tools im Service Provider registrieren
  5. Domain-Modelle

Kapitel 10: Der Chat-Controller und Streaming

  1. Der Controller
  2. Routen
  3. Das Frontend
  4. Den Ablauf testen

Kapitel 11: Sicherheit

  1. Prompt Injection
  2. Tool-Sicherheit
  3. API-Schlüssel-Verwaltung
  4. Rate Limiting
  5. Kostenkontrolle

Teil III: Das Symfony-Projekt entwickeln

Kapitel 12: Projekteinrichtung — Die Content-Pipeline

  1. Grundgerüst
  2. Bundle-Konfiguration
  3. Datenbankschema
  4. Das Artikel-Schema

Kapitel 13: Die Content-Generierungs-Pipeline

  1. Der Pipeline-Orchestrator
  2. Asynchrone Verarbeitung mit Messenger
  3. Der Controller
  4. Die Twig-Templates
  5. Den Worker starten

Kapitel 14: Performance

  1. Streaming
  2. Caching
  3. Modellauswahl
  4. Asynchrone Verarbeitung
  5. Token-Optimierung
  6. Verbindungswiederverwendung

Kapitel 15: Architekturmuster

  1. Der Agent als Service
  2. Belange trennen
  3. Prompt-Verwaltung
  4. Das Router-Muster
  5. Beobachtbarkeit

Kapitel 16: KI-Anwendungen testen

  1. Tools testen
  2. Testen mit Mock-Providern
  3. Schemas testen
  4. Integrationstests

Kapitel 17: Deployment und Produktionsbetrieb

  1. Umgebungskonfiguration
  2. Health Checks
  3. Monitoring
  4. Timeouts
  5. Skalierung

Anhang A: Provider-Referenz

  1. Provider-Fähigkeitsmatrix
  2. Provider-Konstruktor-Parameter

Anhang B: Schema-Referenz

  1. Typen
  2. Einschränkungen
  3. Validierungsmethoden

Anhang C: Middleware-Referenz

  1. RetryMiddleware
  2. RateLimitMiddleware
  3. CacheMiddleware
  4. LoggingMiddleware
  5. Eigene Middleware

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub