spring-projects / spring-projects/spring-ai

PgVectorStore queries customization.

Open
#6,832 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 10h
Merged PRs (30d)
5

Description

I want to extend PgVectorStore queries. (e.g. to limit searches only to vectors to which user has access to.)

example:
https://github.com/crystal-processes/crp-flowable-springboot-sample/blob/dbb541f931576e2a7149bc1aad8a6b27c935726c/src/main/java/org/springframework/ai/vectorstore/pgvector/IdentityAwarePgVectorStore.java#L353

Current Behavior
Current approach copies existing code of PgVectorStore to a new class.

Expected Behavior
Queries should be constructed by external configurable bean.

Context
I want to implement limitations on the top of PgVector similarity search queries to limit access to data.

How has this issue affected you?
I had to copy a lot of code.

What are you trying to accomplish?
Simplifying query construction.

What other alternatives have you considered?
I would expect alternatives as outcome of the discussion.
Are you aware of any workarounds?
yes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating PgVectorStore and its similarity-search query construction, then compare it with the referenced IdentityAwarePgVectorStore example. Determine the configurable extension point needed for access limitations; done means callers can customize query construction without copying the existing store implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql, spring
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.