Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module integrates Drupal with PostgreSQL using the pgvector extension to enable vector searches for AI Search and other compatible modules. It handles creating tables, indexing and deleting data, and performing vector searches with or without filters, as well as basic PostgreSQL queries.

The Postgres VDB Provider is a database module that works together with the AI module, to allow you to do vector searches with AI Search or other modules that implement it.

The module provides integration with a Postgres database using pgvector, a vector database, and the AI module.

This module provides features such as creating the tables to store vectors and other indexed fields, the indexing of data, the deletion of indexed data, vector searches with and without filters and a basic Postgres query search.

Features

Postgres is a powerful, open source object-relational database system with a strong reputation for reliability, feature robustness, and performance. It is supported already by the majority of cloud providers and can easily be run locally.

Using the open source extension pgvector, Postgres can store and search upon vectors.

The open source nature and wide availability of this vector database management solution makes this a good candidate, especially for small to medium sized vector databases.

This module currently provides features such as creating the tables to store vectors and other indexed fields, the indexing of data, the deletion of indexed data, vector searches with and without filters and a non-vector query search.

Installation

Use composer to install this module and its dependencies.

Post-Installation

  • Enable the module
  • Configure the database connection
    • /admin/config/ai/vdb_providers/postgres
  • Create the Search API server
    • /admin/config/search/search-api/add-server
    • Select AI Search as the Backend
    • Configure the backend
      • Select Postgres vector DB as the Vector Database
      • Enter the database name
      • Enter the collection name (main table name)
      • Select the similarity metric to use in vector searches
      • Configure the rest of the AI Search backend as desired (see AI Search documentation)
      • When saved this will attempt to create the collection main table
  • Setup an index that uses the new server and configure as desired (see AI Search documentation)

Additional Requirements

  • PHP extension pgsql enabled on the web server
  • AI module
  • AI Search module
  • Key module
  • Search API module

Roadmap/TODO

  • Handle the changes to the table schema better
    • Work out where we can make these schema changes but keep user data for as long as possible
    • Potentially look to search_api_db to see how it solves this problem
    • Currently tables may have to be dropped by clearing the index for big schema changes
  • Investigate if this can use core’s db connection
  • Lots of calls are made to sanitise what could be user input, can these calls be cached for performance
  • Tests
  • Support for facets

Similar projects

Other AI Search VDB providers:

Thanks

Thanks to the maintainers of the AI and AI Search modules for building the underlying infrastructure.

Activity

Total releases
3
First release
May 2025
Latest release
2 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.0-alpha3 Pre-release Apr 23, 2026
1.0.0-alpha2 Pre-release May 27, 2025
1.0.0-alpha1 Pre-release May 14, 2025