Class: PostgresVectorStore
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:73
Interface
IVectorStore
Description
Defines the contract for interacting with a specific vector database or storage backend. Implementations will wrap specific clients (e.g., Pinecone client, Weaviate client, in-memory store logic).
Implements
Constructors
Constructor
new PostgresVectorStore(
config):PostgresVectorStore
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:79
Parameters
config
Returns
PostgresVectorStore
Methods
checkHealth()
checkHealth():
Promise<{details?:any;isHealthy:boolean; }>
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:146
IVectorStore-compliant health check.
Returns
Promise<{ details?: any; isHealthy: boolean; }>
Implementation of
close()
close():
Promise<void>
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:118
Close the connection pool.
Returns
Promise<void>
createCollection()
createCollection(
name,dimension,options?):Promise<void>
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:158
Create a new collection (Postgres table) with pgvector HNSW index.
Parameters
name
string
dimension
number
options?
Returns
Promise<void>
Implementation of
delete()
delete(
collectionName,ids?,options?):Promise<DeleteResult>
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:533
Delete documents by ID.
Parameters
collectionName
string
ids?
string[]
options?
Returns
Promise<DeleteResult>
Implementation of
dropCollection()
dropCollection(
name):Promise<void>
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:214
Drop a collection table.
Parameters
name
string
Returns
Promise<void>
fetchByIds()
fetchByIds(
collectionName,ids,options?):Promise<RetrievedVectorDocument[]>
Defined in: packages/agentos/src/cognition/rag/vector_stores/PostgresVectorStore.ts:361
Fetch rows by primary key without similarity ranking. Used by
HybridSearcher to hydrate sparse-only RRF winners — a second
similarity query would return the next-K dense rows, not the
specific BM25 winners, and would misattribute rows under the
wrong fused-score position.
Returns an empty array for an empty id list without firing SQL.
similarityScore is set to 0 as a sentinel.
Parameters
collectionName
string
ids
string[]
options?
includeMetadata?
boolean