diff --git a/.env.template b/.env.template index c6194a64e..4e9e16e8c 100644 --- a/.env.template +++ b/.env.template @@ -7,26 +7,26 @@ GRAPHISTRY_PASSWORD= SENTRY_REPORTING_URL= -GRAPH_DATABASE_PROVIDER="neo4j" # "neo4j" or "networkx" +# "neo4j" or "networkx" +GRAPH_DATABASE_PROVIDER="neo4j" # Not needed if using networkx GRAPH_DATABASE_URL= GRAPH_DATABASE_USERNAME= GRAPH_DATABASE_PASSWORD= -VECTOR_ENGINE_PROVIDER="qdrant" # or "qdrant", "pgvector", "weaviate" or "lancedb" +# "qdrant", "pgvector", "weaviate" or "lancedb" +VECTOR_ENGINE_PROVIDER="qdrant" # Not needed if using "lancedb" or "pgvector" VECTOR_DB_URL= VECTOR_DB_KEY= -# Needed if using "pgvector" -VECTOR_DB_NAME= -# Relational Database provider -DB_PROVIDER="sqlite" # "sqlite" or "postgres" +# Relational Database provider "sqlite" or "postgres" +DB_PROVIDER="sqlite" -# Relational Database name +# Database name DB_NAME=cognee_db -# Postgres specific parameters (Only if Postgres or PGVector is run) +# Postgres specific parameters (Only if Postgres or PGVector is used) DB_HOST=127.0.0.1 DB_PORT=5432 DB_USERNAME=cognee diff --git a/cognee/infrastructure/databases/vector/config.py b/cognee/infrastructure/databases/vector/config.py index 5e403c92e..8137a067c 100644 --- a/cognee/infrastructure/databases/vector/config.py +++ b/cognee/infrastructure/databases/vector/config.py @@ -10,7 +10,6 @@ class VectorConfig(BaseSettings): ) vector_db_key: str = "" vector_engine_provider: str = "lancedb" - vector_db_name: str = "cognee_vector_db" model_config = SettingsConfigDict(env_file = ".env", extra = "allow") @@ -19,7 +18,6 @@ class VectorConfig(BaseSettings): "vector_db_url": self.vector_db_url, "vector_db_key": self.vector_db_key, "vector_db_provider": self.vector_engine_provider, - "vector_db_name": self.vector_db_name, } @lru_cache diff --git a/cognee/infrastructure/databases/vector/create_vector_engine.py b/cognee/infrastructure/databases/vector/create_vector_engine.py index 58e6dbf03..134a8e9fc 100644 --- a/cognee/infrastructure/databases/vector/create_vector_engine.py +++ b/cognee/infrastructure/databases/vector/create_vector_engine.py @@ -6,7 +6,6 @@ class VectorConfig(Dict): vector_db_url: str vector_db_key: str vector_db_provider: str - vector_db_name: str def create_vector_engine(config: VectorConfig, embedding_engine): if config["vector_db_provider"] == "weaviate": @@ -38,10 +37,8 @@ def create_vector_engine(config: VectorConfig, embedding_engine): db_password = relational_config.db_password db_host = relational_config.db_host db_port = relational_config.db_port - - # Get name of vector database - db_name = config["vector_db_name"] - + db_name = relational_config.db_name + connection_string: str = f"postgresql+asyncpg://{db_username}:{db_password}@{db_host}:{db_port}/{db_name}" return PGVectorAdapter(connection_string,