Skip to main content

agrag.graphdb.settings.Neo4jSettings

Bases: BaseSettings

Neo4j connection configuration.

Attributes:

  • uri (str) – The Bolt connection URI, including scheme (neo4j+s:// for Aura). Env: NEO4J_URI.
  • username (str) – The database username. Env: NEO4J_USERNAME.
  • password (SecretStr) – The database password. Env: NEO4J_PASSWORD.
  • database (str) – The target database name. Env: NEO4J_DATABASE.
  • max_connection_lifetime (int) – The maximum seconds a pooled connection lives, kept well below Aura's roughly five-minute idle timeout. Env: NEO4J_MAX_CONNECTION_LIFETIME.

Raises:

  • ValueError – uri is plaintext (bolt:// or neo4j://) and points at a non-local host. Neo4j always authenticates with a password, so a plaintext scheme always sends it in the clear; use neo4j+s:// (or bolt+s://) for a remote instance.

database​

database: str = 'neo4j'

max_connection_lifetime​

max_connection_lifetime: int = 240

model_config​

model_config = SettingsConfigDict(env_prefix='NEO4J_', env_file='.env', extra='ignore', hide_input_in_errors=True)

password​

password: SecretStr = SecretStr('neo4j')

uri​

uri: str = 'bolt://localhost:7687'

username​

username: str = 'neo4j'