WPSolr logo
Search
Close this search box.

Table of contents :

GPT embeddings with Vector search for WordPress

Neon AI on a keyboard

Table of contents :

GPT is the most widely used AI model today. But what if you wanted to use these same vectors (or embeddings) for your AI search?

You could use OpenAI’s (or “GPT”) embedding models to generate embeddings and then store these GPT embeddings in a vector database solution like Weaviate, which offers a straightforward method for integrating OpenAI vectorizers. This allows you to efficiently incorporate GPT embeddings into your AI search engine or vector database. You can choose between three models : text-embedding-3-small, text-embedding-3-large and ada v2.

 

This guide will explain how you could add this AI search with GPT embeddings to your WordPress (or even Woocommerce) website.

 

Why use GPT embeddings ?

 

OpenAI provides the most widely used model today so why not use their optimized embedding models. This will ensure among other things that the embedding model you use has been trained on sufficiently diverse and quality data.

 

If you check out the official huggingface benchmark for text embedding models, you will see that the OpenAI “text-embedding-3-large” ranks 9th when it comes to retrieval (with a MTEB score of 55.44).

 

How to add OpenAI GPT embeddings to your AI search ?

 

Setup Weaviate

 

Weaviate has a module called text2vec-openai that is designed for generating and obtaining vectors using OpenAI.

 

You can set up Weaviate locally easily using our guide. But instead of using the text2vec-transformers module in the docker-compose file, you should add the text2vec-openai module :

version: '3.4'
services:
  weaviate:
    image: cr.weaviate.io/semitechnologies/weaviate:1.24.5
    restart: on-failure:0
    ports:
     - 8080:8080
     - 50051:50051
    environment:
      QUERY_DEFAULTS_LIMIT: 20
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: "./data"
      ENABLE_MODULES: text2vec-openai
      DEFAULT_VECTORIZER_MODULE: text2vec-openai
      OPENAI_APIKEY: $OPENAI_KEY
      CLUSTER_HOSTNAME: 'node1'

 

Add Weaviate AI search to your WordPress using WPSolr

 

If you want to add Weaviate AI search to your WordPress with no required programming knowledge, you should use WPSolr. WPSolr is a search and recommendations plugin that can integrate many engines (Apache Solr, Elasticsearch, Opensearch, Algolia, Weavaite, Google Retail, Recombee, Vespa) into any WordPress & Woocommerce website to add invaluable features such as search, Ajax search, facets, RAG, recommendations and much more.

 

You can then check out our documentation on how to use OpenAI GPT embeddings for your WordPress search using WPSolr and Weaviate.

Trending posts