Postgres

Perform similarity searches with persistent Postgres storage

Uses Postgres with pgvector for production-grade vector similarity search.

Installation

pip install "psycopg[binary,pool]" pgvector
uv add 'psycopg[binary,pool]' pgvector

Usage

from dapr_agents.storage.vectorstores import PostgresVectorStore
from dapr_agents.document.embedder.openai import OpenAIEmbedder  # Replace with your embedding model

store = PostgresVectorStore(
    connection_string="postgresql://user:pass@localhost:5432/mydb",
    embedding_function=OpenAIEmbedder(),
    embedding_dimensions=1536,
)