Back to articles
AI & Cloud

Build AI-Powered E-Commerce Search with Typesense and VPS: Low-Cost, High-Performance Solution

A technical guide to building an AI-powered e-commerce search system using Typesense and VPS, optimized for cost, performance, and scalability for small and medium enterprises.

DPTCloud Engineering4 min read
Build AI-Powered E-Commerce Search with Typesense and VPS: Low-Cost, High-Performance Solution

Introduction: Smart Search for E-Commerce with AI and Typesense

In the digital era, search experience on e-commerce websites plays a critical role in retaining customers and increasing conversion rates. A smart, fast, and accurate search system not only improves user experience but also boosts revenue. With AI advancements, small and medium enterprises (SMEs) can now build AI-powered search systems without high cloud platform costs. This guide shows how to build a self-hosted e-commerce search system using Typesense—an open-source, ultra-fast search engine—on a VPS to optimize cost and performance.

Requirements and System Architecture

To implement this solution, you need:

  • A VPS (Cloud VPS) with at least 4GB RAM and 50GB SSD storage.
  • Operating system: Ubuntu 22.04 LTS or Debian 11.
  • Typesense (open-source, supports fast search and AI query processing).
  • API backend (Node.js or Python) to connect with Typesense.
  • E-commerce application (e.g., WordPress, Shopify, or custom web app).

The solution uses a self-hosted architecture, allowing businesses full control over data, cost, and performance. Typesense functions as a dedicated search engine, supporting keyword search, semantic analysis (AI-powered), and real-time result delivery.

Implementation: Deploying Typesense on VPS

First, install Typesense on your VPS. Here are the basic steps:

# Install Typesense on Ubuntu
curl -sS https://download.typesense.org/install.sh | bash

# Start the service
sudo systemctl start typesense-server
sudo systemctl enable typesense-server

# Check status
sudo systemctl status typesense-server

After installation, access the admin interface at http://:8108.

To integrate with your e-commerce app, create a schema for products:


{
  "name": "products",
  "fields": [
    { "name": "id", "type": "string" },
    { "name": "name", "type": "string", "facet": true },
    { "name": "description", "type": "string" },
    { "name": "category", "type": "string", "facet": true },
    { "name": "price", "type": "float" },
    { "name": "brand", "type": "string", "facet": true }
  ]
}

Insert product data into Typesense via API:

POST /collections/products/documents
{
  "id": "1001",
  "name": "Men's Cotton T-Shirt",
  "description": "High-quality cotton t-shirt with good elasticity",
  "category": "Men's Clothing",
  "price": 299000,
  "brand": "ABC"
}

Optimizing Performance and Cost

To ensure high performance and low cost, apply these solutions:

Verification and Testing

To verify the system works correctly:

  • Perform a search query: GET /collections/products/documents/search?q=men's t-shirt
  • Ensure results return accurately and quickly (under 100ms).
  • Assess performance using tools like ab or wrk.

Alternative Solutions and Scalability

If your business needs to scale, consider:

  • Adding AI-powered query understanding using small models like DeepSeek R1 15B8B quantized for VPS deployment.
  • Integrating with WindmillDev to automate search data updates.

Conclusion

Building an AI-powered e-commerce search system with Typesense and VPS enables businesses to optimize costs, enhance performance, and maintain data control. With a self-hosted architecture, this solution is ideal for SMEs seeking smart search capabilities without relying on expensive cloud platforms.

For more information on VPS optimization for AI and API, explore these articles:

Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478