Building the AI Layer Behind a Live Marketplace Without Touching Checkout

The marketplace was already live and taking payments, which ruled out rebuilding it. The AI layer runs as a separate FastAPI service, so models can change without redeploying the code that handles checkout.

Start your project

The build

This is the AI and machine learning service that sits behind Legiit, the services marketplace.

It has no interface of its own. The Laravel, React and Next.js applications call it, and it handles chat, retrieval over marketplace data, site crawls, content generation, recommendations and automated moderation. Aipxperts built it over roughly twenty-one months as a separate Python service alongside the existing PHP product.

The problem

The marketplace was live, taking payments, and running on a conventional Laravel stack. The AI ambition was substantial: a chatbot that could answer real questions about orders and services, a crawl pipeline that could audit any customer website, generated business insights, recommendations, and automated review of new listings and members. None of that fits comfortably inside a PHP request cycle.

Inference is slow and memory-heavy relative to a marketplace page load, and the two workloads scale on completely different curves.

Crawling a customer's website takes minutes, which no synchronous web request can absorb.

The AI stack needed Python libraries, LangChain, HuggingFace embeddings, a vector database, that have no equivalent in the existing environment.

Model choice was going to change, repeatedly, and each change could not mean redeploying the application that handles money.

There was also a quality problem waiting. A general-purpose model asked about a specific order on a specific marketplace will produce a confident and wrong answer, which for a support surface is worse than no answer.

What we built

We built the AI capability as its own FastAPI service in Python, with Kafka carrying work between it and the marketplace, and Milvus holding vector representations of marketplace data.

Marketplace chatbot with Milvus retrieval

Answers questions about orders, services, courses and common issues by retrieving from marketplace data rather than generating from general knowledge.

Website crawl and audit pipeline

SSL, SEO, health and PageSpeed checks run through Lambda crawlers and Kafka consumers, returned as grouped insights rather than a raw findings dump.

Business insight generation

SWOT summaries, brand voice analysis, customer avatar generation and growth task suggestions, produced from a customer's own site and profile data.

Content tooling

Content clusters, social post generation, cart recommendations and a review assistant, served through the same API.

Automated listing and member review

First-pass AI moderation of new services and members, which took a recurring manual queue off the operations team.

Claude MCP integration over OAuth

Model Context Protocol access to catalogue, orders and campaigns, letting an assistant work against marketplace data through a defined interface rather than scraped endpoints.

Multi-provider model routing

OpenAI GPT-4.1 and 4o, Google Gemini through Vertex AI, and Anthropic Claude, with HuggingFace embeddings, all reachable from the same service.

The outcome

The architectural result is the one worth stating. The marketplace and the AI layer now scale, deploy and fail independently. A model swap, a crawl backlog or an inference slowdown does not touch checkout, which is what made it safe to keep adding AI capability to a product with live paying customers.

70%
of support requests now resolved without a person.
Near-instant
response time on those requests, down from four to eight hours.
6 to 4
people needed on the support team.
70 to 80%
of reviewed AI answers accepted without correction.
Before
search for services in one place, guess at SEO fixes in separate tools, and approve listings manually.
After
a customer connects a site, the platform flags issues and opportunities, recommends or hires a seller against each finding, and runs chat, content and moderation from the same service.

Tools and Technologies

Python
FastAPI
LangChain
Milvus
Kafka
Docker
AWS Lambda
Vertex AI
OpenAI
Anthropic Claude
HuggingFace

Planning something similar?

If you want AI inside a product that is already live and taking money, the architecture question comes before the model question.

Start the conversation