
I built a CLI tool that lets your AI agents improve your query performance in a loop
Hey there everyone.
When working with libraries like Filament, a lot of the queries are not explicit in code as only Model classes are passed around. This makes debugging and improving query performance more difficult. Existing debugging tools like Debugbar or Telescope work require a browser UI and aren't very accessible to coding agents.
I built LaraPerf.dev because I wanted to let my agents run in a loop and continue trying to find query speed improvements.
The tool is optimized for having an agent call it as a tool call.
The agent calls `artisan perf:watch --seconds 20` which will listens to all queries for 20 seconds. However, the command immediately exits to let the agent do more actions within those 20 seconds. The agent can then query through all query results with the `perf:query` command to find slow or N+1 queries and with `perf:explain` to run `EXPLAIN ANALYZE` for a given query.
It also comes with a premade skill to let your agent run in a loop.
Find it at https://laraperf.dev or checkout the code at https://github.com/mateffy/laraperf