apache / apache/flink-agents

[Feature] Add PostgreSQL pgvector vector store (Java)

Open
#1,102 1 comment 0 reactions 1 assignee Claimed by @purushah View on GitHub
Dominant language
Java
Stars
452
Forks
167
Avg merge
5d 9h
Merged PRs (30d)
49

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/flink-agents/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?

- [x] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.