Class PgvectorVectorIndex
java.lang.Object
com.tnsai.intelligence.rag.vector.PgvectorVectorIndex
- All Implemented Interfaces:
com.tnsai.memory.advanced.VectorIndex
public final class PgvectorVectorIndex
extends Object
implements com.tnsai.memory.advanced.VectorIndex
pgvector-backed
VectorIndex.
Opens only when tnsai.vector.pgvector.url (or
TNSAI_VECTOR_PGVECTOR_URL) is set. The PostgreSQL JDBC driver
is never a required dependency: SQL is spoken through
PgvectorTransport.
Bindings pass separate namespace and ownership scopes. Corpora with the
same configuration may share a physical table, while each live
provider-created engine receives a lifecycle-unique row owner. Role-bound
owners remain deterministic for restart visibility. clear() deletes
only that owner's rows and never drops the table.
- Since:
- 0.14.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPgvectorVectorIndex(PgvectorTransport transport, PgvectorTransport.Config config) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()static Optional<PgvectorVectorIndex> static Optional<PgvectorVectorIndex> configured(String scope) Opens a live JDBC index namespaced toscope.static booleanbooleanstatic StringscopedTable(String base, String scope) List<com.tnsai.memory.advanced.ScoredEntry> searchByVector(float[] queryVector, int topK) intsize()void
-
Field Details
-
URL_PROPERTY
System property that enables the adapter.- See Also:
-
URL_ENV
Environment variable that enables the adapter.- See Also:
-
TABLE_PROPERTY
System property for the table name.- See Also:
-
DEFAULT_TABLE
Default table when none is configured.- See Also:
-
-
Constructor Details
-
PgvectorVectorIndex
-
-
Method Details
-
configured
-
configured
Opens a live JDBC index namespaced toscope.- Parameters:
scope- binding identity and source set, ornullfor the shared standalone table- Returns:
- empty when pgvector is not configured
-
isConfigured
public static boolean isConfigured() -
scopedTable
-
upsert
- Specified by:
upsertin interfacecom.tnsai.memory.advanced.VectorIndex
-
remove
- Specified by:
removein interfacecom.tnsai.memory.advanced.VectorIndex
-
clear
public void clear()- Specified by:
clearin interfacecom.tnsai.memory.advanced.VectorIndex
-
size
public int size()- Specified by:
sizein interfacecom.tnsai.memory.advanced.VectorIndex
-
searchByVector
- Specified by:
searchByVectorin interfacecom.tnsai.memory.advanced.VectorIndex
-