Configuration

This module contains functionality related to the the configuration module for embedding.vector_stores.pgvector.

Configuration

PGVectorStoreConfiguration

Bases: VectorStoreConfiguration

Configuration for PostgreSQL with pgvector extension as a vector store.

This class provides all necessary configuration parameters to connect to and operate with a PostgreSQL database using the pgvector extension.

Source code in src/embedding/vector_stores/pgvector/configuration.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class PGVectorStoreConfiguration(VectorStoreConfiguration):
    """Configuration for PostgreSQL with pgvector extension as a vector store.

    This class provides all necessary configuration parameters to connect to
    and operate with a PostgreSQL database using the pgvector extension.
    """

    class Secrets(BaseSecrets):
        """Secret credentials required for authenticating with the PostgreSQL database.

        Handles environment variable loading with the RAG__VECTOR_STORE__ prefix.
        """

        model_config = ConfigDict(
            env_file_encoding="utf-8",
            env_prefix="RAG__VECTOR_STORE__",
            env_nested_delimiter="__",
            extra="ignore",
        )

        username: SecretStr = Field(
            ..., description="Username for PostgreSQL database authentication."
        )
        password: SecretStr = Field(
            ..., description="Password for PostgreSQL database authentication."
        )

    name: Literal[VectorStoreName.PGVECTOR] = Field(
        ..., description="The identifier of the vector store, must be PGVECTOR."
    )
    database_name: str = Field(
        ..., description="Name of the PostgreSQL database to connect to."
    )
    embed_dim: int = Field(
        384,
        description="Dimension of the vector embeddings stored in pgvector.",
    )
    secrets: Secrets = Field(
        None,
        description="Authentication credentials for the PostgreSQL database.",
    )

Secrets

Bases: BaseSecrets

Secret credentials required for authenticating with the PostgreSQL database.

Handles environment variable loading with the RAG__VECTOR_STORE__ prefix.

Source code in src/embedding/vector_stores/pgvector/configuration.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Secrets(BaseSecrets):
    """Secret credentials required for authenticating with the PostgreSQL database.

    Handles environment variable loading with the RAG__VECTOR_STORE__ prefix.
    """

    model_config = ConfigDict(
        env_file_encoding="utf-8",
        env_prefix="RAG__VECTOR_STORE__",
        env_nested_delimiter="__",
        extra="ignore",
    )

    username: SecretStr = Field(
        ..., description="Username for PostgreSQL database authentication."
    )
    password: SecretStr = Field(
        ..., description="Password for PostgreSQL database authentication."
    )