<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kavita Systems</title>
    <description>The latest articles on DEV Community by Kavita Systems (kavitasystems).</description>
    <link>https://dev.to/kavitasystems</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F13776%2F651ded87-9345-4364-aa12-7c8cbc283236.jpg</url>
      <title>DEV Community: Kavita Systems</title>
      <link>https://dev.to/kavitasystems</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kavitasystems"/>
    <language>en</language>
    <item>
      <title>Modernizing Legacy Laravel Apps with Figma Agents, and Smarter Tests</title>
      <dc:creator>VitaliiK</dc:creator>
      <pubDate>Thu, 25 Jun 2026 13:36:32 +0000</pubDate>
      <link>https://dev.to/kavitasystems/ai-wont-just-build-the-next-app-it-will-rebuild-the-old-ones-1jjf</link>
      <guid>https://dev.to/kavitasystems/ai-wont-just-build-the-next-app-it-will-rebuild-the-old-ones-1jjf</guid>
      <description>&lt;p&gt;
  The biggest AI opportunity in web development might not be the next shiny app.
&lt;/p&gt;

&lt;p&gt;
  It might be the old one your company is afraid to touch.
&lt;/p&gt;

&lt;p&gt;
  Every day, businesses run on software that still works but no longer feels modern: old admin panels, internal CRMs, Laravel dashboards built years ago, Blade views nobody wants to refactor, reporting tools with confusing filters, support screens with too many columns, and customer portals that still make money but slow down every new feature.
&lt;/p&gt;

&lt;p&gt;
  That is where things get interesting.
&lt;/p&gt;

&lt;p&gt;
  Most AI conversations focus on building something new from scratch. A founder has an idea, generates a prototype, writes code with an AI assistant, connects a model API, and launches an MVP.
&lt;/p&gt;

&lt;p&gt;
  That is a real use case, and it matters.
&lt;/p&gt;

&lt;p&gt;
  But most software work does not start with a blank repository. It starts with an existing product, existing users, existing data, existing bugs, existing business rules, and years of decisions that made sense at the time.
&lt;/p&gt;

&lt;p&gt;
  AI is not just a startup accelerator.
&lt;/p&gt;

&lt;p&gt;
  It is becoming a modernization engine.
&lt;/p&gt;

&lt;p&gt;
  The next wave of AI in web development will not only be about launching new products faster. It will also be about upgrading the products companies already depend on.
&lt;/p&gt;

&lt;h2&gt;The real opportunity is not another chatbot&lt;/h2&gt;

&lt;p&gt;
  A lot of “AI-powered” products follow the same pattern: take an existing app, add a chat window, and call it innovation.
&lt;/p&gt;

&lt;p&gt;
  That is not enough.
&lt;/p&gt;

&lt;p&gt;
  A support dashboard does not need a chatbot in the corner. It needs ticket summaries, priority detection, suggested replies, and better routing.
&lt;/p&gt;

&lt;p&gt;
  A CRM does not need a generic assistant. It needs account summaries, follow-up suggestions, risk signals, and smarter search.
&lt;/p&gt;

&lt;p&gt;
  An accounting tool does not need AI decoration. It needs invoice classification, document extraction, anomaly detection, and review workflows.
&lt;/p&gt;

&lt;p&gt;
  The best AI features do not feel like separate products. They feel like the existing product got smarter.
&lt;/p&gt;

&lt;blockquote&gt;
  AI should not sit next to the product. AI should make the product better.
&lt;/blockquote&gt;

&lt;p&gt;
  That is the key difference.
&lt;/p&gt;

&lt;p&gt;
  AI should remove friction from the workflow people already use every day. It should reduce repetitive work, surface useful context, help users make decisions faster, and keep humans in control where judgment matters.
&lt;/p&gt;

&lt;h2&gt;There are two AI development paths now&lt;/h2&gt;

&lt;p&gt;
  AI is changing product development in two very different ways.
&lt;/p&gt;

&lt;p&gt;
  The first path is &lt;strong&gt;greenfield development&lt;/strong&gt;. This is the startup path. You begin with an idea, write a product brief, explore the interface in Figma, create a functional prototype, validate the flow with users, then build the real application with Laravel, an AI coding agent, and the Laravel AI SDK.
&lt;/p&gt;

&lt;p&gt;
  This is powerful because the cost of going from idea to working product has dropped dramatically.
&lt;/p&gt;

&lt;p&gt;
  The second path is &lt;strong&gt;brownfield modernization&lt;/strong&gt;. This is the path most real companies need. You already have a working product. Maybe it is profitable. Maybe users rely on it every day. But the UI feels outdated, the codebase has too many patterns, the product is hard to extend, and every improvement feels risky.
&lt;/p&gt;

&lt;p&gt;
  This path is not about moving fast and breaking things.
&lt;/p&gt;

&lt;p&gt;
  It is about improving one valuable workflow at a time without breaking the business.
&lt;/p&gt;

&lt;p&gt;
  Same tools. Different mindset.
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For a new product, the question is: &lt;strong&gt;how quickly can we validate this idea?&lt;/strong&gt;
&lt;/li&gt;
  &lt;li&gt;For an existing product, the question is: &lt;strong&gt;how can we make this system better without turning modernization into a six-month rewrite?&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  AI helps with both, but the second opportunity may be much larger.
&lt;/p&gt;

&lt;h2&gt;Start with the workflow, not the model&lt;/h2&gt;

&lt;p&gt;
  The biggest mistake teams make is starting with the tech stack.
&lt;/p&gt;

&lt;p&gt;
  They ask which model to use, which IDE assistant is better, whether to use React or Livewire, whether they need vector search, or whether they should build an agent.
&lt;/p&gt;

&lt;p&gt;
  Those questions matter, but they are not the starting point.
&lt;/p&gt;

&lt;p&gt;
  The starting point is the workflow.
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What does the user do every day?&lt;/li&gt;
  &lt;li&gt;Where do they waste time?&lt;/li&gt;
  &lt;li&gt;Where do they copy and paste?&lt;/li&gt;
  &lt;li&gt;Where do they wait?&lt;/li&gt;
  &lt;li&gt;Where do they make mistakes?&lt;/li&gt;
  &lt;li&gt;Where do they need context before making a decision?&lt;/li&gt;
  &lt;li&gt;Which part of the workflow is repetitive enough to automate but important enough to improve?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  “Modernize our app” is too vague.
&lt;/p&gt;

&lt;p&gt;
  “Help support managers review, prioritize, and respond to tickets faster” is specific.
&lt;/p&gt;

&lt;p&gt;
  That kind of problem gives every tool a clear job.
&lt;/p&gt;

&lt;p&gt;
  Figma helps rethink the user experience. Figma Make helps test the improved flow before production work starts. Figma MCP helps move real design context into the coding environment. An AI coding agent helps inspect the existing codebase and implement focused changes. Laravel provides the application structure. Laravel AI SDK adds intelligent behavior where it actually belongs.
&lt;/p&gt;

&lt;p&gt;
  That is a real workflow.
&lt;/p&gt;

&lt;h2&gt;Figma agents are becoming real product tools&lt;/h2&gt;

&lt;p&gt;
  Figma’s recent AI updates are important because the agent is no longer just a prompt box that creates a few screen ideas.
&lt;/p&gt;

&lt;p&gt;
  Figma has been expanding its design agent with more context, custom tools, reusable skills, and deeper connections to design and development workflows. This direction moves beyond simple prompting toward agents that understand how a team works, use broader project context, and help create reusable tools directly on the canvas.
&lt;/p&gt;

&lt;p&gt;
  For modernization work, this matters because context is everything.
&lt;/p&gt;

&lt;p&gt;
  If you are redesigning an old support dashboard, you do not want a random “modern SaaS UI.” You want a better version of the actual workflow your team already uses.
&lt;/p&gt;

&lt;p&gt;
  That means the agent should understand the current screen, the design system, user feedback, accessibility rules, product requirements, and the business goal behind the redesign.
&lt;/p&gt;

&lt;p&gt;
  This is where Figma’s agent becomes useful. It does not replace the designer. It helps the team move from vague feedback to concrete options faster.
&lt;/p&gt;

&lt;p&gt;
  Instead of starting from a blank canvas, a team can explore several improved versions of the same workflow, compare them, clean up the hierarchy, standardize components, and create better empty, loading, and error states.
&lt;/p&gt;

&lt;p&gt;
  The goal is not to make the old screen prettier.
&lt;/p&gt;

&lt;p&gt;
  The goal is to make the workflow easier to understand and faster to use.
&lt;/p&gt;

&lt;h2&gt;Code layers make design and code feel closer&lt;/h2&gt;

&lt;p&gt;
  Another important Figma update is code layers.
&lt;/p&gt;

&lt;p&gt;
  Code layers bring interactive code onto the Figma canvas. Teams can create a code layer from a frame, ask the Figma agent to generate one, bring in a repository, or upload a local folder. This creates workflows where teams can compare, refine, and update code layers alongside normal design work.
&lt;/p&gt;

&lt;p&gt;
  This is especially interesting for legacy products.
&lt;/p&gt;

&lt;p&gt;
  Historically, modernization projects often started with screenshots of the old product. Screenshots are useful, but they are dead artifacts. They do not show real behavior, real state, real components, or the connection between design and implementation.
&lt;/p&gt;

&lt;p&gt;
  Code layers make the design conversation more practical.
&lt;/p&gt;

&lt;p&gt;
  Designers, developers, and product managers can compare the current experience with a proposed future experience in a more interactive way. They can discuss what is purely visual, what requires frontend work, and what depends on backend logic.
&lt;/p&gt;

&lt;p&gt;
  This does not mean Figma becomes your production IDE.
&lt;/p&gt;

&lt;p&gt;
  It means the gap between “what exists,” “what we designed,” and “what we plan to build” gets smaller.
&lt;/p&gt;

&lt;h2&gt;Figma MCP reduces design-to-code guesswork&lt;/h2&gt;

&lt;p&gt;
  Design-to-code has always had a translation problem.
&lt;/p&gt;

&lt;p&gt;
  A designer creates a screen. A developer interprets it. Something gets lost. Spacing changes. Components get duplicated. States are forgotten. A table gets rebuilt from scratch even though the app already has one. A modal looks almost like the design system, but not quite.
&lt;/p&gt;

&lt;p&gt;
  AI can make this worse if it only works from screenshots or vague prompts.
&lt;/p&gt;

&lt;p&gt;
  That is why the Figma MCP Server matters.
&lt;/p&gt;

&lt;p&gt;
  Figma MCP can provide AI agents with design context from Figma files, including selected frames, components, variables, layout data, and resources from Figma Make files.
&lt;/p&gt;

&lt;p&gt;
  For modernization, the coding agent needs to understand two worlds at the same time:
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;the existing Laravel application;&lt;/li&gt;
  &lt;li&gt;the new Figma design direction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  If the agent only understands the old code, it may preserve outdated UI patterns. If it only understands the new design, it may produce code that does not fit the actual application.
&lt;/p&gt;

&lt;p&gt;
  But when it has both design context and codebase context, it can make more precise changes.
&lt;/p&gt;

&lt;p&gt;
  That is when AI becomes useful in real projects.
&lt;/p&gt;

&lt;p&gt;
  Not as a magic generator, but as a context-aware assistant.
&lt;/p&gt;

&lt;h2&gt;Code Connect helps prevent component chaos&lt;/h2&gt;

&lt;p&gt;
  One of the easiest ways to damage a codebase with AI is to let it create duplicate components.
&lt;/p&gt;

&lt;p&gt;
  A new button. A new card. A new modal. A new table. A new dropdown. A new form pattern.
&lt;/p&gt;

&lt;p&gt;
  None of them are terrible alone, but together they create a maintenance problem.
&lt;/p&gt;

&lt;p&gt;
  After a few weeks, the app may look “AI-modernized,” but the codebase is harder to maintain than before.
&lt;/p&gt;

&lt;p&gt;
  Code Connect helps by linking Figma components to real code components. It connects design components with their implementation in code, which helps teams keep design and engineering aligned.
&lt;/p&gt;

&lt;p&gt;
  The button in Figma should map to the real button in code. The modal should use the existing modal. The table should follow the existing table pattern. The badge should not be recreated five different ways.
&lt;/p&gt;

&lt;p&gt;
  In a new product, this keeps things clean from the beginning.
&lt;/p&gt;

&lt;p&gt;
  In a legacy product, it is even more important because modernization should reduce inconsistency, not add more.
&lt;/p&gt;

&lt;blockquote&gt;
  AI agents need boundaries. A connected design system gives them those boundaries.
&lt;/blockquote&gt;

&lt;h2&gt;AI in PhpStorm and other IDEs belongs in the real developer workflow&lt;/h2&gt;

&lt;p&gt;
  After the new flow is validated in Figma, the work moves into the IDE.
&lt;/p&gt;

&lt;p&gt;
  For PHP teams, PhpStorm is one of the most natural places for AI-assisted development. JetBrains AI Assistant supports modern PHP development workflows such as generating and explaining PHP code, multi-file edits, intelligent completion, and AI chat with project context.
&lt;/p&gt;

&lt;p&gt;
  JetBrains also has Junie, an AI coding agent that can work in code mode to execute tasks and in ask mode to collaborate on plans and questions.
&lt;/p&gt;

&lt;p&gt;
  If your team does not use PhpStorm, the same workflow can work with alternatives such as Cursor, Claude Code, or GitHub Copilot.
&lt;/p&gt;

&lt;p&gt;
  The specific tool matters less than the operating model.
&lt;/p&gt;

&lt;p&gt;
  A bad prompt is:
&lt;/p&gt;

&lt;blockquote&gt;
  Refactor this dashboard.
&lt;/blockquote&gt;

&lt;p&gt;
  A better request is:
&lt;/p&gt;

&lt;blockquote&gt;
  Explain how this workflow works today. Identify its routes, controllers, models, policies, frontend components, jobs, and tests. List the business rules that must be preserved. Then propose a modernization plan without editing any files.
&lt;/blockquote&gt;

&lt;p&gt;
  The agent’s first job should be understanding, not implementation.
&lt;/p&gt;

&lt;p&gt;
  After the plan is reviewed, let it change one vertical slice at a time. A ticket detail screen is a reasonable task. An entire support system is not.
&lt;/p&gt;

&lt;h2&gt;Laravel now has an AI stack, not just an AI package&lt;/h2&gt;

&lt;p&gt;
  Laravel is especially interesting in this workflow because it has structure.
&lt;/p&gt;

&lt;p&gt;
  Routes have a place. Controllers have a place. Models have a place. Migrations have a place. Policies have a place. Jobs have a place. Tests have a place.
&lt;/p&gt;

&lt;p&gt;
  That structure helps humans, but it also helps AI agents.
&lt;/p&gt;

&lt;p&gt;
  Laravel’s AI tooling now operates at several layers.
&lt;/p&gt;

&lt;p&gt;
  &lt;strong&gt;Laravel Boost&lt;/strong&gt; helps AI coding agents write better Laravel code by giving them Laravel-specific context, guidance, and project-aware tools.
&lt;/p&gt;

&lt;p&gt;
  &lt;strong&gt;Laravel AI SDK&lt;/strong&gt; helps developers build AI features inside Laravel applications. It provides a Laravel-native way to build AI-powered features with providers, agents, tools, structured output, embeddings, vector workflows, and more.
&lt;/p&gt;

&lt;p&gt;
  &lt;strong&gt;Laravel MCP&lt;/strong&gt; helps AI clients and agents interact with tools and resources exposed by Laravel applications. Laravel AI agents can also connect to MCP servers and work with external systems.
&lt;/p&gt;

&lt;p&gt;
  These tools solve different problems:
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
&lt;strong&gt;Boost&lt;/strong&gt; helps AI write the application.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;AI SDK&lt;/strong&gt; helps the application use AI.&lt;/li&gt;
  &lt;li&gt;
&lt;strong&gt;MCP&lt;/strong&gt; helps AI interact with the application and external systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  A production project may use all three, but it should not install all three simply because they exist.
&lt;/p&gt;

&lt;p&gt;
  Start with the workflow. Then choose the tool.
&lt;/p&gt;

&lt;h2&gt;AI can help with framework upgrades too&lt;/h2&gt;

&lt;p&gt;
  Legacy modernization is not only about redesigning screens.
&lt;/p&gt;

&lt;p&gt;
  It often includes framework upgrades, package updates, new PHP versions, deprecated APIs, test-suite changes, and cleanup around old patterns.
&lt;/p&gt;

&lt;p&gt;
  AI-assisted upgrade workflows can help teams compare package versions, follow official upgrade guidance, update repetitive code, run the test suite, and report what still fails.
&lt;/p&gt;

&lt;p&gt;
  That does not make an upgrade automatic or risk-free.
&lt;/p&gt;

&lt;p&gt;
  An AI agent cannot know every undocumented production dependency, every unusual database record, or every client-specific behavior.
&lt;/p&gt;

&lt;p&gt;
  But it can turn an upgrade from a manual search-and-replace exercise into a structured engineering loop.
&lt;/p&gt;

&lt;p&gt;
  The team still owns the final diff.
&lt;/p&gt;

&lt;h2&gt;Tests are the safety system for AI-assisted modernization&lt;/h2&gt;

&lt;p&gt;
  AI is useful in legacy work only when it makes change safer.
&lt;/p&gt;

&lt;p&gt;
  Before asking an agent to refactor old code, use it to help document and test the existing behavior.
&lt;/p&gt;

&lt;p&gt;
  These are often called characterization tests: they capture what the application does today, including behavior the team may not fully understand.
&lt;/p&gt;

&lt;p&gt;
  For an old support dashboard, that might include authorization rules, filters, sorting, ticket assignments, status transitions, notifications, exports, and tenant isolation.
&lt;/p&gt;

&lt;p&gt;
  Once those behaviors are protected, the agent can refactor with a clear signal when something breaks.
&lt;/p&gt;

&lt;p&gt;
  AI assistants can help generate unit tests in the IDE and show proposed test code for review.
&lt;/p&gt;

&lt;p&gt;
  But this part is important: an AI-generated test is not automatically a good test.
&lt;/p&gt;

&lt;p&gt;
  Sometimes the test simply repeats the same wrong assumption as the generated code. Sometimes it tests implementation details instead of behavior. Sometimes it misses authorization, edge cases, failure states, or multi-tenant boundaries.
&lt;/p&gt;

&lt;p&gt;
  The developer still needs to ask:
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Is this testing behavior or implementation details?&lt;/li&gt;
  &lt;li&gt;Does it cover authorization?&lt;/li&gt;
  &lt;li&gt;Does it cover another tenant trying to access the record?&lt;/li&gt;
  &lt;li&gt;Does it cover invalid and incomplete data?&lt;/li&gt;
  &lt;li&gt;Does it cover failure and retry states?&lt;/li&gt;
  &lt;li&gt;Would this test have caught the original bug?&lt;/li&gt;
  &lt;li&gt;Did the agent weaken an assertion just to make the suite pass?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  The goal is not more tests.
&lt;/p&gt;

&lt;p&gt;
  The goal is more confidence.
&lt;/p&gt;

&lt;h2&gt;Laravel PAO makes the test loop better for agents&lt;/h2&gt;

&lt;p&gt;
  Laravel recently introduced PAO, or PHP agent-optimized output.
&lt;/p&gt;

&lt;p&gt;
  Test runners and analysis tools normally produce terminal output designed for humans: colors, progress dots, tables, warnings, and decorative formatting.
&lt;/p&gt;

&lt;p&gt;
  That output can waste context and make it harder for an AI agent to locate the actual failure.
&lt;/p&gt;

&lt;p&gt;
  Laravel PAO returns compact, structured output for supported commands when they are being run by an AI agent.
&lt;/p&gt;

&lt;p&gt;
  This sounds like a small feature, but it improves the most common agent loop:
&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Run the tests.&lt;/li&gt;
  &lt;li&gt;Find the failure.&lt;/li&gt;
  &lt;li&gt;Edit the relevant code.&lt;/li&gt;
  &lt;li&gt;Run the tests again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
  When an agent receives the failing assertion, file, line number, and error details directly, it spends less time interpreting terminal noise and more time solving the actual problem.
&lt;/p&gt;

&lt;h2&gt;AI features need their own testing strategy&lt;/h2&gt;

&lt;p&gt;
  Adding an AI-powered feature creates a second testing problem.
&lt;/p&gt;

&lt;p&gt;
  The application logic may be deterministic, but the model output is not.
&lt;/p&gt;

&lt;p&gt;
  Suppose the modernized support dashboard includes an AI-generated ticket summary. A normal test should not call a live provider and compare the exact paragraph returned by the model. That would be slow, expensive, and unreliable.
&lt;/p&gt;

&lt;p&gt;
  Instead, the regular application suite should test deterministic boundaries:
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Was the correct agent invoked?&lt;/li&gt;
  &lt;li&gt;Was the job dispatched?&lt;/li&gt;
  &lt;li&gt;Was tenant authorization enforced?&lt;/li&gt;
  &lt;li&gt;Was the result stored in the correct record?&lt;/li&gt;
  &lt;li&gt;Did the response match the expected structured schema?&lt;/li&gt;
  &lt;li&gt;Was the failure state handled?&lt;/li&gt;
  &lt;li&gt;Was an automatic action blocked until human approval?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  Laravel AI SDK includes testing helpers such as fakes and assertions for AI operations, allowing teams to test application behavior without making uncontrolled live model calls.
&lt;/p&gt;

&lt;p&gt;
  Model quality should be evaluated separately.
&lt;/p&gt;

&lt;p&gt;
  Keep a small set of representative examples and expected qualities: correct category, acceptable summary, no invented facts, no cross-tenant data, appropriate escalation, and no unsafe action.
&lt;/p&gt;

&lt;p&gt;
  Unit tests protect the application.
&lt;/p&gt;

&lt;p&gt;
  Evaluations protect the AI behavior.
&lt;/p&gt;

&lt;p&gt;
  You need both.
&lt;/p&gt;

&lt;h2&gt;A practical modernization flow&lt;/h2&gt;

&lt;p&gt;
  Imagine an old customer-support dashboard built in Laravel.
&lt;/p&gt;

&lt;p&gt;
  It still works, but the ticket table has too many columns, filters are inconsistent, the detail page is difficult to scan, and support managers spend too much time reading repetitive requests.
&lt;/p&gt;

&lt;p&gt;
  A practical AI-assisted modernization flow could look like this.
&lt;/p&gt;

&lt;h3&gt;1. Protect the current behavior&lt;/h3&gt;

&lt;p&gt;
  Before redesigning anything, map the existing route, controller, policies, database queries, frontend components, jobs, and notifications.
&lt;/p&gt;

&lt;p&gt;
  Ask the coding agent to identify missing coverage, then add characterization tests for the behavior users depend on.
&lt;/p&gt;

&lt;p&gt;
  Do this before the refactor, not after it.
&lt;/p&gt;

&lt;h3&gt;2. Redesign the workflow with Figma’s agent&lt;/h3&gt;

&lt;p&gt;
  Bring the current interface, user feedback, support metrics, design system, and project requirements into Figma.
&lt;/p&gt;

&lt;p&gt;
  Ask the agent to explore a cleaner ticket inbox and a more focused ticket detail page.
&lt;/p&gt;

&lt;p&gt;
  Create reusable rules or skills that enforce the team’s component, accessibility, and layout standards.
&lt;/p&gt;

&lt;p&gt;
  The goal is not a beautiful concept.
&lt;/p&gt;

&lt;p&gt;
  The goal is a better working day for the support team.
&lt;/p&gt;

&lt;h3&gt;3. Validate the interaction&lt;/h3&gt;

&lt;p&gt;
  Use Figma Make or code-layer workflows to create a working version of the new flow.
&lt;/p&gt;

&lt;p&gt;
  Let real support managers use it.
&lt;/p&gt;

&lt;p&gt;
  Watch where they hesitate. Check whether the AI summary helps or distracts. Confirm which information they need before approving a suggested response.
&lt;/p&gt;

&lt;p&gt;
  Fix the workflow before rebuilding the backend.
&lt;/p&gt;

&lt;h3&gt;4. Connect the design to the real codebase&lt;/h3&gt;

&lt;p&gt;
  Use Figma MCP to provide the selected design context to the coding agent.
&lt;/p&gt;

&lt;p&gt;
  Map important design components to production components with Code Connect.
&lt;/p&gt;

&lt;p&gt;
  The agent should know which table, button, modal, badge, and form components already exist.
&lt;/p&gt;

&lt;h3&gt;5. Implement one vertical slice&lt;/h3&gt;

&lt;p&gt;
  In PhpStorm with Junie, or in Cursor, Claude Code, or GitHub Copilot, ask the agent to inspect the existing implementation and propose a plan.
&lt;/p&gt;

&lt;p&gt;
  Start with the ticket detail page. Keep the old route available. Ship the new version behind a feature flag. Run the existing and newly generated tests after every meaningful change.
&lt;/p&gt;

&lt;p&gt;
  Do not modernize the entire support module in one task.
&lt;/p&gt;

&lt;h3&gt;6. Add one narrow AI feature&lt;/h3&gt;

&lt;p&gt;
  Once the new workflow is stable, add ticket summarization through Laravel AI SDK.
&lt;/p&gt;

&lt;p&gt;
  Do not begin with full automation. The first version can summarize the request, classify it, suggest urgency, and draft a response for human approval.
&lt;/p&gt;

&lt;p&gt;
  That is useful, measurable, and relatively safe.
&lt;/p&gt;

&lt;h3&gt;7. Test, release, and measure&lt;/h3&gt;

&lt;p&gt;
  Fake model responses in the normal test suite. Evaluate model quality separately. Use agent-friendly test output to improve the feedback loop. Release the new workflow to a small group and measure review time, error rate, adoption, and support-team feedback.
&lt;/p&gt;

&lt;p&gt;
  Then decide whether the next investment should be smarter routing, suggested replies, better search, or simply another redesigned screen.
&lt;/p&gt;

&lt;h2&gt;Guardrails matter more than prompts&lt;/h2&gt;

&lt;p&gt;
  A coding agent working in a legacy product should have explicit boundaries.
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;It should not rewrite unrelated files.&lt;/li&gt;
  &lt;li&gt;It should not introduce a new frontend framework without approval.&lt;/li&gt;
  &lt;li&gt;It should not create duplicate components.&lt;/li&gt;
  &lt;li&gt;It should not change the database schema without a migration and rollback plan.&lt;/li&gt;
  &lt;li&gt;It should not weaken tests to make them pass.&lt;/li&gt;
  &lt;li&gt;It should not bypass policies or tenant boundaries.&lt;/li&gt;
  &lt;li&gt;It should not send sensitive production data to an external model without an approved data policy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
  The agent can inspect, plan, implement, run tests, and review the diff.
&lt;/p&gt;

&lt;p&gt;
  The team still owns the architecture, security, product decisions, and release.
&lt;/p&gt;

&lt;p&gt;
  That is the real AI modernization stack: not one model and not one magic prompt, but a connected workflow with context at every stage.
&lt;/p&gt;

&lt;p&gt;
  Figma’s agent helps the team rethink the experience. Figma MCP and Code Connect carry design intent into development. PhpStorm, Junie, Cursor, Claude Code, or GitHub Copilot help engineers understand and change the codebase. Laravel Boost gives those agents framework-specific context. Laravel AI SDK adds useful intelligence to the product. Tests, fakes, evaluations, and agent-friendly output keep the process under control.
&lt;/p&gt;

&lt;p&gt;
  The goal is not to generate more code.
&lt;/p&gt;

&lt;p&gt;
  The goal is to improve valuable software without putting the business at risk.
&lt;/p&gt;





&lt;p&gt;
  At &lt;a href="https://kavitasystems.com" rel="noopener noreferrer"&gt;&lt;strong&gt;Kavita Systems&lt;/strong&gt;&lt;/a&gt;, we help teams modernize existing web products, improve legacy Laravel workflows, and introduce practical AI features without committing to a risky full rewrite.
&lt;/p&gt;

&lt;p&gt;
  &lt;strong&gt;Need to understand where AI can create value in your existing product?&lt;/strong&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>laravel</category>
      <category>figma</category>
    </item>
    <item>
      <title>Laravel 13 Makes the “AI Means Python” Argument Weaker</title>
      <dc:creator>VitaliiK</dc:creator>
      <pubDate>Wed, 24 Jun 2026 12:07:59 +0000</pubDate>
      <link>https://dev.to/kavitasystems/laravel-13-makes-the-ai-means-python-argument-weaker-3flg</link>
      <guid>https://dev.to/kavitasystems/laravel-13-makes-the-ai-means-python-argument-weaker-3flg</guid>
      <description>&lt;p&gt;For a long time, adding AI to a Laravel product usually meant one thing: you had to bring another service into the stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The architecture often looked like this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn87vmurbprwkl2bz8si9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn87vmurbprwkl2bz8si9.png" alt="Laravel application connected to a Python AI bridge" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At first, this setup feels reasonable.&lt;/p&gt;

&lt;p&gt;Laravel handles the product. Python handles the AI. FastAPI or Flask sits in the middle. The bridge sends text to an embeddings service, talks to a vector database, calls an LLM provider, and sends the answer back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a prototype, that is fine.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a demo, it may even look impressive.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But then the product goes live.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And suddenly that “small Python bridge” is not small anymore. It needs deployment, monitoring, logs, retries, permissions, rate limits, error handling, security reviews, and someone on the team who understands why a payment flow in Laravel now depends on a Python service nobody wants to touch.&lt;/p&gt;

&lt;p&gt;The problem was never Python itself.&lt;/p&gt;

&lt;p&gt;The problem is using Python as a bridge only because Laravel used to have no native way to deal with AI workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is changing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With Laravel 13 and the Laravel AI SDK, many things that previously required a separate Python service can now live inside the Laravel application: agents, tools, embeddings, vector search, RAG workflows, and AI provider orchestration.&lt;/p&gt;

&lt;p&gt;Laravel also supports vector columns in PostgreSQL through pgvector, so semantic search can sit much closer to your Eloquent models, policies, queues, and business logic.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This does not mean Python is dead.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It means the Python bridge is no longer the default answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem Was Never Python
&lt;/h2&gt;

&lt;p&gt;Python is still great for machine learning research, notebooks, model training, data science, experiments, and custom ML pipelines.&lt;/p&gt;

&lt;p&gt;If your team is training models or building research-heavy AI infrastructure, Python probably still belongs in your stack.&lt;/p&gt;

&lt;p&gt;But most product teams are not doing that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most product teams want something much more practical.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzhrx71wwxglbx3wqjjpi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzhrx71wwxglbx3wqjjpi.png" alt="Product teams using AI for application workflows" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They want to search a product catalog by meaning. They want to answer questions using internal documentation. They want to explain payment errors, help users book a service, prepare a stock order, summarize support tickets, or route a request to the right workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is not machine learning research.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is application engineering.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And application engineering is exactly where Laravel is strong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The real question is not:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can Python do this?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Of course it can.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The better question is:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do we need a separate Python service only to call an LLM, generate embeddings, search vectors, and trigger business workflows?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In many Laravel products, the answer is now: no.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Are Actually Killing
&lt;/h2&gt;

&lt;p&gt;We are not killing Python.&lt;/p&gt;

&lt;p&gt;We are killing an awkward split in the architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9lb3cre8fc7c239s8bpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9lb3cre8fc7c239s8bpg.png" alt="Awkward split between Laravel and a Python service" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Think about a real product.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel knows the user. Laravel knows the order. Laravel knows the permissions. Laravel knows the payment state. Laravel knows the booking rules. Laravel knows the audit log.&lt;/p&gt;

&lt;p&gt;But then we ask a separate Python service to make the AI decision.&lt;/p&gt;

&lt;p&gt;That split feels wrong because the AI layer is not floating somewhere outside the product. It is supposed to help the product make better decisions, explain things better, and guide users through existing workflows.&lt;/p&gt;

&lt;p&gt;If the business logic already lives in Laravel, the AI workflow should be close to that business logic.&lt;/p&gt;

&lt;p&gt;With a native Laravel AI stack, the architecture becomes much easier to understand:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fazlr9ngaqeo38fl8wp9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fazlr9ngaqeo38fl8wp9w.png" alt="Native Laravel AI architecture with agents and tools" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The user talks to the Laravel application. The Laravel application calls an AI agent. The agent uses allowed tools. The tools call Eloquent models, external APIs, policies, queues, and services. The LLM helps understand language, but Laravel still controls the workflow.&lt;/p&gt;

&lt;p&gt;That means one codebase, one permission model, one deployment pipeline, one logging system, and one team that can understand the full flow.&lt;/p&gt;

&lt;p&gt;That is the real win.&lt;/p&gt;

&lt;h2&gt;
  
  
  RAG Is Not Just “Chat With PDF”
&lt;/h2&gt;

&lt;p&gt;A lot of people still imagine RAG as a chatbot that reads PDFs.&lt;/p&gt;

&lt;p&gt;That is the beginner version.&lt;/p&gt;

&lt;p&gt;In a real product, RAG is more useful than that. It is a way to give the AI the right business context before it answers or acts.&lt;/p&gt;

&lt;p&gt;That context can come from many places:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhj55mk4kh6pe8qo6n05j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhj55mk4kh6pe8qo6n05j.png" alt="RAG context sources for business applications" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But here is the important part: RAG should not become your source of truth.&lt;/p&gt;

&lt;p&gt;RAG is great for finding, explaining, comparing, summarizing, and suggesting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fngks7awkiollq1g3polc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fngks7awkiollq1g3polc.png" alt="RAG use cases: finding, explaining, comparing, and suggesting" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But real product actions still belong to your domain APIs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8c3t00a3bqfwft55d8hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8c3t00a3bqfwft55d8hn.png" alt="Domain APIs remain the source of truth" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An AI agent can help a user choose a laptop. But the catalog API must confirm the actual price and inventory.&lt;/p&gt;

&lt;p&gt;An AI agent can explain a cancellation policy. But the booking API must confirm whether this specific reservation can still be canceled.&lt;/p&gt;

&lt;p&gt;An AI agent can prepare a stock order. But the brokerage system must execute it only after confirmation, risk checks, and compliance rules.&lt;/p&gt;

&lt;p&gt;This is the line that matters:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AI can help the user understand and prepare the action. The backend must still validate and execute the action.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Native Vector Search Matters
&lt;/h2&gt;

&lt;p&gt;Before native vector support, adding AI search to Laravel usually meant adding more infrastructure.&lt;/p&gt;

&lt;p&gt;You had Laravel for the product, FastAPI for the bridge, LangChain or custom orchestration for the AI flow, OpenAI or another model provider, Pinecone or another vector database, Redis or queues, custom sync jobs, and custom observability.&lt;/p&gt;

&lt;p&gt;That is a lot of moving parts for a feature that may start with one simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can users search our data by meaning instead of exact keywords?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now many teams can start much simpler.&lt;/p&gt;

&lt;p&gt;For example, a product table can store an embedding directly in PostgreSQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;ensureVectorExtensionExists&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'products'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Blueprint&lt;/span&gt; &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'description'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'attributes'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;nullable&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dimensions&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1536&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;timestamps&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And semantic search can stay inside Eloquent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="nv"&gt;$products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'is_active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;whereVectorSimilarTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'a lightweight laptop for Figma, coding, and video calls'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;minSimilarity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not only about writing fewer lines of code.&lt;/p&gt;

&lt;p&gt;It is about keeping search close to your existing models, filters, tenant scopes, policies, queues, and database logic.&lt;/p&gt;

&lt;p&gt;When retrieval lives inside the same application, it is easier to reason about who can see what, what should be indexed, and what should never be exposed to the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 1: E-Commerce Search That Understands Human Requests
&lt;/h2&gt;

&lt;p&gt;Traditional product search works well when the user knows exactly what they want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;iPhone 15 Pro 256GB&lt;/li&gt;
&lt;li&gt;Nike Air Max size 10&lt;/li&gt;
&lt;li&gt;Logitech MX Master 3S&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But real users do not always search like that.&lt;/p&gt;

&lt;p&gt;Sometimes they write:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I need a gift for someone who travels a lot.&lt;/p&gt;

&lt;p&gt;Find me a laptop for design work and Laravel development.&lt;/p&gt;

&lt;p&gt;Show me something useful for a home office under $300.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Keyword search can easily miss the intent behind these requests.&lt;/p&gt;

&lt;p&gt;Semantic search works better because it compares meaning, not just words.&lt;/p&gt;

&lt;p&gt;A product search tool can look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SearchProductsTool&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;?int&lt;/span&gt; &lt;span class="nv"&gt;$maxPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'is_active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;when&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$maxPrice&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$q&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'price'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;='&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$maxPrice&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;whereVectorSimilarTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'embedding'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;minSimilarity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
                &lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'price'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'short_description'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the user can say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I need a compact gift for a colleague who flies twice a month.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The system can return travel adapters, power banks, compact headphones, laptop sleeves, or carry-on accessories even if the user never typed those exact words.&lt;/p&gt;

&lt;p&gt;That is not just a “cool AI feature.”&lt;/p&gt;

&lt;p&gt;That is a better shopping experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 2: Booking Systems Where AI Understands the Intent
&lt;/h2&gt;

&lt;p&gt;Booking platforms are full of rules.&lt;/p&gt;

&lt;p&gt;Cancellation windows. Slot availability. Deposits. Staff schedules. Seasonal prices. Minimum duration. No-show rules. Different policies for different services.&lt;/p&gt;

&lt;p&gt;Users do not want to read all of that.&lt;/p&gt;

&lt;p&gt;They want to ask simple questions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can I book a massage for two people this Saturday after 4 PM?&lt;/p&gt;

&lt;p&gt;Find me an apartment in Lviv for the weekend with parking and free cancellation.&lt;/p&gt;

&lt;p&gt;Can I cancel my booking if check-in is tomorrow?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI is useful here because it can translate messy human language into a clean backend workflow.&lt;/p&gt;

&lt;p&gt;It can search the policy documents, understand the request, and call the booking API to check real-time availability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CheckAvailabilityTool&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BookingApi&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;availableSlots&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'service'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="n"&gt;guests&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'guests'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'after'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;maxPrice&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'max_price'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A healthy booking flow should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4ooosx9zllqpt7qskict.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4ooosx9zllqpt7qskict.png" alt="Safe booking flow with AI and Laravel" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The AI should not randomly finalize a reservation.&lt;/p&gt;

&lt;p&gt;It should not guess dates. It should not ignore cancellation rules. It should not bypass your booking engine.&lt;/p&gt;

&lt;p&gt;AI helps the user move faster.&lt;/p&gt;

&lt;p&gt;Laravel still owns the transaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 3: Payments, Banking, and Stock Orders
&lt;/h2&gt;

&lt;p&gt;Financial workflows are where AI needs the shortest leash.&lt;/p&gt;

&lt;p&gt;A user might say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Buy $500 worth of Apple stock if the fee is under $2.&lt;/p&gt;

&lt;p&gt;Can I pay this invoice from my business account?&lt;/p&gt;

&lt;p&gt;Why was my card payment declined?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI can help with all of these requests.&lt;/p&gt;

&lt;p&gt;But it should not directly move money without confirmation.&lt;/p&gt;

&lt;p&gt;In payments, banking, and brokerage systems, the AI should usually do three things: explain what is happening, prepare the next step, and verify the conditions.&lt;/p&gt;

&lt;p&gt;It should not silently execute a payment, bank transfer, refund, or stock trade.&lt;/p&gt;

&lt;p&gt;A safer brokerage flow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User asks to buy stock.&lt;/li&gt;
&lt;li&gt;AI checks account status.&lt;/li&gt;
&lt;li&gt;AI gets quote and estimated fees.&lt;/li&gt;
&lt;li&gt;AI checks available balance.&lt;/li&gt;
&lt;li&gt;Laravel creates a pending trade.&lt;/li&gt;
&lt;li&gt;User reviews and confirms.&lt;/li&gt;
&lt;li&gt;Backend executes the trade.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The AI-facing tool should create a pending trade, not execute the order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="k"&gt;final&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CreatePendingTradeTool&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$symbol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Gate&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;authorize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'createTradeIntent'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

        &lt;span class="nv"&gt;$quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BrokerageApi&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$symbol&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$fees&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BrokerageApi&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;estimateFees&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$symbol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$trade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PendingTrade&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'user_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="s1"&gt;'symbol'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$symbol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'amount'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'quote_snapshot'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'estimated_fees'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$fees&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'status'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'awaiting_confirmation'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$trade&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final execution should stay inside the normal backend flow, with transactions, risk checks, policies, and audit logs.&lt;/p&gt;

&lt;p&gt;The same idea applies to payments.&lt;/p&gt;

&lt;p&gt;AI can create a payment intent. AI can explain why a transaction failed. AI can suggest another payment method.&lt;/p&gt;

&lt;p&gt;But it should not bypass 3DS, fraud checks, limits, compliance rules, or explicit user confirmation.&lt;/p&gt;

&lt;p&gt;That is not an AI limitation.&lt;/p&gt;

&lt;p&gt;That is responsible engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Put It Together in Laravel
&lt;/h2&gt;

&lt;p&gt;A clean Laravel AI architecture can be organized around agents and tools.&lt;/p&gt;

&lt;p&gt;The agent understands the user request. The tools define what the AI is allowed to do. Laravel services handle the real business logic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agents: CommerceAgent, BookingAgent, BankingAssistantAgent.&lt;/li&gt;
&lt;li&gt;Tools: SearchProductsTool, CheckAvailabilityTool, CreateReservationHoldTool, CreatePaymentIntentTool, CreatePendingTradeTool, SearchPolicyDocumentsTool.&lt;/li&gt;
&lt;li&gt;Services: CatalogApi, BookingApi, PaymentGateway, BrokerageApi, RiskService.&lt;/li&gt;
&lt;li&gt;Models: Product, Booking, Payment, PendingTrade, PolicyDocument.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most important idea is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An AI agent should not be a god object. It should be a controlled interface between the user, the LLM, and your backend.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example, a commerce agent may be allowed to search products, check delivery availability, create reservation holds, and prepare payment intents.&lt;/p&gt;

&lt;p&gt;But it should not be allowed to execute payments, trades, refunds, or final bookings without explicit confirmation and server-side validation.&lt;/p&gt;

&lt;p&gt;This is the mental model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The LLM understands the request.&lt;/li&gt;
&lt;li&gt;The agent decides which tools are allowed.&lt;/li&gt;
&lt;li&gt;The tools call the real backend.&lt;/li&gt;
&lt;li&gt;Laravel enforces permissions and policies.&lt;/li&gt;
&lt;li&gt;The user confirms critical actions.&lt;/li&gt;
&lt;li&gt;The system logs everything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is production architecture.&lt;/p&gt;

&lt;p&gt;Not magic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three-API Pattern
&lt;/h2&gt;

&lt;p&gt;Most useful AI products are not just “LLM plus database.”&lt;/p&gt;

&lt;p&gt;They are integrations.&lt;/p&gt;

&lt;p&gt;This is where &lt;a href="https://kavitasystems.com/our-services/laravel-integrations-api-solutions" rel="noopener noreferrer"&gt;Laravel third-party API integration&lt;/a&gt; becomes more than a technical task. It becomes the layer that connects AI intent with real product systems: marketplaces, booking engines, payment gateways, banking APIs, and brokerage platforms.&lt;/p&gt;

&lt;p&gt;Imagine an AI-powered commerce platform with three external APIs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Marketplace API:&lt;/strong&gt; products, prices, inventory, and attributes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Booking API:&lt;/strong&gt; delivery slots, appointments, and reservations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment, banking, or brokerage API:&lt;/strong&gt; payment intents, balances, fees, and stock orders.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Without AI, the user has to move through all these systems manually.&lt;/p&gt;

&lt;p&gt;With AI, the user can simply say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find me a laptop for design work under $1,500, deliver it Friday evening, and prepare the payment from my business card.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The system can break this into a structured flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run semantic product search.&lt;/li&gt;
&lt;li&gt;Check inventory and current price.&lt;/li&gt;
&lt;li&gt;Check delivery slot availability.&lt;/li&gt;
&lt;li&gt;Create a payment intent.&lt;/li&gt;
&lt;li&gt;Ask the user for confirmation.&lt;/li&gt;
&lt;li&gt;Place the final order.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is where AI becomes valuable.&lt;/p&gt;

&lt;p&gt;Not because it replaces developers.&lt;/p&gt;

&lt;p&gt;Because it turns messy human intent into structured backend operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Dedicated Vector Databases Still Make Sense
&lt;/h2&gt;

&lt;p&gt;PostgreSQL with pgvector is a great starting point for many Laravel applications.&lt;/p&gt;

&lt;p&gt;It keeps the stack simple and keeps the data close to the domain model.&lt;/p&gt;

&lt;p&gt;But dedicated vector databases are not going away.&lt;/p&gt;

&lt;p&gt;Pinecone, Milvus, Qdrant, Weaviate, and similar systems can still make sense if you deal with very large vector datasets, advanced hybrid search, complex multi-tenant indexing, or an existing AI/search infrastructure.&lt;/p&gt;

&lt;p&gt;In that case, Laravel can still remain the main application. The only difference is that your tool calls an external vector-store adapter instead of Eloquent.&lt;/p&gt;

&lt;p&gt;The point is not “never use external vector databases.”&lt;/p&gt;

&lt;p&gt;The point is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do not add another runtime, another service, and another deployment pipeline unless the product actually needs it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Start simple.&lt;/p&gt;

&lt;p&gt;Scale when the data proves you need to scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Production Checklist
&lt;/h2&gt;

&lt;p&gt;AI in production is not only about prompts.&lt;/p&gt;

&lt;p&gt;It is mostly about boring engineering.&lt;/p&gt;

&lt;p&gt;And boring engineering is exactly what keeps AI features safe.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use idempotency keys
&lt;/h3&gt;

&lt;p&gt;Payment creation, booking holds, refunds, and trade intents must be idempotent.&lt;/p&gt;

&lt;p&gt;If the model retries a tool call, the system should not create two payments, two bookings, or two stock orders.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separate read tools from write tools
&lt;/h3&gt;

&lt;p&gt;AI can have many read tools, but write tools should be limited.&lt;/p&gt;

&lt;p&gt;Critical actions need explicit user confirmation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Log every tool call
&lt;/h3&gt;

&lt;p&gt;You should know what the user asked, what context was retrieved, what tool was selected, what input was sent, what output came back, what the model answered, and what action was finally executed.&lt;/p&gt;

&lt;p&gt;This matters for debugging. In finance, healthcare, e-commerce, and other sensitive products, it matters even more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enforce Laravel policies
&lt;/h3&gt;

&lt;p&gt;The AI agent must never become a permission bypass.&lt;/p&gt;

&lt;p&gt;If the user cannot access a booking, invoice, account, payment, or trade manually, the AI should not access it either.&lt;/p&gt;

&lt;h3&gt;
  
  
  Queue expensive work
&lt;/h3&gt;

&lt;p&gt;Embedding generation, document parsing, catalog reindexing, policy updates, and large sync jobs should run in queues.&lt;/p&gt;

&lt;p&gt;Do not block the user because the system is rebuilding vectors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Never trust RAG for real-time facts
&lt;/h3&gt;

&lt;p&gt;RAG can retrieve policy context.&lt;/p&gt;

&lt;p&gt;But real-time values must come from real systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Price comes from the Catalog API.&lt;/li&gt;
&lt;li&gt;Availability comes from the Booking API.&lt;/li&gt;
&lt;li&gt;Balance comes from the Banking API.&lt;/li&gt;
&lt;li&gt;Fees come from the Brokerage API.&lt;/li&gt;
&lt;li&gt;Payment state comes from the payment gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Require confirmation for money movement
&lt;/h3&gt;

&lt;p&gt;Payments, refunds, bank transfers, and stock purchases should always require explicit confirmation.&lt;/p&gt;

&lt;p&gt;AI can prepare the action. The backend executes it. The user approves it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Means for PHP Teams
&lt;/h2&gt;

&lt;p&gt;For years, PHP developers heard the same story:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AI is Python territory.&lt;/p&gt;

&lt;p&gt;PHP is for websites and CRUD.&lt;/p&gt;

&lt;p&gt;If you want AI, build a Python service.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That story is outdated.&lt;/p&gt;

&lt;p&gt;Modern PHP applications are not just templates and forms.&lt;/p&gt;

&lt;p&gt;They run marketplaces, CRMs, fintech products, booking platforms, SaaS dashboards, internal tools, support systems, and high-volume APIs.&lt;/p&gt;

&lt;p&gt;These are exactly the kinds of products where AI agents, RAG, semantic search, and workflow automation can create real value.&lt;/p&gt;

&lt;p&gt;And many of those systems already live in Laravel.&lt;/p&gt;

&lt;p&gt;So the AI layer should not automatically be outsourced to a separate Python bridge.&lt;/p&gt;

&lt;p&gt;It should live where the business logic already lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Python Still Belongs in the Architecture
&lt;/h2&gt;

&lt;p&gt;Python still has an important role.&lt;/p&gt;

&lt;p&gt;Use Python when you are training models, running notebooks, building custom ML pipelines, doing offline analytics, processing large data science workloads, experimenting with open-source models, or building specialized NLP and computer vision systems.&lt;/p&gt;

&lt;p&gt;But do not use Python only because the industry got used to saying “AI equals Python.”&lt;/p&gt;

&lt;p&gt;If all you need is LLM calls, embeddings, RAG, vector search, agents, tool calling, and business workflow orchestration, Laravel is now a serious option.&lt;/p&gt;

&lt;p&gt;And in many product teams, it may be the cleaner option.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;The future of AI in business applications is not a chatbot sitting somewhere beside the product.&lt;/p&gt;

&lt;p&gt;The future is AI built directly into the workflows people already use.&lt;/p&gt;

&lt;p&gt;In eCommerce, that means an assistant that understands product catalogs, inventory, return rules, and what the customer is actually trying to buy.&lt;/p&gt;

&lt;p&gt;In booking platforms, it means an assistant that can read availability, pricing rules, cancellation policies, time slots, and user constraints before suggesting the next step.&lt;/p&gt;

&lt;p&gt;In payments, banking, or brokerage products, it means AI that can explain failures, prepare safe actions, clarify intent, and support decisions without bypassing validation, permissions, or compliance.&lt;/p&gt;

&lt;p&gt;That kind of AI does not need to live in a separate Python bridge by default.&lt;/p&gt;

&lt;p&gt;It needs to live close to your models, policies, queues, APIs, transactions, logs, permissions, and users.&lt;/p&gt;

&lt;p&gt;In other words, production AI needs to live inside the application layer where your business logic already works.&lt;/p&gt;

&lt;p&gt;For PHP and Laravel teams, that changes the conversation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One codebase.&lt;/li&gt;
&lt;li&gt;One language.&lt;/li&gt;
&lt;li&gt;One deployment pipeline.&lt;/li&gt;
&lt;li&gt;One observability stack.&lt;/li&gt;
&lt;li&gt;One place for business rules, permissions, and audit logs.&lt;/li&gt;
&lt;li&gt;Zero unnecessary bridge services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuj8o2yu46vrqdpu701jg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuj8o2yu46vrqdpu701jg.png" alt="Production AI embedded inside the application workflow" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kill the unnecessary Python bridge.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not because Python is bad.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;_But because production AI belongs where your product logic, user data, permissions, APIs, and business workflows already live.&lt;br&gt;
_&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>architecture</category>
      <category>development</category>
      <category>php</category>
    </item>
  </channel>
</rss>
