PostgreSQLDocumentStore
PostgreSQL-backed document store with pgvector.
Usage
PostgreSQLDocumentStore()Parameters
connection_string: str-
Database connection string.
embedding_dimension: int = 1536-
Dimensionality of embedding vectors.
Methods
| Name | Description |
|---|---|
| create_ivfflat_index() | Create an IVFFlat index for approximate search. |
| retrieve_nearest_neighbors() | Retrieve documents using nearest neighbor search. |
| upsert_with_embeddings() | Insert or update documents with precomputed embeddings. |
| vacuum_analyze_table() | Run VACUUM ANALYZE on the document table. |
create_ivfflat_index()
Create an IVFFlat index for approximate search.
Usage
create_ivfflat_index(num_lists=100)retrieve_nearest_neighbors()
Retrieve documents using nearest neighbor search.
Usage
retrieve_nearest_neighbors(embedding, top_k=10)upsert_with_embeddings()
Insert or update documents with precomputed embeddings.
Usage
upsert_with_embeddings(docs, embeddings)vacuum_analyze_table()
Run VACUUM ANALYZE on the document table.
Usage
vacuum_analyze_table()