qiick / laravel-ai-conversations
Organisation-scoped conversation memory and privacy lifecycle for the Laravel AI SDK.
Package info
github.com/qiick-io/laravel-ai-conversations
pkg:composer/qiick/laravel-ai-conversations
Requires
- php: ^8.4
- illuminate/console: ^12.0 || ^13.0
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- laravel/ai: ^1.4.2
Requires (Dev)
- larastan/larastan: ^3.3
- laravel/pint: ^1.30
- nunomaduro/collision: ^8.5
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-mutate: ^4.0
- phpstan/phpstan: ^2.1
- qiick/laravel-access: dev-develop
Suggests
- qiick/laravel-access: Resolves the verified actor and their active organisation.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-03 19:08:13 UTC
README
Organisation-scoped conversation memory for the Laravel AI SDK. The package keeps the SDK's conversation and message tables and adds one context row per conversation. It resolves the owner and active organisation on each access, including queued turns and tool approvals.
Installation
The first release is planned as 0.1.0-beta. The package supports PHP 8.4 and 8.5, Laravel 12 and 13, and Laravel AI SDK 1.4.2 or later in the 1.x line.
- Publish and run the SDK migrations using the application's normal deployment process. Install the package and migrate its context table. Configure an optional same-connection organisation FK before the first migration.
- With Laravel Access, set the verified web actor and team before calling an agent. If the application has additional membership or permissions checks, bind its own ConversationPolicyContract adapter.
- For direct UI queries, use ConversationAccessService::visibleTo() or find(). Pass the resolved SDK ID to the SDK. Use the context's UUIDv7 as the public ID in new application contracts.
- Wrap complete turns in ConversationTurnService with a shared lock store and a lease covering provider, tool and persistence timeouts. Queue handlers must reconstruct and revalidate the verified organisation and actor first.
- Register ConversationExporterService and AiConversationsEraser with the application's personal-data orchestration. Before erasure, deactivate the subject under the same account lock the write policy uses.
Set AI_CONVERSATIONS_RETENTION_DAYS to a positive integer to enable daily pruning. The default is null. Preview the count with php artisan ai-conversations:prune --dry-run. The scheduler requires a shared cache when running on several hosts.
Applications with an existing compatible context table should disable the package migration in their committed configuration. See UPGRADING.md for existing data and rollback.
CI uses PHPStan max for PHP static analysis.
Documentation
Licensed under MIT.