Connect Qdrant

Qdrant is one of the two vector databases KimaAI works with, next to Pinecone. KimaAI turns your pages and posts into vectors and stores them there; the chatbot then searches them to answer from your content. This guide creates a Qdrant cluster and connects it to KimaAI.

Qdrant’s screens change from time to time, so the steps at Qdrant are described in words, with links to Qdrant’s own documentation, which stays up to date.

Before you start

  • Vector databases need KimaAI Pro. On the free plugin, the Qdrant card under Connections says Needs Pro.
  • An AI environment for the embeddings, the step that turns your content into vectors: see Get an OpenAI API key.

Create the cluster at Qdrant

  1. Sign in to Qdrant Cloud, or create an account, and create a cluster: see Create a cluster and the Qdrant Cloud quickstart.
  2. Copy the cluster’s URL, its endpoint.
  3. Create an API key for the cluster and copy it: see Authentication.

KimaAI also connects to a Qdrant server you run yourself: use its address, and the API key you set on it, if any. A server without a key needs none in KimaAI either.

You do not need to create a collection: KimaAI creates one for your site (see “How it works” below).

Connect it in KimaAI

  1. In the WordPress admin, go to Connections and open the Vector databases tab.
  2. Select Add embedding environment.
  3. Enter an Environment name you will recognise, and choose Qdrant as the Vector database provider.
  4. In Index host, paste the cluster’s URL, and paste its API key. For a server of your own without a key, leave API key empty.
  5. Leave Collection empty, unless you want to use a collection of your own.
  6. Under Connection test, select Test now.
  7. Open AI environment in the form, and choose the AI environment and the AI model that turn your content into vectors.
  8. Select Add.
A new Qdrant database under Connections → Vector databases
  1. Vector database provider: Qdrant.
  2. API key: the key of your Qdrant cluster; empty for a server of your own that runs without one.
  3. Index host: the URL of the cluster, or of your own Qdrant server.
  4. Collection: optional; empty, KimaAI uses a collection named after your site.
  5. Connection test: Connected means Qdrant accepted the address and the key, and that a Collection you entered exists.

The form has two more settings. WordPress environment says on which of your installs this database is used: only where WordPress runs as that environment (production, staging, development or local), so a staging copy of your site does not write into the database of your live site. Under Score, Min score leaves weak matches out of the searches, and Max results sets how many matches wp kimaai vectors query returns; see Embeddings.

Sync your content

The database is empty until you sync your content. Go to Knowledge → Sources and sync and sync your pages and posts, then switch on Answer from the knowledge base on Chatbot → Behaviour and choose this database as the Vector database. Knowledge base explains both steps.

How it works

  • The collection. With Collection empty, KimaAI uses a collection named after your site’s address, such as fernway-gardens-example, with the environment added outside production (fernway-gardens-example-staging). A successful connection test creates that collection in Qdrant when it does not exist yet, with 1536 dimensions.
  • A collection of your own. It must exist before you test and sync: the connection test fails when Qdrant has no collection of that name, and creates none. Create it at Qdrant, or on the Collections tab of Knowledge → Sources and sync with New collection. Its Dimension has to match the embedding model’s vectors, for example 1536 for text-embedding-3-small, as the admin notes there.
  • The AI environment. Left empty, KimaAI fills in the first AI environment that has a key when you save.
  • The key. Once saved, the key is never shown in the admin again. It stays with the provider and the address it was saved with: change the Index host or the provider, and you enter the key again.

Troubleshooting

  • The test fails. Check that Index host is the cluster’s full URL and that the API key belongs to that cluster, and that a Collection you entered exists. The message under Connection test says what Qdrant answered.
  • Test now cannot be selected. It needs an Environment name and an Index host first.
  • Nothing is synced on a staging site. The database is used only where WordPress runs as its WordPress environment. Add a second database for staging, or change the setting.

What are your feelings