PHPackages                             kauffinger/agentic-chat-bubble - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kauffinger/agentic-chat-bubble

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kauffinger/agentic-chat-bubble
==============================

v0.3.1(8mo ago)13.5k↓50%1[7 PRs](https://github.com/kauffinger/agentic-chat-bubble/pulls)PHPCI passing

Since Jul 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/kauffinger/agentic-chat-bubble)[ Packagist](https://packagist.org/packages/kauffinger/agentic-chat-bubble)[ RSS](/packages/kauffinger-agentic-chat-bubble/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (9)Versions (21)Used By (0)

Agentic Chat Bubble
===================

[](#agentic-chat-bubble)

> An AI-powered chat bubble for Statamic that provides intelligent assistance with site content using Prism AI and Statamic search integration.

Features
--------

[](#features)

This addon provides:

- **AI-powered chat bubble** with streaming responses
- **Statamic search integration** via AI tools for content assistance
- **Markdown rendering** with syntax highlighting
- **Expandable thinking process** display
- **Mobile-responsive design** with floating chat window
- **Tool execution tracking** for transparency

How to Install
--------------

[](#how-to-install)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require kauffinger/agentic-chat-bubble
```

### 2. Frontend Integration

[](#2-frontend-integration)

Add the chat bubble component to your layout template:

```

{{ nocache }}
    {{ livewire:agentic-chat-bubble }}
{{ /nocache }}
```

**Important**: The Livewire component must be wrapped in a `{{ nocache }}` tag to ensure proper functionality with Statamic's static caching. This prevents the component from being cached and ensures it remains interactive.

### 3. Install Required NPM Dependencies

[](#3-install-required-npm-dependencies)

The addon requires two JavaScript libraries for markdown processing and syntax highlighting. Install them in your main application:

```
npm install markdown-it highlight.js
```

### 4. Import JavaScript Component

[](#4-import-javascript-component)

Import and register the `markdownProcessor` component in your main JavaScript file:

```
// In resources/js/site.js
import markdownProcessor from '../../vendor/kauffinger/agentic-chat-bubble/resources/js/components/markdownProcessor.js';

// Register with Alpine.js
Alpine.data('markdownProcessor', markdownProcessor);
```

### 5. Import CSS Styles

[](#5-import-css-styles)

The addon's styles need to be imported into your application's CSS:

#### For Statamic Peak users:

[](#for-statamic-peak-users)

```
/* In resources/css/peak.css */
@import '../../vendor/kauffinger/agentic-chat-bubble/resources/css/addon.css';
```

#### For other setups:

[](#for-other-setups)

```
/* In your main CSS file (e.g., resources/css/app.css or site.css) */
@import '../../vendor/kauffinger/agentic-chat-bubble/resources/css/addon.css';
```

**Important**: Make sure your Tailwind configuration scans the addon's views for classes:

```
// In tailwind.config.js
module.exports = {
  content: [
    // ... your existing paths
    './vendor/kauffinger/agentic-chat-bubble/resources/views/**/*.blade.php',
  ],
  // ... rest of config
};
```

After adding the imports and updating Tailwind config, rebuild your assets:

```
npm run build
```

### 6. Publish Configuration (Optional)

[](#6-publish-configuration-optional)

To customize the addon settings, publish the config file:

```
php artisan vendor:publish --tag="agentic-chat-bubble-config"
```

This will create `config/agentic-chat-bubble.php` where you can configure:

- AI provider and model
- System prompt
- UI settings
- Max message length and other limits

### 7. Other Dependencies

[](#7-other-dependencies)

Ensure your application has the following dependencies (likely already installed):

- Livewire
- Alpine.js with collapse plugin
- Prism AI package for chat functionality

Configuration
-------------

[](#configuration)

After publishing the config file, you can customize:

### AI Settings

[](#ai-settings)

```
'provider' => env('AGENTIC_CHAT_PROVIDER', 'openai'), // openai, anthropic, google, ollama
'model' => env('AGENTIC_CHAT_MODEL', 'gpt-4-mini'),
'system_prompt' => env('AGENTIC_CHAT_SYSTEM_PROMPT', '...'),
'max_steps' => env('AGENTIC_CHAT_MAX_STEPS', 5),
```

### UI Settings

[](#ui-settings)

```
'ui' => [
    'position' => 'bottom-left', // bottom-left, bottom-right
    'thinking_button_text' => '🧠',
    'thinking_prose_size' => 'prose-sm',
],
```

### Customizing UI Text

[](#customizing-ui-text)

All UI text (titles, placeholders, messages) is managed through Laravel's translation system. To customize these texts:

1. **Publish the language files**:

```
php artisan vendor:publish --tag="agentic-chat-bubble-lang"
```

2. **Edit the published translation file** at `resources/lang/vendor/agentic-chat-bubble/en/chat-bubble.php`:

```
return [
    'title' => 'Assistant',
    'placeholder' => 'Type your message...',
    'send' => 'Send',
    // ... other translations
];
```

3. **For other languages**, create additional translation files in the appropriate language directory (e.g., `resources/lang/vendor/agentic-chat-bubble/de/chat-bubble.php` for German).

### GDPR Compliance

[](#gdpr-compliance)

The addon includes built-in GDPR compliance features that require user consent before sending messages to AI providers.

#### Configuration

[](#configuration-1)

Enable GDPR mode by setting `enabled` to `true` in the config file:

```
'gdpr' => [
    'enabled' => env('AGENTIC_CHAT_GDPR_ENABLED', false),
    'consent_text' => 'This chat uses AI services to process your messages. Your messages will be sent to our AI provider for processing. Do you consent to this data processing?',
    'consent_button_text' => 'I Consent',
    'decline_button_text' => 'No Thanks',
    'declined_message' => 'You need to provide consent to use the chat assistant. You can close this window and reopen it if you change your mind.',
],
```

#### Customizing Consent Messages

[](#customizing-consent-messages)

All GDPR-related text is managed through Laravel's translation system. To customize these messages:

1. **Publish the language files** (if not already done):

```
php artisan vendor:publish --tag="agentic-chat-bubble-lang"
```

2. **Edit the consent-related translations** in `resources/lang/vendor/agentic-chat-bubble/en/chat-bubble.php`:

```
return [
    // ... other translations
    'privacy_notice' => 'Privacy Notice',
    'consent_text' => 'We process your messages to provide assistance. Your data will be handled according to our privacy policy.',
    'consent_button' => 'I Consent',
    'decline_button' => 'No Thanks',
    'declined_message' => 'You have declined consent. Chat functionality is disabled.',
    'chat_disabled' => 'Chat is disabled without consent',
    'reconsider_consent' => 'Reconsider consent',
];
```

The GDPR feature itself is still enabled/disabled via the config file:

```
'gdpr' => [
    'enabled' => env('AGENTIC_CHAT_GDPR_ENABLED', false),
],
```

#### How It Works

[](#how-it-works)

When GDPR mode is enabled:

1. **First Message**: Users see a consent modal when they try to send their first message
2. **Consent Given**: Users can chat normally after giving consent
3. **Consent Declined**: Chat is disabled, but users can reconsider their decision at any time
4. **Session Persistence**: Consent choice is stored in the session and persists until the session expires

The consent modal clearly explains that messages will be sent to AI providers for processing, ensuring transparency and compliance with data protection regulations.

### Rate Limiting

[](#rate-limiting)

Configure rate limiting to prevent abuse:

```
'rate_limit' => [
    'enabled' => env('AGENTIC_CHAT_RATE_LIMIT_ENABLED', true),
    'max_messages' => env('AGENTIC_CHAT_RATE_LIMIT_MAX', 30),
    'decay_minutes' => env('AGENTIC_CHAT_RATE_LIMIT_DECAY', 1),
],
```

### Custom Tools

[](#custom-tools)

Register custom AI tools that extend the assistant's capabilities:

```
'tools' => [
    // Default tools (Statamic search)
    \Kauffinger\AgenticChatBubble\Tools\GetAvailableStatamicIndexesTool::class,
    \Kauffinger\AgenticChatBubble\Tools\StatamicSearchTool::class,

    // Add your custom tools
    \App\Tools\WeatherTool::class,
    \App\Tools\DatabaseQueryTool::class,

    // Tools with dependencies via closure
    fn() => new \App\Tools\ApiTool(config('services.api_key')),
]
```

#### Creating Custom Tools

[](#creating-custom-tools)

Custom tools must implement the `Prism\Prism\Tool` interface:

```
namespace App\Tools;

use Prism\Prism\Tool;

class WeatherTool extends Tool
{
    public function __construct()
    {
        $this
            ->as('get_weather')
            ->for('Get current weather for a location')
            ->withStringParameter('location', 'City name or coordinates')
            ->using($this);
    }

    public function __invoke(string $location): string
    {
        // Your tool logic here
        return "The weather in {$location} is sunny and 72°F";
    }
}
```

#### Dynamic Tool Registration

[](#dynamic-tool-registration)

You can also register tools programmatically in your AppServiceProvider or any service provider:

```
use Kauffinger\AgenticChatBubble\ServiceProvider as ChatBubbleServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        // Register a single tool
        ChatBubbleServiceProvider::registerTool(\App\Tools\WeatherTool::class);

        // Register multiple tools
        ChatBubbleServiceProvider::registerTools([
            \App\Tools\DatabaseTool::class,
            fn() => new \App\Tools\ApiTool($this->app['api.client']),
        ]);

        // Conditionally register tools
        if (config('services.weather.enabled')) {
            ChatBubbleServiceProvider::registerTool(\App\Tools\WeatherTool::class);
        }
    }
}
```

This is useful for:

- Conditional tool registration based on environment or config
- Registering tools from other packages
- Tools that require complex initialization logic

Usage
-----

[](#usage)

Once installed, users will see a floating chat bubble in the bottom-left corner that provides:

- Content search across your Statamic site
- AI-powered answers based on your site's content
- Streaming responses with real-time tool usage display
- Expandable "thinking" process for transparency

Requirements
------------

[](#requirements)

- Statamic 5.0+
- Prism AI package configured with OpenAI
- Alpine.js and Livewire for frontend functionality

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance76

Regular maintenance activity

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

6

Last Release

252d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0e9a29e1307758a7b7ebb40231f8fbf69522d6fa2b125652d1e8dc48c9f38c7?d=identicon)[kauffinger](/maintainers/kauffinger)

---

Top Contributors

[![kauffinger](https://avatars.githubusercontent.com/u/62616071?v=4)](https://github.com/kauffinger "kauffinger (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/kauffinger-agentic-chat-bubble/health.svg)

```
[![Health](https://phpackages.com/badges/kauffinger-agentic-chat-bubble/health.svg)](https://phpackages.com/packages/kauffinger-agentic-chat-bubble)
```

###  Alternatives

[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2912.8k](/packages/aerni-livewire-forms)[jacksleight/statamic-bard-texstyle

17172.5k](/packages/jacksleight-statamic-bard-texstyle)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)[alt-design/alt-sitemap

Alt Sitemap addon, create a sitemap from Statamic entries

1219.0k](/packages/alt-design-alt-sitemap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
