Skip to content

[Feature] Add PostgreSQL pgvector vector store (Java) #1102

Description

@purushah

Search before asking

  • I searched in the issues and found nothing similar.

Description

Motivation

Vector stores are first-class resources since #143. Java ships Elasticsearch, OpenSearch, Milvus and S3 Vectors; Python ships Chroma and Mem0. PostgreSQL with the pgvector extension is missing in both languages, although it is one of the most common self-hosted backends and is often already present in an organization. It supports cosine, L2 and inner-product distance with HNSW indexes, and stores metadata as jsonb, which maps directly onto the unified equality filter DSL.

Proposed changes

  • New module integrations/vector-stores/pgvector with PgVectorVectorStore implementing BaseVectorStore and CollectionManageableVectorStore, following MilvusVectorStore. Only new dependency is the PostgreSQL JDBC driver.
  • Arguments follow the existing stores: uri, username, password, collection (table name), dims, metric_type (COSINE, L2, IP), index_type, index_params.
  • Semantic query only. Equality filters compile to a jsonb containment predicate. Score semantics documented per metric.
  • Python callers use the existing JavaVectorStore wrapper. ResourceName constants, YAML aliases and docs added in both languages.
  • Live tests gated by an environment variable, with a docker-compose file and a CI job mirroring the Elasticsearch one.

Out of scope: keyword and hybrid query modes, halfvec, a Python-native implementation.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions