PHPackages                             elliottlawson/converse - 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. elliottlawson/converse

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

elliottlawson/converse
======================

A Laravel package for storing and managing AI conversation history in your applications

v0.2.0(11mo ago)43.0k↓46.4%[2 issues](https://github.com/elliottlawson/converse/issues)1MITPHPPHP ^8.2CI passing

Since Jun 13Pushed 11mo agoCompare

[ Source](https://github.com/elliottlawson/converse)[ Packagist](https://packagist.org/packages/elliottlawson/converse)[ RSS](/packages/elliottlawson-converse/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (9)Used By (1)

 [![Converse Logo](converse-logo.png)](converse-logo.png)

 [![Tests](https://github.com/elliottlawson/converse/actions/workflows/tests.yml/badge.svg)](https://github.com/elliottlawson/converse/actions/workflows/tests.yml) [![Latest Stable Version](https://camo.githubusercontent.com/3ad8aabac30417c99a7fc579156e3286168b9169bc28e965b2a20c5d9344def6/68747470733a2f2f706f7365722e707567782e6f72672f656c6c696f74746c6177736f6e2f636f6e76657273652f762f737461626c65)](https://packagist.org/packages/elliottlawson/converse) [![Total Downloads](https://camo.githubusercontent.com/0ab5b2f51e6bac26a5fc87c2cf45d85591d43f2ee375825ba929e0a7b7f6851e/68747470733a2f2f706f7365722e707567782e6f72672f656c6c696f74746c6177736f6e2f636f6e76657273652f646f776e6c6f616473)](https://packagist.org/packages/elliottlawson/converse) [![License](https://camo.githubusercontent.com/75c6a7b10a54e86d90887cf85f05251c09c5a4ad5728d41166baecd840f9446c/68747470733a2f2f706f7365722e707567782e6f72672f656c6c696f74746c6177736f6e2f636f6e76657273652f6c6963656e7365)](https://packagist.org/packages/elliottlawson/converse)

Converse - AI Conversation Management for Laravel
=================================================

[](#converse---ai-conversation-management-for-laravel)

**AI SDKs are great at sending messages, but terrible at having conversations.**

Converse makes AI conversations flow as naturally as Eloquent makes database queries. Instead of manually managing message arrays and context for every API call, you just write `$conversation->addUserMessage('Hello')`. The entire conversation history, context management, and message formatting is handled automatically.

📚 Documentation
---------------

[](#-documentation)

**[View the full documentation](https://converse-php.netlify.app)** - Comprehensive guides, API reference, and examples.

The Difference
--------------

[](#the-difference)

Without Converse, every API call means manually rebuilding context:

```
// Manually track every message 😫
$messages = [
    ['role' => 'system', 'content' => $systemPrompt],
    ['role' => 'user', 'content' => $oldMessage1],
    ['role' => 'assistant', 'content' => $oldResponse1],
    ['role' => 'user', 'content' => $oldMessage2],
    ['role' => 'assistant', 'content' => $oldResponse2],
    ['role' => 'user', 'content' => $newMessage],
];

// Send to API
$response = $client->chat()->create(['messages' => $messages]);

// Now figure out how to save everything...
```

With Converse, conversations just flow:

```
// Context is automatic ✨
$conversation->addUserMessage($newMessage);

// Your AI call gets the full context
$response = $aiClient->chat([
    'messages' => $conversation->messages->toArray()
]);

// Store the response
$conversation->addAssistantMessage($response->content);
```

That's it. **It's the difference between sending messages and actually having a conversation.**

Features
--------

[](#features)

- 💾 **Database-Backed Persistence** - Conversations survive page reloads and server restarts
- 🔌 **Provider Agnostic** - Works with OpenAI, Anthropic, Google, or any LLM
- 🌊 **Streaming Made Simple** - Automatic message chunking and progress tracking
- 🧠 **Automatic Context Management** - Stop rebuilding message arrays for every API call
- 📡 **Built-in Events** - Track usage, build analytics, react to AI interactions
- 🏗️ **Laravel Native** - Built with Eloquent, events, and broadcasting

Installation
------------

[](#installation)

```
composer require elliottlawson/converse
```

Run the migrations:

```
php artisan migrate
```

Quick Start
-----------

[](#quick-start)

Add the trait to your User model:

```
use ElliottLawson\Converse\Traits\HasAIConversations;

class User extends Model
{
    use HasAIConversations;
}
```

Start having conversations:

```
// Build the conversation context
$conversation = $user->startConversation(['title' => 'My Chat'])
    ->addSystemMessage('You are a helpful assistant')
    ->addUserMessage('Hello! What is Laravel?');

// Make your API call to OpenAI, Anthropic, etc.
$response = $yourAiClient->chat([
    'messages' => $conversation->messages->toArray(),
    // ... other AI configuration
]);

// Store the AI's response
$conversation->addAssistantMessage($response->content);
```

Looking for an AI Client?
-------------------------

[](#looking-for-an-ai-client)

Using [Prism](https://github.com/prism-php/prism)? Try out [Converse-Prism](https://github.com/elliottlawson/converse-prism) - a seamless integration that combines Prism's elegant AI client with Converse's conversation management.

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

[](#requirements)

- PHP 8.2+
- Laravel 11+

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance42

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

7

Last Release

338d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6254cce9312896ac7e2d54852a67745f163aef7284adc749222dbff0f06c37f2?d=identicon)[elliottlawson](/maintainers/elliottlawson)

---

Top Contributors

[![elliottlawson](https://avatars.githubusercontent.com/u/3441829?v=4)](https://github.com/elliottlawson "elliottlawson (24 commits)")

---

Tags

aiconversionlaravelllmlaravelaistreamingchatllmconversations

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elliottlawson-converse/health.svg)

```
[![Health](https://phpackages.com/badges/elliottlawson-converse/health.svg)](https://phpackages.com/packages/elliottlawson-converse)
```

###  Alternatives

[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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