Download the PHP package bluebranch/chatbot without Composer

On this page you can find all versions of the php package bluebranch/chatbot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chatbot

BlueBranch Chatbot – KI-Chatbot und KI-Suche mit Spracheingabe für Contao (DE)

Dein Website-Assistent für Contao: Besucher tippen oder sprechen ihre Frage und bekommen sofort eine Antwort – ausschließlich aus deinen eigenen Seiten, mit Quellenangabe.

Mehr zum Produkt, zu den Tarifen und zum Datenschutz: chatbot-dsgvo.de

Die Erweiterung übergibt die Seiteninhalte beim Suchindex-Lauf an die Chatbot-API, die daraus eine Vektor-Wissensbasis aufbaut. Aus genau diesem Bestand werden Fragen beantwortet – als aufklappbares Chat-Widget und als zusammenfassende Antwort über der Trefferliste der Contao-Suche.

Der API-Schlüssel bleibt dabei auf dem Server: Der Browser spricht ausschließlich mit Contao, Contao spricht mit der API.

Stand der Entwicklung und offene ToDos: docs/stand-und-todos.md

So sieht es aus

Chat mit Sprachaufnahme Frage-Modul mit Antwortkarte
Eigene Farbe (eine CSS-Variable) Auf dem Smartphone

Erste Schritte im Backend

Unter BlueBranch Chatbot → Erste Schritte führt ein Assistent in drei Pflichtschritten zum laufenden Chat:

  1. Zugang verbinden – Link zur kostenlosen Registrierung, API-Key einfügen, die Verbindung wird sofort geprüft (Tarif, Verbrauch, Spracheingabe). Ein abgelehnter Key wird nicht übernommen, ein bisheriger bleibt erhalten. Gespeichert wird der Key wie bisher an der Startseite im Seitenbaum; wer mehrere Websites betreibt, wählt oben die Website.
  2. Inhalte trainieren – zeigt, wie viele Seiten und Zusatzinhalte trainiert sind. „Jetzt trainieren“ ruft die Seiten der Website nacheinander ab (Fortschrittsbalken); dabei indiziert Contao sie und übergibt sie an die API. „Alles neu trainieren“ setzt den Stand zurück und trainiert alle Seiten neu. Der Suchindex-Aufbau bleibt als Alternative.
  3. Chat anzeigen – ein Klick auf „Chat auf allen Seiten anzeigen“ setzt das Chat-Widget ohne Layout- und Modul-Arbeit in jede Seite ein. Einzelne Seiten nimmt Chat auf dieser Seite ausblenden in den Seiteneinstellungen aus; ein Widget, das schon im Layout oder Artikel steht, wird nicht doppelt eingesetzt. Die Einstellung steht auch unter System → Einstellungen → Chat auf allen Seiten anzeigen. Wer lieber selbst platziert, bindet die Module wie gewohnt ein.

Optional folgen Ausprobieren (Testfrage direkt im Backend) und Feinschliff (Spracheingabe und Feedback als Voreinstellung). Die Seite ist nur für Administratoren sichtbar.

So funktioniert die Contao-Integration

Nach der Installation brauchst du nur einen API-Schlüssel – und kannst direkt loslegen:

Am einfachsten geht es über BlueBranch Chatbot → Erste Schritte (siehe oben). Hier die Schritte von Hand:

  1. Installation der Erweiterung $ composer require bluebranch/chatbot oder über den Contao Manager
  2. Registriere Dich auf chatbot.bluebranch.de
  3. API-Key erstellen und am Startpunkt der Website hinterlegen
  4. Suchindex neu aufbauen – damit werden die Inhalte trainiert
  5. Frontend-Modul einbinden

Fertig!

Voraussetzungen

Installation

Über den Contao Manager das Paket bluebranch/chatbot hinzufügen, oder per Composer:

Anschließend das Contao-Backend einmal aufrufen, damit die Datenbank aktualisiert wird.

Einrichtung

1. API-Schlüssel hinterlegen

Der Schlüssel wird pro Website gesetzt: Seitenstruktur → Startpunkt der Website bearbeiten → Feld Chatbot API-Key. In einer Installation mit mehreren Websites bekommt jede ihren eigenen Schlüssel und damit ihre eigene Wissensbasis.

Ein hinterlegter Schlüssel wird nie ins Formular geschrieben. Im Feld steht nur ein Platzhalter – im Quelltext der Backend-Seite, im Browserverlauf und in jedem Zwischenspeicher also ebenfalls. hideInput zeigt zusätzlich Punkte statt Zeichen.

Eingabe Wirkung
Platzhalter stehen lassen Der Schlüssel bleibt
Feld leeren Der Schlüssel wird gelöscht
Etwas anderes eintragen Wird als neuer Schlüssel übernommen

2. Inhalte trainieren

Die Wissensbasis füllt sich über den Contao-Suchindex. Sobald der Crawler läuft (System → Suchindex neu aufbauen), wird jede indizierte Seite an die API übergeben. Was nicht im Suchindex steht, kennt der Chatbot nicht.

Läuft die Installation im dev-Environment, hängt Symfony an jede Antwort einen X-Robots-Tag: noindex-Header. Der Contao-Crawler überspringt daraufhin sämtliche Seiten, und es wird nichts trainiert. Für einen Trainingslauf APP_ENV=prod setzen.

3. Modul einbinden

Unter Themes → Frontend-Module stehen drei Module bereit:

Modul Zweck
Chatbot Widget Aufklappbarer Chat-Button, standardmäßig unten rechts
Chatbot Suche Zusammenfassende KI-Antwort über der Trefferliste der Suche (mit dem Template _full mit eigenem Suchfeld)
Chatbot Frage Eingabefeld mit getippten Fragen, Antwort direkt darunter

Alle drei werden wie gewohnt in ein Layout oder einen Artikel eingebunden.

Getippte Fragen

Chatbot Frage und Chatbot Suche haben beide das Feld Getippte Fragen — eine Liste beliebig vieler Texte. Sie werden im Frontend nacheinander Zeichen für Zeichen als Platzhalter ins Eingabefeld geschrieben, gelöscht und durch den nächsten ersetzt. Bleibt die Liste leer, steht dort der statische Platzhalter.

Die Animation ruht, sobald jemand das Feld anklickt oder etwas hineinschreibt, und im Hintergrund-Tab läuft sie gar nicht erst. Wer in seinem System reduzierte Bewegung eingestellt hat, sieht statt der Animation die erste Frage unbewegt stehen.

Chatbot Frage ist für Startseiten gedacht: Eine eingegebene Frage geht ohne Seitenwechsel an die KI, die Antwort erscheint samt Quellen direkt darunter — wie beim Such-Modul, nur ohne die Trefferliste der Contao-Suche.

Bestätigung einholen

Alle drei Module haben die Option Bestätigung einholen (Standard: aus). Ist sie aktiv, sehen Besucher zuerst den Hinweis, dass sie mit einer KI sprechen, und müssen ihn bestätigen:

Die Bestätigung gilt für die Browser-Sitzung und für alle Chatbot-Module der Seite. Den Text liefern die Sprachdateien (consentText, consentButton in chatbot_widget).

Globale Einstellungen

Unter System → Einstellungen lassen sich Vorgaben für alle Chat-Widgets setzen. Jedes Modul kann sie einzeln überschreiben.

Einstellung Wirkung
Name des Chatbots Wird im Chat-Header angezeigt
Akzentfarbe Farbe des Widgets, als Hex-Wert mit Farbwähler
Icon (SVG) Ersetzt das Standard-KI-Icon im Chat-Button
Standard-Begrüßung Wird beim ersten Öffnen des Chats angezeigt
Standard-Vorschläge Vorschlagsfragen als Pills über dem Eingabefeld
„Inhalt zusammenfassen"-Pill ausblenden Blendet die Zusammenfassen-Funktion aus
Datenschutz-Hinweis ausblenden Blendet den Hinweis „Private chats & Hosted in Germany" aus
Spracheingabe im Chat-Widget anbieten Vorgabe für das Mikrofon, siehe Spracheingabe; standardmäßig aus

Automatische Bereinigung. Seiten, die nicht mehr veröffentlicht, von der Suche ausgeschlossen oder über ihr Start-/Stop-Datum abgelaufen sind, gehören nicht in den KI-Index. Ein zeitgesteuertes Ablaufen passiert ohne Speichern des Datensatzes und würde deshalb sonst nicht bemerkt. Das Intervall ist wählbar: stündlich, alle 6 Stunden, täglich (Vorgabe) oder wöchentlich. Der Lauf hängt an Contaos eigenem Cron-System – ein Server-Cronjob ist nicht nötig, es genügt, dass die Website regelmäßig aufgerufen wird.

Debug-Dateien. Standardmäßig aus. Eingeschaltet legt die Erweiterung zu jedem Trainings- und Löschvorgang eine JSON-Datei unter var/chatbot/ ab. Das ist zur Fehlersuche gedacht und nicht für den Dauerbetrieb: Ein Crawler-Lauf erzeugt eine Datei je Seite samt vollständigem Inhalt, und niemand räumt sie wieder weg.

Aussehen

Alle Teile – Chat-Widget, Frage-Modul und Suche – kommen mit fertigem Design und übernehmen die Akzentfarbe aus System → Einstellungen (im Widget je Modul überschreibbar): Verlauf im Kopf des Chats, Eingabefeld als Pille mit Lupe, Antwortkarte mit Quellen-Pillen, Trefferliste als Karten. Das Stylesheet lädt die Erweiterung selbst; wer es komplett selbst gestalten will, setzt im Modul Kein Standard-Styling.

Anpassen geht über CSS-Variablen, ohne die Datei der Erweiterung anzufassen:

Weitere Variablen: --chatbot-widget-bg, -surface, -bubble-bg, -text, -muted, -border, -bot-bubble, -gap, -z-index, -message-font-size.

Seiten von den KI-Antworten ausschließen

In den Seiteneinstellungen steht neben Von der Suche ausschließen (ab Contao 5.6: Suchindexierung) das Feld Aus den KI-Antworten ausschließen. Beide entscheiden dasselbe – ob eine Seite als Quelle dient – nur für zwei verschiedene Suchen, und sie sind voneinander unabhängig:

Contao-Volltextsuche KI-Antworten
Von der Suche ausschließen nein nein
Aus den KI-Antworten ausschließen ja nein
beide nein nein

Eine Kontaktseite kann so in der Volltextsuche stehen und trotzdem aus den Chatbot-Antworten heraus – oder umgekehrt.

Die Einstellung vererbt sich auf alle Unterseiten. Wer eine Rubrik abhakt, meint den ganzen Zweig. Beim Speichern werden die betroffenen Seiten sofort aus der Wissensbasis entfernt, nicht erst beim nächsten Bereinigungslauf.

Bereiche vom Index ausnehmen

Zwei Inhaltselemente grenzen Bereiche ab, die nicht in den Suchindex sollen:

Für die KI-Wissensbasis werden diese Markierungen bewusst ignoriert, damit auch Nachrichtenlisten und ähnliche dynamische Bereiche beantwortbar bleiben. Sie wirken auf die klassische Contao-Suche.

Fragen, Antworten und Feedback

Speichern: Unter System → Einstellungen → Fragen und Antworten lässt sich einschalten, dass jede Frage samt Antwort in der Tabelle tl_chatbot_log landet – für spätere Auswertungen. Es wird keine IP-Adresse, kein User-Agent und keine Sitzungskennung gespeichert; E-Mail-Adressen, Telefonnummern und IBANs in Fragen und Kommentaren werden maskiert. Die Aufbewahrung ist einstellbar (Standard 180 Tage, 0 = unbegrenzt).

Feedback: Unter System → Einstellungen → Fragen, Antworten und Feedback steht die Vorgabe Feedback zu Antworten abfragen; in jedem Modul (Widget, Frage, Suche) lässt sie sich mit Feedback abfragen auf „An“ oder „Aus“ setzen. Unter jeder Antwort erscheinen dann 👍/👎; beim Daumen nach unten kann der Besucher kurz angeben, was nicht gepasst hat (max. 1.000 Zeichen, ohne HTML). Eine bewertete Antwort wird auch dann samt Frage gespeichert, wenn das Speichern aller Fragen aus ist.

Ansehen und exportieren: BlueBranch Chatbot → Fragen & Feedback listet die Einträge mit Filtern (Bewertung, Quelle, Website, Suche), Löschen und CSV-Export (UTF-8, Semikolon, Excel-tauglich; Formeln werden entschärft).

Chat exportieren und Verlauf

Besucher können ihren Chat über das Download-Symbol im Kopf des Widgets als Text (.txt) oder WebVTT (.vtt) herunterladen – die Datei entsteht im Browser. Der Verlauf im localStorage enthält jetzt auch die Antworten samt Quellen und Bewertung; eine Antwort, die beim Seitenwechsel noch lief, steht danach mit dem Hinweis „Antwort unterbrochen“ da.

Spracheingabe (Mikrofon)

Im Chat-Widget, im Frage-Modul und in der Suche kann ein Mikrofon-Knopf stehen (im Widget neben dem Senden-Knopf, im Frage-Modul und in der Suche rechts im Eingabefeld). Besucher sprechen ihre Frage, die Aufnahme wird in Text umgewandelt und wie eine getippte Frage gesendet – mit Antwort, Quellen, Feedback und Verlauf wie gewohnt.

Einschalten. Unter System → Einstellungen → Spracheingabe im Chat-Widget anbieten gilt die Vorgabe für alle Module (standardmäßig aus). In jedem Modul – Chat-Widget, Frage-Modul und Suche – lässt sie sich mit Spracheingabe (Mikrofon) auf „An“ oder „Aus“ setzen, so lässt sich das Mikrofon auch nur an einzelnen Modulen anbieten oder an einzelnen abschalten.

Frage-Modul und Suche. Im Frage-Modul geht die gesprochene Frage nach dem Erkennen sofort ab; die Antwort erscheint darunter. In der Suche gilt das für die Variante mit eigenem Suchfeld (Template mod_chatbot_generate_search_full): Der erkannte Text startet die Suche wie ein getipptes Stichwort. Die Variante, die nur die KI-Antwort über der Trefferliste des Contao-Suchmoduls einfügt, hat kein eigenes Feld und deshalb kein Mikrofon. Angepasste Templates brauchen den Knopf .chatbot-voice-btn im Feld und voice in der Konfiguration – am einfachsten aus dem Template der Erweiterung übernehmen.

Wann der Knopf erscheint. Alle drei Bedingungen müssen zutreffen:

  1. Das Modul erlaubt die Spracheingabe (siehe oben).
  2. Die API hat die Spracherkennung für den Zugang eingerichtet (transcriptionEnabled in GET /user/me/tier). Das Ergebnis wird zehn Minuten zwischengespeichert; bei einem Fehler der API eine Minute.
  3. Die Seite läuft über HTTPS (oder localhost) und der Browser kann aufnehmen (MediaRecorder) – sonst bleibt der Knopf verborgen.

Bedienung. Ein Klick startet die Aufnahme, der nächste beendet sie und sendet. Während der Aufnahme zeigt eine Leiste Wellen nach Lautstärke und die Zeit; mit × oder Escape wird die Aufnahme verworfen. Die Aufnahme endet von selbst nach der längsten erlaubten Dauer des Zugangs (Free 10 s, Pro 30 s, Expert 60 s). Wurde es durchgehend still, geht nichts an die API und es erscheint „Es wurde nichts verstanden“ – Whisper erfindet bei Stille sonst gern Sätze.

Kontingent. Eine gesprochene Frage zählt zweimal zum Anfragekontingent: einmal für die Umwandlung, einmal für die Antwort.

Technik. Der Browser schickt die Aufnahme an POST /bluebranch/chatbot/api/v1/transcribe. Die Route prüft Sitzungs-Token, Signatur von Seite und Modul, die Modul-Einstellung, ein Ratenlimit (20 je Minute und Client) und die Größe (4 MB) und reicht die Aufnahme mit dem API-Schlüssel an POST /chatbot-ai/transcribe weiter. Der Schlüssel bleibt auf dem Server.

Zusatzinhalte

BlueBranch Chatbot → Zusatzinhalte nimmt Inhalte ohne eigene Seite auf: Texte für Meta-Infos (Öffnungszeiten, Ansprechpartner, Hinweise) und Dateien (TXT, MD, CSV, PDF, DOCX, ODT, HTML; max. 20 MB). Der Text wird auf dem eigenen Server ausgelesen (PDF über smalot/pdfparser), an die API geht nur Text – nie die Datei – und keine URL. Solche Inhalte erscheinen deshalb nicht als Link unter den Antworten. Speichern überträgt, Deaktivieren und Löschen entfernt; eine im Dateimanager ersetzte Datei wird automatisch neu übertragen.

Zeitgesteuerte Inhalte

Läuft eine Seite, ein Artikel oder ein Inhaltselement über Anzeigen ab/bis an oder ab, prüft ein Cronjob das alle 15 Minuten: Nicht mehr sichtbare Seiten verlassen sofort den KI-Index, bei geänderten Seiten wird die Seite einmal abgerufen und neu trainiert. Vorher geschah das erst beim nächsten Besuch der Seite bzw. beim täglichen Bereinigungslauf. Der Abruf braucht, dass der Server seine eigene Domain erreicht; sonst bleibt es beim nächsten Besuch.

Trainierte Inhalte einsehen

Das Backend-Modul BlueBranch Chatbot → Trainierte Inhalte zeigt, was die Wissensbasis tatsächlich enthält – je Website, mit Titel, URL, Anzahl der Chunks, Sprache und Trainingsdatum. Einzelne Einträge oder der gesamte Bestand lassen sich dort löschen. Über das eingebaute Test-Feld kannst du dem Chatbot direkt eine Frage stellen und die Antwort samt Quellen prüfen, ohne die Website zu öffnen.

Nutzungsstufen

Ein Zugang ist Free, Pro oder Expert. Die Stufen unterscheiden sich im Anfragekontingent der Antwort-Routen – je Minute und je Kalendermonat –, in der Zahl der Projekte und in der Länge einer Sprachaufnahme; Inhalte trainieren, Inhalte auflisten und API-Keys anlegen ist in allen Stufen unbegrenzt. Pro und Expert bucht der Inhaber des Zugangs selbst als Monatsabo über Stripe im Chatbot-Frontend (https://chatbot.bluebranch.de) – in dieser Erweiterung gibt es dafür keinen Bezahlweg.

Die konkreten Zahlen stehen bewusst nicht in dieser Erweiterung. Sie kommen zur Laufzeit von der API, zusammen mit einem fertigen Hinweistext. Ändert sich das Kontingent, ändert sich die Anzeige mit – ohne dass eine neue Fassung der Erweiterung ausgeliefert werden muss. Die aktuelle Stufe steht samt Verbrauch im laufenden Monat im Backend unter BlueBranch Chatbot → Trainierte Seiten oben auf der Seite.

Ist das Kontingent erschöpft, antwortet die API mit HTTP 429 und nennt in reason den Grund. Besucher sehen dann eine neutrale Meldung: beim Minutenlimit (rate_limit), sie sollten es gleich noch einmal versuchen, beim Monatskontingent (monthly_quota), später. Der ausführliche Grund samt Stufe landet im Log der Contao-Installation und nicht im Chatfenster.

Pausierte Projekte. Nach einem Abstieg (etwa Kündigung des Abos) bleiben alle Projekte erhalten, überzählige sind pausiert. Die API antwortet für sie mit HTTP 403 und reason: project_paused; Besucher lesen „Der Chat steht im Moment nicht zur Verfügung“. Welche Projekte aktiv bleiben, wählt der Inhaber im Chatbot-Frontend.

Wie die Anfragen laufen

Der Browser ruft ausschließlich Contao-Routen auf, die ihrerseits die API ansprechen:

Route Aufgabe
/bluebranch/chatbot/api/v1/chat/stream Antwort im Chat-Modus (kurz, schnell)
/bluebranch/chatbot/api/v1/generate/stream Antwort im Such-Modus (ausführlich)
/bluebranch/chatbot/api/v1/generate/search Antwort ohne Streaming

Alle drei verlangen einen Sitzungs-Token. Die Module holen ihn erst bei der ersten Frage über POST /bluebranch/chatbot/api/v1/token – Seiten mit Chatbot kommen so ohne Session aus und bleiben im HTTP-Cache. Frage und Token gehen per POST im Rumpf bzw. Header, nicht in der URL. Die Antworten kommen als Server-Sent Events zurück: zuerst ein sources-Ereignis mit den verwendeten Seiten, danach die Antwort in Stücken, zum Schluss ein end-Ereignis.

Wird die Erweiterung hinter einem Reverse Proxy betrieben, muss dieser das Puffern für diese Routen abschalten (proxy_buffering off bei nginx) – sonst kommt die Antwort erst am Stück und der Streaming-Effekt entfällt.

Aktualisieren

Nach dem Einspielen einer neuen Fassung sind zwei Schritte nötig, sonst ändert sich nichts:

  1. System-Wartung → Anwendungscache leeren
  2. System-Wartung → Datenbank aktualisieren

Per Konsole:

Ohne Schritt 1 sieht es aus, als sei nichts angekommen. Contao kompiliert seinen Dienst-Container nach var/cache/prod/ und liest ihn danach nur noch. Eine neu hochgeladene Klasse existiert für die Anwendung schlicht nicht: Ihre Callbacks werden nicht registriert, Felder erscheinen weiter wie zuvor – und es gibt keine Fehlermeldung, denn für Contao ist alles in Ordnung.

Ob eine Klasse angekommen ist, zeigt php vendor/bin/contao-console debug:container ApiKeyFieldListener --env=prod – die Zeile Tags muss contao.callback nennen.

Die Befehle als Webserver-Benutzer ausführen, meist www-data. Als root gestartet gehört das neu angelegte Cache-Verzeichnis hinterher root, der Webserver kann nicht mehr hineinschreiben, und die Website antwortet nur noch mit 500 – ohne Eintrag im Anwendungslog, weil der Fehler vor dem Framework passiert. Über den Contao Manager kann das nicht schiefgehen.

Ältere Versionen und angepasste Templates

Die Erweiterung läuft mit Contao 4.13 und 5.x (PHP 8.0 oder neuer). Beim Update bleibt alles lauffähig, auch wenn ein Schritt fehlt: Fehlen die neuen Datenbankfelder noch (vor Datenbank aktualisieren), liefern die Seiten normal aus, nur die neuen Schalter sind erst nach der Migration speicherbar.

Eigene Kopien der Templates unter templates/mod_chatbot_*.html5 ersetzen die der Erweiterung und werden vom Update nicht mitgezogen. Der Code bleibt rückwärtskompatibel dazu (getestet gegen die Templates von 1.3.0, 1.4.1 und 1.5.1):

Template stammt aus Verhalten mit der aktuellen Erweiterung
1.5.x funktioniert; Frage-Modul und Suche ohne Mikrofon-Knopf
1.3.x und 1.4.x funktioniert; ohne Mikrofon-Knopf, ohne neues Design (bei Frage und Suche), Widget-Text kann im Suchindex landen
älter als 1.3.0 Chat antwortet nicht („Bitte laden Sie die Seite neu“): Die Signatur von Seite und Modul fehlt, sie ist seit 1.3.0 Pflicht

BlueBranch Chatbot → Erste Schritte prüft die Projekt-Templates und nennt, welche veraltet sind und was ihnen fehlt; bei fehlender Signatur steht zusätzlich ein Fehler im Anwendungslog. Am einfachsten: die eigene Kopie löschen (dann gilt das Template der Erweiterung) oder neu aus vendor/bluebranch/chatbot/src/Resources/contao/templates/ kopieren und anpassen.

Datenschutz und Hosting

Vorteile für Redakteur:innen und Entwickler

BlueBranch Chatbot – AI chat and AI search with voice input for Contao (EN)

Your website assistant for Contao: visitors type or speak their question and get an answer right away – drawn only from your own pages, with sources.

More about the product, plans and data protection: chatbot-dsgvo.de

During the search index run, the extension hands your page content to the Chatbot API, which builds a vector knowledge base from it. Questions are answered from exactly that content – as a collapsible chat widget and as a summarising answer above the Contao search results.

The API key stays on the server: the browser only ever talks to Contao, and Contao talks to the API.

What it looks like

Chat with voice recording Question module with answer card
Your own colour (one CSS variable) On a smartphone

Getting started in the back end

Under BlueBranch Chatbot → Getting started an assistant leads to a running chat in three required steps:

  1. Connect your account – link to the free registration, paste the API key, the connection is checked right away (plan, usage, voice input). A rejected key is not kept; a previous key stays. The key is stored on the root page in the site tree as before; with several websites you pick the website at the top.
  2. Train your content – shows how many pages and additional contents are trained. "Train now" fetches the pages of the website one after another (progress bar); Contao indexes them and hands them to the API. "Retrain everything" resets the state and trains all pages again. The search index rebuild stays available as an alternative.
  3. Show the chat – one click on "Show chat on all pages" puts the chat widget into every page without layout or module work. Single pages are excluded with Hide chat on this page in the page settings; a widget that is already in a layout or article is not inserted twice. The setting is also under System → Settings → Show chat on all pages. If you prefer to place it yourself, add the modules as usual.

Optional: Try it out (a test question right in the back end) and Fine-tuning (voice input and feedback as defaults). The page is visible to administrators only.

How the Contao Integration Works

After installation, all you need is an API key – and you are ready to go:

  1. Install the extension using $ composer require bluebranch/chatbot or via the Contao Manager
  2. Register at chatbot.bluebranch.de
  3. Generate your API key and store it on the website's root page
  4. Rebuild the search index – this trains your content
  5. Add a front end module

That's it!

Requirements

Setup

1. Store the API key

The key is set per website: Site structure → edit the website's root page → field Chatbot API-Key. In an installation with several websites, each one gets its own key and therefore its own knowledge base.

A stored key is never written into the form. The field only ever contains a placeholder – in the backend page source, in the browser history and in any cache as well. hideInput additionally shows dots instead of characters.

Input Effect
Leave the placeholder The key is kept
Empty the field The key is deleted
Enter something else It is stored as the new key

2. Train your content

The knowledge base is filled through the Contao search index. As soon as the crawler runs (System → Rebuild the search index), every indexed page is passed to the API. Whatever is not in the search index is unknown to the chatbot.

If the installation runs in the dev environment, Symfony adds an X-Robots-Tag: noindex header to every response. The Contao crawler then skips all pages and nothing is trained. Set APP_ENV=prod for a training run.

3. Add a module

Two front end modules are available under Themes → Front end modules:

Module Purpose
Chatbot Widget Collapsible chat button, bottom right by default
Chatbot Search Summarising AI answer above the search results (with the _full template with its own search field)
Chatbot Question Input field with typed questions, answer right below it

All three are added to a layout or an article as usual.

Typed questions

Chatbot Question and Chatbot Search both offer the Typed questions field — a list of as many texts as you like. In the front end they are written into the input field as a placeholder, one character at a time, then deleted and replaced by the next one. If the list stays empty, the static placeholder remains.

The animation pauses as soon as somebody clicks into the field or types something, and it does not run at all in a background tab. Anyone who has reduced motion enabled on their system sees the first question standing still instead of the animation.

Chatbot Question is meant for home pages: a question is sent to the AI without a page reload and the answer appears right below it, sources included — like the search module, only without the Contao search results.

Ask for confirmation

All three modules have the option Ask for confirmation (default: off). When enabled, visitors first see a notice that they are talking to an AI and have to confirm it:

The confirmation is valid for the browser session and for all chatbot modules on the page. The text comes from the language files (consentText, consentButton in chatbot_widget).

Global settings

Defaults for all chat widgets are set under System → Settings. Every module can override them individually.

Setting Effect
Chatbot name Shown in the chat header
Accent colour Colour of the widget, as a hex value with colour picker
Icon (SVG) Replaces the default AI icon in the chat button
Default greeting Shown when the chat is opened for the first time
Default suggestions Suggested questions as pills above the input field
Hide "summarise content" pill Hides the summarise function
Hide privacy note Hides the "Private chats & Hosted in Germany" note
Offer voice input in the chat widget Default for the microphone, see Voice input; off by default

Automatic clean-up. Pages that are no longer published, excluded from the search or expired via their start/stop date do not belong in the AI index. Expiry by date happens without the record being saved and would otherwise go unnoticed. The interval is configurable: hourly, every 6 hours, daily (default) or weekly. The run hooks into Contao's own cron system – no server cronjob is required, it is enough that the website is visited regularly.

Debug files. Off by default. When enabled, the extension writes a JSON file to var/chatbot/ for every training and deletion operation. This is meant for troubleshooting, not for permanent operation: one crawler run produces a file per page including its full content, and nothing ever cleans them up.

Appearance

The chat widget, the question module and the search all ship with a finished design and pick up the accent colour from System → Settings (overridable per module in the widget): gradient header, pill-shaped input with a magnifier, answer card with source pills, result list as cards. The extension loads its own stylesheet; to style everything yourself, tick No default styling in the module.

Customise with CSS variables without touching the extension's file:

More variables: --chatbot-widget-bg, -surface, -bubble-bg, -text, -muted, -border, -bot-bubble, -gap, -z-index, -message-font-size.

Excluding pages from AI answers

Next to Exclude from search (Contao 5.6 and later: Search indexing) the page settings offer Exclude from AI answers. Both decide the same thing – whether a page serves as a source – but for two different searches, and they are independent of each other:

Contao full text search AI answers
Exclude from search no no
Exclude from AI answers yes no
both no no

A contact page can therefore appear in the full text search and still stay out of the chatbot answers – or the other way round.

The setting is inherited by all subpages. Ticking a section means the whole branch. On saving, the affected pages are removed from the knowledge base immediately, not only at the next clean-up run.

Excluding areas from the index

Two content elements delimit areas that should stay out of the search index:

These markers are deliberately ignored for the AI knowledge base, so that news lists and similar dynamic areas remain answerable. They apply to the classic Contao search.

Questions, answers and feedback

Voice input (microphone)

The chat widget can show a microphone button next to the send button. Visitors speak their question, the recording is converted to text and sent like a typed question – with answer, sources, feedback and history as usual.

Reviewing trained content

The back end module BlueBranch Chatbot → Trained pages shows what the knowledge base actually contains – per website, with title, URL, number of chunks, language and training date. Individual entries or the entire stock can be deleted there. The built-in test field lets you ask the chatbot a question and check the answer including its sources without opening the website.

Usage tiers

An account is Free, Pro or Expert. The tiers differ in the request quota of the answer routes – per minute and per calendar month –, in the number of projects and in the length of a voice recording; training content, listing content and creating API keys is unlimited in every tier. Pro and Expert are booked by the account owner as a monthly subscription through Stripe in the chatbot frontend (https://chatbot.bluebranch.de) – this extension has no payment path.

The actual numbers deliberately do not live in this extension. They come from the API at runtime, together with a ready-made note. If the quota changes, the display changes with it – no new release of the extension required. The current tier and this month's usage are shown under BlueBranch Chatbot → Trained pages at the top of the page.

Once the quota is exhausted, the API answers with HTTP 429 and names the cause in reason. Visitors then see a neutral message: try again shortly after the per-minute limit (rate_limit), try again later once the monthly quota is used up (monthly_quota). The detailed reason including the tier goes to the log of the Contao installation, not into the chat window.

Paused projects. After a downgrade (e.g. a cancelled subscription) all projects are kept, surplus ones are paused. The API answers for them with HTTP 403 and reason: project_paused; visitors read "The chat is currently unavailable". The account owner picks the active projects in the chatbot frontend.

How the requests work

The browser only ever calls Contao routes, which in turn talk to the API:

Route Purpose
/bluebranch/chatbot/api/v1/chat/stream Answer in chat mode (short, fast)
/bluebranch/chatbot/api/v1/generate/stream Answer in search mode (detailed)
/bluebranch/chatbot/api/v1/generate/search Answer without streaming

All three require a session token. The modules only fetch it with the first question via POST /bluebranch/chatbot/api/v1/token, so pages with a chatbot need no session and stay in the HTTP cache. Question and token are sent via POST in the body and header, not in the URL. Answers come back as server-sent events: first a sources event listing the pages used, then the answer in chunks, and finally an end event.

When running behind a reverse proxy, buffering has to be switched off for these routes (proxy_buffering off for nginx) – otherwise the answer arrives in one piece and the streaming effect is lost.

Updating

After installing a new release, two steps are required, otherwise nothing changes:

  1. System maintenance → Purge the application cache
  2. System maintenance → Update database

On the command line:

Without step 1 it looks as if nothing arrived. Contao compiles its service container into var/cache/prod/ and only reads it from then on. A freshly uploaded class simply does not exist for the application: its callbacks are not registered, fields still look the way they did – and there is no error message, because as far as Contao is concerned everything is fine.

php vendor/bin/contao-console debug:container ApiKeyFieldListener --env=prod shows whether a class arrived – the Tags line has to mention contao.callback.

Run the commands as the web server user, usually www-data. Started as root, the newly created cache directory ends up owned by root, the web server can no longer write to it, and the website answers with 500 only – without an entry in the application log, because the error happens before the framework. This cannot go wrong via the Contao Manager.

Older versions and customised templates

The extension runs with Contao 4.13 and 5.x (PHP 8.0 or newer). An update stays functional even if a step is missing: while the new database fields are not there yet (before Update database), the pages render normally; the new switches just cannot be saved before the migration.

Your own copies of the templates under templates/mod_chatbot_*.html5 replace the extension's and are not carried along by an update. The code stays backwards compatible with them (tested against the templates of 1.3.0, 1.4.1 and 1.5.1):

Template comes from Behaviour with the current extension
1.5.x works; question module and search without microphone button
1.3.x and 1.4.x works; without microphone button, without the new design (question and search), widget text can end up in the search index
older than 1.3.0 chat does not answer ("Please reload the page"): the page/module signature is missing, mandatory since 1.3.0

BlueBranch Chatbot → Getting started checks the project templates and names the outdated ones and what they lack; a missing signature also leaves an error in the application log. Simplest: delete your copy (the extension's template applies then) or copy it again from vendor/bluebranch/chatbot/src/Resources/contao/templates/ and re-apply your changes.

Data protection and hosting

Benefits for editors and developers

Vielen Dank

Unser Team dankt für die Unterstützung und das Benutzen vom BlueBranch Chatbot.

Das Team von www.bluebranch.de

<3

Lizenz

MIT – siehe LICENSE.txt.

Changes

1.9.1 - 2026-11-11

1.9.0 - 2026-11-11

1.8.6 - 2026-10-31

1.8.5 - 2026-10-30

1.8.4 - 2026-10-30

1.8.3 - 2026-10-30

1.8.2 - 2026-10-30

1.8.1 - 2026-10-30

1.8.0 - 2026-10-29

1.7.0 - 2026-10-29

1.6.0 - 2026-10-29

1.5.1 - 2026-10-29

1.5.0 - 2026-10-29

1.4.1 - 2026-10-12

1.4.0 - 2026-10-12

1.3.0 - 2026-10-06

1.2.4 - 2026-09-29

1.2.3 - 2026-09-29

1.2.2 - 2026-09-17

1.2.1 - 2026-09-16

1.2.0 - 2026-09-16

1.1.1 - 2026-09-02

1.1.0 - 2026-09-02

1.0.2 - 2026-09-02

1.0.1 - 2026-09-02

1.0.0 - 2026-09-02


All versions of chatbot with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
contao/core-bundle Version ^4.13 || ^5.0
league/html-to-markdown Version ^5.0
symfony/http-client Version ^5.4 || ^6.0 || ^7.0
smalot/pdfparser Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bluebranch/chatbot contains the following files

Loading the files please wait ...