Neo4j and NAMS connection settings
Backend connection configuration for Configuration reference: the bolt Neo4jConfig and the hosted NamsConfig. See Environment variables for the NAM_GROUP__FIELD mapping.
Neo4j connection
Bolt only. Standalone Neo4jConfig requires a password; the implicit MemorySettings factory supplies an empty string. Supply valid credentials before connecting. URI schemes and connection permissions are determined by your Neo4j deployment.
| Field | Type / values | Default | Constraints | Env var | Description |
|---|---|---|---|---|---|
|
|
|
— |
|
Neo4j connection URI |
|
|
|
— |
|
Neo4j username |
|
|
|
— |
|
Neo4j password |
|
|
|
— |
|
Neo4j database name |
|
|
|
ge 1 |
|
Maximum connection pool size |
|
|
|
gt 0 |
|
Connection timeout in seconds |
|
|
|
gt 0 |
|
Maximum transaction retry time in seconds |
|
|
|
gt 0 |
|
Maximum lifetime of a pooled connection in seconds. Connections older than this are proactively closed and replaced. Should be shorter than the server’s idle timeout (e.g., Neo4j Aura). |
|
|
|
gt 0 |
|
Seconds a connection can be idle before the driver checks if it is still alive. Prevents use of stale connections. |
|
|
|
— |
|
Enable TCP keep-alive on connections to prevent idle drops. |
NAMS connection
NAMS only. This config controls HTTP transport, not server extraction settings. Pin NamsSettings to avoid accidental backend selection. The transport_mode="bridge" option is intended for conformance/reference implementations.
from neo4j_agent_memory import NamsSettings
settings = NamsSettings(nams={"timeout": 60.0, "retry_backoff_seconds": 0.5})
The example takes its API key from the environment; see Use NAMS.
| Field | Type / values | Default | Constraints | Env var | Description |
|---|---|---|---|---|---|
|
|
|
— |
|
Base URL. Auto transport uses REST for a URL containing /v followed by digits; otherwise it uses the conformance bridge. |
|
|
|
— |
|
NAMS API key (format 'nams_…'). When constructed via MemorySettings, an unset value may be populated from MEMORY_API_KEY. |
|
|
|
— |
|
Sent as X-Workspace-Id when set. Use the workspace authorized by your credentials; the workspace is the tenancy boundary. |
|
|
|
gt 0 |
|
HTTP request timeout in seconds. |
|
|
|
ge 0 |
|
Max retry attempts for 429 (after Retry-After), 5xx, and network errors. |
|
|
|
gt 0 |
|
Base exponential backoff between retries (0.5 → 0.5, 1.0, 2.0…). |
|
|
|
— |
|
Extra HTTP headers added to every request (e.g. tracing headers). |
|
|
|
— |
|
Make an authenticated connection probe when connecting. Disabling it defers failures until the first request. |
|
|
|
— |
|
Wire-protocol override. 'auto' (default) infers from endpoint shape. |