Skip to content

About

PostgreSQL pgvector provider for AI search.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AI Search Provider PGVector

PostgreSQL pgvector provider for the Backdrop CMS AI Search module. Stores and queries embeddings directly in your existing PostgreSQL database using the pgvector extension, eliminating the need for a separate vector database service.

Requirements

  • Backdrop CMS 1.x
  • PHP 8.2 or later
  • ai_search module
  • PostgreSQL with the pgvector extension installed
  • The pgvector extension must be enabled in your database: CREATE EXTENSION IF NOT EXISTS vector;
  • The PHP pdo_pgsql extension

Installation

Configuration

  1. Enable this module.
  2. Go to Admin -> Configuration -> Search and Metadata -> Search API and create or edit a server.
  3. Select PGVector as the service backend.
  4. Configure the server settings:
    • Host, Port (default 5432), Database, Username, Password — connection to the PostgreSQL server that has pgvector enabled. Host and database are required.
    • Connection timeout — seconds to wait for the connection (default 5).
    • SSL mode — optional PostgreSQL sslmode.
    • Schema — PostgreSQL schema to store vector tables in. Defaults to public.
    • Table name — Optional. Leave empty to auto-generate a per-index table name prefixed with search_vector_. A custom table name must be unique per Search API index.
    • Metric Type — Distance metric for nearest-neighbor search: COSINE (default), L2, or IP.
    • IVFFLAT lists — Number of inverted lists for the IVFFlat index. Defaults to 100. Run ANALYZE on the table after indexing for this setting to take effect.
    • Embeddings engine — Select the embedding model to use for generating vectors.
  5. Create a Search API index on that server.
  6. Index your content to populate the vector table.

Notes

  • This backend opens its own connection to a dedicated PostgreSQL server, so the site database can stay on MySQL or MariaDB.
  • The vector table and IVFFlat index are created automatically on first index run.
  • The embedding dimension is derived from the selected embeddings engine configuration.

Issues

Bugs and feature requests should be reported in the Issue Queue.

Current Maintainer

Justin Keiser

Credits

  • Created for Backdrop CMS by Justin Keiser.
  • Developed with AI assistance.

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.

About

PostgreSQL pgvector provider for AI search.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages