m-tech-stack/laravel-ai-engine
Laravel AI Engine provides a clean, configurable layer for adding AI features to Laravel apps, with a unified API for providers, prompt and chat workflows, embeddings, and tool calling—keeping AI logic testable and maintainable.
AgentTool/SimpleAgentTool and model CRUD can be generated declaratively via AiResource::for(Model::class)->search()->writable()->register(), the cost of a first "ask your data" or "create a record by chatting" surface drops from a platform project to a feature ticket. That changes what belongs on the roadmap this half.data_query/aggregate_data analytics assistant, (3) write actions behind confirmation + ResolvesAgentRelations, (4) RAG over knowledge/content, (5) domain sub-agents with scoped toolsets, (6) file intake with prefill for structured forms, (7) media (image/video/voice). Each rung is independently shippable and independently valuable, which is exactly what a roadmap wants.CreditManager (hasCredits/deductCredits/calculateCredits), InsufficientCreditsException, and per-model credit_index turn "AI usage" into a metered, priceable SKU with per-model cost differentiation — feeding pricing-page and plan-tier decisions rather than a flat "AI included" promise.AIScopeResolver and scope_columns (user_id/workspace_id/tenant_id) flowing into data query, RAG, vector search, and memory is the difference between a single-tenant demo and a sellable enterprise SKU. It also removes the most common security objection from a security review.engines config with per-engine keys, fallback_engines, keyless-engine skipping, and ai:doctor diagnostics mean the product is not wired to one model vendor. That derisks margin exposure to a single provider's price change and enables "best model per task" (cheap model for classification, frontier model for the planner).laravel-ai-engine-federation), Neo4j hybrid graph RAG, realtime voice, and the model council are all opt-in. Their presence lets you confidently say "not now" on each without the answer being "we'd have to rebuild the architecture."Consider it when:
generate() call would do, this is over-engineering.Look elsewhere or build in-house when:
Evaluation gate before committing: a two-week, time-boxed spike with explicit exit criteria — one real domain agent, one data_query path against a scoped non-public model, one file-intake pre-fill flow, mocked-AIEngineService tests in CI, ai:doctor green on two providers with failover triggered deliberately, and a measured cost-per-action. Decide on evidence, not on the capability list.
To executives (one paragraph): We have an opportunity to ship an AI assistant and AI-assisted data entry on top of our existing Laravel product in feature-ticket time rather than as a multi-quarter platform build. An MIT-licensed package already covers the unglamorous 80% — multi-provider failover, secure tenant-scoped data access, retrieval over our own content, conversation memory, per-user credit metering, and tracing. It is free to use and free to modify, so there is no licensing cost and no lock-in to a model vendor or to the package author: if the project stalls, we keep the code. The real cost is not the license — it is engineering ownership, because the package is early (essentially no public adoption) and we would be its first serious production user. Recommendation: fund a two-week spike with hard success criteria, then commit, fork-and-harden, or walk away with a reusable design we can implement ourselves.
To engineering: Treat this as a source-available accelerator to be forked and pinned, not a dependency to trust blindly. Adopt its architecture — tools as the unit of action, skills orchestrating tools, a planner scoped to a declared toolset, fail-closed scoping, config-gated surfaces — because those choices are correct and expensive to rediscover. Mitigate maturity risk concretely: pin a version and vendor the code, read src/ before relying on any API (the skill doc itself instructs this), keep CI free of live LLM calls by mocking AIEngineService, and run ai:doctor in your deploy checks. Prioritize the boring, high-value paths first — data_query/aggregate_data, AiResource CRUD tools, ResolvesAgentRelations, embeddings via VectorSearchService — and defer the exotic surfaces (video, realtime voice, Neo4j graph RAG, federation, model council) until a product decision demands them. Note two documented sharp edges worth designing around early: domain sub-agents run skill-free by design, and a domain agent returning zero rows is usually missing 'public' => true or an incorrect scope, not a planner failure. Budget roughly half an engineer for a quarter to own the fork, harden tests, and establish an upgrade path.
How can I help you explore Laravel packages today?