Rekhu Assistant reads your app and proposes what it may do
rekhu/assistant-laravel 0.10.0 scans your routes, proposes the assistant's actions in a file you decide, drafts the project's knowledge, and tests real questions.
An assistant inside your app is only as good as the actions it may use. Until now you marked every one of them in the code, one controller method at a time. In a large app that took days before the assistant could do anything useful.
With rekhu/assistant-laravel 0.10.0, Rekhu writes the first version for you.
One command reads the app
php artisan rekhu:assistant:scan
Rekhu reads your routes, the inputs they validate and the code of their controllers. It never reads your records. For every route it proposes:
- whether the assistant should offer it;
- a description of what it does and what it returns;
- whether the user has to click to confirm it;
- what each input means, and which fields of a result are worth reading.
Sign-in, admin and webhook routes are proposed off, with the reason why.
Everything lands in one file in your app, assistant/actions.php, and everything starts off. You switch on what the assistant may do and commit the file, like any other code.
The file stays yours
- A new scan only adds routes it has not seen yet, switched off, so a scan after a change costs little.
- It never changes an entry you edited, and it marks routes that are gone instead of removing them.
- A route you marked in the code with
#[Tool]stays in the code: the code wins. - The file only decides what the assistant may offer. Every action still runs as the signed-in user, through your own middleware, policies and validation, and deleting always needs the user's click.
Each scan is kept in your Rekhu account per environment, so a lost file comes back with --restore. The Assistant tab shows how many actions each environment offers.
Knowledge that waits for you
The scan also drafts the project's knowledge: what the app is, the words of its trade, its rules. The draft waits on the project's Assistant tab, where you add it to what is there, replace it, or discard it. Nothing is written over your knowledge without you.
Test with real questions
The scan writes a question a user would ask for each action. Run:
php artisan rekhu:assistant:test --user=12
It asks each question as that user, exactly as the chat does, and shows which ones used the right action. When one doesn't, the description of that action needs a clearer word about when to use it. rekhu:assistant:check now also checks the file: entries without a route, an action defined twice, and deleting without a click.
Update with composer update rekhu/assistant-laravel. A scan is a few model calls, charged to the project like the assistant's own.