mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 10:45:42 +01:00
feat(nodestore): add Postgres for the doc and index store (#1706)
* Adding Postgres for the doc and index store * Adding documentation. Rename postgres database local->simple. Postgres storage dependencies * Update documentation for postgres storage * Renaming feature to nodestore * update docstore -> nodestore in doc * missed some docstore changes in doc * Updated poetry.lock * Formatting updates to pass ruff/black checks * Correction to unreachable code! * Format adjustment to pass black test * Adjust extra inclusion name for vector pg * extra dep change for pg vector * storage-postgres -> storage-nodestore-postgres * Hash change on poetry lock
This commit is contained in:
parent
d17c34e81a
commit
68b3a34b03
9 changed files with 225 additions and 25 deletions
|
|
@ -108,6 +108,10 @@ class VectorstoreSettings(BaseModel):
|
|||
database: Literal["chroma", "qdrant", "pgvector"]
|
||||
|
||||
|
||||
class NodeStoreSettings(BaseModel):
|
||||
database: Literal["simple", "postgres"]
|
||||
|
||||
|
||||
class LlamaCPPSettings(BaseModel):
|
||||
llm_hf_repo_id: str
|
||||
llm_hf_model_file: str
|
||||
|
|
@ -249,7 +253,7 @@ class UISettings(BaseModel):
|
|||
)
|
||||
|
||||
|
||||
class PGVectorSettings(BaseModel):
|
||||
class PostgresSettings(BaseModel):
|
||||
host: str = Field(
|
||||
"localhost",
|
||||
description="The server hosting the Postgres database",
|
||||
|
|
@ -270,14 +274,17 @@ class PGVectorSettings(BaseModel):
|
|||
"postgres",
|
||||
description="The database to use to connect to the Postgres database",
|
||||
)
|
||||
schema_name: str = Field(
|
||||
"public",
|
||||
description="The name of the schema in the Postgres database to use",
|
||||
)
|
||||
|
||||
|
||||
class PGVectorSettings(PostgresSettings):
|
||||
embed_dim: int = Field(
|
||||
384,
|
||||
description="The dimension of the embeddings stored in the Postgres database",
|
||||
)
|
||||
schema_name: str = Field(
|
||||
"public",
|
||||
description="The name of the schema in the Postgres database where the embeddings are stored",
|
||||
)
|
||||
table_name: str = Field(
|
||||
"embeddings",
|
||||
description="The name of the table in the Postgres database where the embeddings are stored",
|
||||
|
|
@ -350,7 +357,9 @@ class Settings(BaseModel):
|
|||
openai: OpenAISettings
|
||||
ollama: OllamaSettings
|
||||
vectorstore: VectorstoreSettings
|
||||
nodestore: NodeStoreSettings
|
||||
qdrant: QdrantSettings | None = None
|
||||
postgres: PostgresSettings | None = None
|
||||
pgvector: PGVectorSettings | None = None
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue