Download the PHP package blunx/ai without Composer
On this page you can find all versions of the php package blunx/ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ai
Blunx AI
Business Intelligence AI Agent for Laravel.
Ask questions in natural language, get SQL, charts, tables and automated insights — directly from your database.
About
Blunx AI turns your Laravel database into a conversational business intelligence tool.
- Users ask questions in natural language.
- Blunx generates and executes read-only SQL against your database.
- The answer comes back as a rich interface: charts, tables, and a written summary.
- Optionally, widgets can be monitored automatically and produce scheduled insights with PDF reports and email notifications.
All AI processing happens on the BlunxAI cloud through a secure proxy — your LLM API keys are never exposed to your users, and your database is never called directly by the AI.
Features
- 🧠 Natural language → SQL → results pipeline (Server-Sent Events streaming)
- 🔒 Defense in depth: read-only database role +
SqlGuardvalidation of every query - 🛡️ Role-based access control (forbidden tables, columns, and row-level filtering)
- 📊 Conversations, dashboards and widgets (chart / table) stored locally
- 📈 Automated insights with severity scoring, PDF generation and email alerts
- 🗄️ MySQL, PostgreSQL, SQLite and SQL Server schema scanning
- 🌍 French and English localization
Requirements
- PHP 8.1+
- Laravel 10 / 11
- A BlunxAI account (application API key)
Installation
Laravel auto-discovers the package. Then publish the configuration:
Configuration
Set the following environment variables in your .env:
Security: the queries executed by Blunx are always read-only. Configure a database user with only
SELECT/USAGEprivileges — this is the primary lock;SqlGuardis the second one.
Access rules
Publish config/blunx_access.php and define, per role, what is forbidden:
USER_ID is replaced at runtime with the authenticated user's ID.
Usage
1. Initialize the schema
Scan your database and generate the enriched schema (sent to Blunx for enrichment):
Review and complete the generated storage/app/blunx_schema.json, then:
This creates the blunx_* tables and locks the schema.
2. API routes
The package exposes an authenticated REST API under /api/blunx:
| Method | Endpoint | Description |
|---|---|---|
| GET / POST | /api/blunx/conversations |
List / create conversations |
| GET | /api/blunx/conversations/{uuid}/messages |
Conversation messages |
| POST | /api/blunx/messages |
Save a message |
| POST | /api/blunx/stream |
Ask a question (SSE streaming) |
| GET / POST | /api/blunx/dashboards |
List / create dashboards |
| POST | /api/blunx/widgets |
Create a widget |
| POST | /api/blunx/widgets/{uuid}/execute |
Run a widget query |
| GET | /api/blunx/insights/{dashUuid} |
Dashboard insights |
| POST | /api/blunx/insight-settings |
Configure scheduled insights |
| POST | /api/blunx/feedback |
Submit user feedback |
All routes require an authenticated session (the blunx middleware group uses your app's auth guard) and are rate-limited.
3. Scheduled insights
The package registers an hourly scheduler that runs due insights:
Insights with a high enough priority trigger an email containing a PDF report. You can also run due insights manually:
Artisan commands
| Command | Description |
|---|---|
php artisan blunx:init |
Scan the database and generate the schema |
php artisan blunx:edit |
Edit the schema or re-index it differentially |
php artisan blunx:setup |
Create the Blunx tables and lock the schema |
php artisan blunx:feedback |
Review unresolved user feedback |
php artisan blunx:run-insights |
Run due insight jobs now |
How it works
The client never talks to the AI directly — every call goes through the local Blunx proxy, so API keys stay server-side.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details on the development workflow and the CODE OF CONDUCT for the expected community standards.
Security
If you discover a security vulnerability, please follow the disclosure procedure described in SECURITY.md. Please do not open a public issue for security problems.
License
Blunx AI is open-sourced software licensed under the MIT license.