Environment variables reference
Environment inputs recognized by Python MemorySettings and its optional integrations. All declared child fields are listed, including settings that the current MemoryClient does not automatically consume; those limits are stated explicitly.
This page is long; jump straight to a prefix instead of scrolling:
| Section | Variable prefix |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Declared fields the client does not apply automatically |
|
|
|
A complete |
|
|
Loading and precedence
NAM_GROUP__FIELD maps to settings.group.field. Constructor values override process environment, then .env, configured file secrets, and defaults. Arrays/dictionaries use JSON. Unknown nested fields in a recognized group are validation errors. See Configuration sources.
Use lowercase true/false for booleans and quote JSON lists in a shell. Do not mix a top-level provider string with nested fields for that same provider; use a constructed provider when you need its additional options.
| Variable | Default | Behavior |
|---|---|---|
|
Unset |
|
|
Implicit OpenAI config |
Provider string, for example |
|
Resolved from extraction requirements |
Provider string, for example |
NAMS process aliases
These aliases are read from process environment after settings-source loading. Use the NAM_NAMS__… form in a dotenv file unless your application explicitly loads that file into process environment.
| Alias | Default | Behavior |
|---|---|---|
|
Unset |
Populates an unset NAMS key. A populated key selects NAMS when backend is not pinned. |
|
Unset |
Overrides the default NAMS endpoint if endpoint was not explicitly set. |
|
Unset |
Populates an unset workspace ID, sent as X-Workspace-Id. Workspace access is determined by your credentials. |
export MEMORY_API_KEY=nams_example_replace_with_your_key
export NAM_BACKEND=nams
export NAM_NAMS__TIMEOUT=60
Neo4j connection
NAM_NEO4J__ prefix. All scalar-valued; none need JSON encoding.
| Variable | Default | Meaning |
|---|---|---|
|
|
Neo4j connection URI |
|
|
Neo4j username |
|
required |
Neo4j password |
|
|
Neo4j database name |
|
|
Maximum connection pool size |
|
|
Connection timeout in seconds |
|
|
Maximum transaction retry time in seconds |
|
|
Maximum lifetime of a pooled connection in seconds |
|
|
Seconds a connection can be idle before a liveness check |
|
|
Enable TCP keep-alive on connections |
See Neo4j connection for the Python kwarg names and constraints.
NAMS connection
NAM_NAMS__ prefix. NAM_NAMS__HEADERS is a JSON object, for example NAM_NAMS__HEADERS='{"X-Trace-Id": "abc"}'.
| Variable | Default | Meaning |
|---|---|---|
|
Base URL |
|
|
unset |
NAMS API key ( |
|
unset |
Sent as |
|
|
HTTP request timeout in seconds |
|
|
Max retry attempts for 429/5xx/network errors |
|
|
Base exponential backoff between retries |
|
|
Extra HTTP headers added to every request |
|
|
Probe an authenticated connection when connecting |
|
|
|
See NAMS connection for the full field table.
Embedding configuration
NAM_EMBEDDING__ prefix, legacy nested-provider settings — provider strings/instances use adapter-specific configuration instead (see Adapters). All fields are scalar-valued.
| Variable | Default | Meaning |
|---|---|---|
|
|
Embedding provider to use |
|
|
Embedding model name |
|
|
Embedding dimensions |
|
unset |
API key for embedding provider |
|
|
Batch size for embeddings |
|
|
Device for sentence transformers (cpu/cuda) |
|
unset |
GCP project ID for Vertex AI |
|
|
GCP region for Vertex AI |
|
|
Vertex AI task type |
|
unset (768 for Vertex AI) |
Vertex AI output dimensionality |
|
unset |
AWS region for Bedrock |
|
unset |
AWS credentials profile name |
See Embedding configuration for the full field table.
LLM configuration
NAM_LLM__ prefix, legacy nested-provider settings — provider strings/instances use adapter-specific configuration instead. All fields are scalar-valued.
| Variable | Default | Meaning |
|---|---|---|
|
|
LLM provider to use |
|
|
LLM model name |
|
unset |
API key for LLM provider |
|
|
LLM temperature — not automatically applied by MemoryClient |
|
|
Maximum tokens for LLM — not automatically applied by MemoryClient |
See LLM configuration for the full field table and the temperature / max_tokens integration limit.
Graph schema configuration
NAM_SCHEMA_CONFIG__ prefix. NAM_SCHEMA_CONFIG__ENTITY_TYPES is a JSON array, for example NAM_SCHEMA_CONFIG__ENTITY_TYPES='["PERSON", "ORGANIZATION"]'. On bolt these fields select the ontology the client extracts and validates against, resolved once per connection.
| Variable | Default | Meaning |
|---|---|---|
|
|
Schema model ( |
|
unset |
Custom entity types (overrides model default when model=custom) |
|
|
Whether to track entity subtypes — not automatically applied by MemoryClient |
|
|
Selects |
|
unset |
Schema file ( |
|
unset |
Ontology document ( |
|
|
Adopt the ontology version activated in the database |
|
|
Built-in template used as the final fallback |
|
unset |
|
|
|
Allow the one-time |
See Graph schema configuration for the full field table, the ontology precedence, and the remaining integration limit.
Extraction configuration
NAM_EXTRACTION__ prefix. NAM_EXTRACTION__ENTITY_TYPES is a JSON array. The GLINER_* names keep their spelling but configure GLiNER2.5 (the gliner2 extra). There are no batch or streaming fields in this settings group — those are method arguments, not environment variables; GLINER_MAX_WORDS and GLINER_CHUNK_OVERLAP only window long input inside the GLiNER2.5 stage.
| Variable | Default | Meaning |
|---|---|---|
|
|
Type of entity extractor ( |
|
|
Enable spaCy in extraction pipeline |
|
|
Enable the GLiNER2.5 stage in the extraction pipeline |
|
|
Enable LLM as fallback in pipeline |
|
|
Strategy for merging results from multiple extractors |
|
|
Continue to next stage if current stage returns no results |
|
|
spaCy model name |
|
|
Default confidence score for spaCy extractions |
|
|
GLiNER2.5 checkpoint ( |
|
|
GLiNER2.5 entity confidence threshold |
|
unset |
Confidence floor for decoded relations |
|
|
Device for the GLiNER2.5 model (cpu/cuda/mps) |
|
unset |
Built-in domain template (poleo, podcast, news, scientific, business, entertainment, medical, legal); replaces the resolved ontology for GLiNER2.5 |
|
|
Longest input decoded in one pass; longer text is windowed |
|
|
Word overlap between windows |
|
unset |
Span-overlap policy for the attribute pass ( |
|
|
Run the opt-in attribute pass for the ontology’s enum properties |
|
|
Load the GLiNER2.5 weights in fp16 |
|
|
Run the GLiNER2.5 weights through |
|
|
LLM model for extraction |
|
|
Entity types for the LLM extractor (POLE+O by default) |
|
|
Whether to extract relations |
|
|
Whether to extract preferences |
|
|
Floor applied to the merged result of |
See Extraction configuration for the full field table.
Resolution configuration
NAM_RESOLUTION__ prefix. All scalar-valued. NAM_RESOLUTION__EMBEDDING_THRESHOLD and NAM_RESOLUTION__MATCH_SAME_TYPE_ONLY are not valid fields; the semantic threshold field is NAM_RESOLUTION__SEMANTIC_THRESHOLD. Deduplication thresholds live here too: AUTO_MERGE_THRESHOLD and REVIEW_THRESHOLD band both message ingestion and long_term.add_entity.
| Variable | Default | Meaning |
|---|---|---|
|
|
Resolution strategy ( |
|
|
Exact match threshold |
|
|
Fuzzy match threshold |
|
|
Semantic match threshold |
|
|
Fuzzy matching scorer — not forwarded by MemoryClient |
|
|
Resolve extracted mentions while storing a message; the single opt-out for ingest-time resolution |
|
|
Merge a mention onto the match at or above this score |
|
|
Store the mention plus a pending |
|
|
Blocking candidates per mention and per bucket |
|
|
Use the ontology’s |
|
|
Also block via the entity vector index (needs an embedder) |
|
|
Half-width of the mention context window used in scoring |
|
|
|
See Resolution configuration for the full field table.
Memory behavior
NAM_MEMORY__ prefix. All fields are scalar-valued.
| Variable | Default | Meaning |
|---|---|---|
|
|
Default conversation message limit — not automatically applied by MemoryClient |
|
|
Enable message embeddings — not automatically applied by MemoryClient |
|
|
Preference confidence threshold — not automatically applied by MemoryClient |
|
|
Enable fact deduplication — not automatically applied by MemoryClient |
|
|
Enable reasoning trace embeddings — not automatically applied by MemoryClient |
|
|
Enable tool usage statistics — not automatically applied by MemoryClient |
|
|
Require |
|
|
|
|
|
Maximum in-flight buffered writes |
|
unset |
TTL value for |
|
|
Audit preference for |
See Memory behavior for the full field table, including write_mode/max_pending (buffered writes) and the integration limits on the remaining fields.
Search configuration
NAM_SEARCH__ prefix. All scalar-valued; none are automatically read by the memory stores.
| Variable | Default | Meaning |
|---|---|---|
|
|
Default search limit |
|
|
Default similarity threshold |
|
|
Enable hybrid search |
|
|
Graph traversal depth for search |
See Search configuration for the full field table.
Geocoding configuration
NAM_GEOCODING__ prefix. All fields are scalar-valued.
| Variable | Default | Meaning |
|---|---|---|
|
|
Enable automatic geocoding of Location entities |
|
|
Geocoding provider to use ( |
|
unset |
API key for geocoding provider (required for Google) |
|
|
Cache geocoding results to avoid repeated API calls |
|
|
Client request rate limit for the configured geocoder |
|
|
User-Agent sent by the configured geocoder |
See Geocoding configuration for the full field table.
Enrichment configuration
NAM_ENRICHMENT__ prefix. NAM_ENRICHMENT__PROVIDERS and NAM_ENRICHMENT__ENTITY_TYPES are JSON arrays, for example NAM_ENRICHMENT__PROVIDERS='["wikimedia", "diffbot"]'.
| Variable | Default | Meaning |
|---|---|---|
|
|
Enable automatic entity enrichment |
|
|
Enrichment providers to use, in priority order |
|
unset |
API key for Diffbot Knowledge Graph |
|
|
Seconds between Wikimedia API requests |
|
|
Seconds between Diffbot API requests |
|
|
Cache enrichment results to avoid repeated API calls |
|
|
Hours to cache enrichment results |
|
|
Run enrichment in background (non-blocking) |
|
|
Maximum enrichment queue size |
|
|
Maximum retry attempts for failed enrichments |
|
|
Delay between retry attempts |
|
|
Entity types to enrich (empty = all types) |
|
|
Minimum entity confidence to trigger enrichment |
|
|
Preferred language for enrichment data |
|
|
User-Agent for API requests |
See Enrichment configuration for the full field table.
Integration limits
The declared field inventory above is not an assertion of runtime wiring. See Configuration integration limits for provider, method-default, schema, TTL, and auditing behavior. The settings family is NAM_RESOLUTION__SEMANTIC_THRESHOLD; NAM_RESOLUTION__EMBEDDING_THRESHOLD and NAM_RESOLUTION__MATCH_SAME_TYPE_ONLY are invalid fields.
There are no NAM_DEDUPLICATION__..., NAM_OBSERVABILITY__..., or NAM_CLI__... settings groups; variables with those prefixes are ignored. Set deduplication thresholds with NAM_RESOLUTION__AUTO_MERGE_THRESHOLD and NAM_RESOLUTION__REVIEW_THRESHOLD. Batch sizes/concurrency/chunk sizes for extraction belong to method arguments, not ExtractionConfig environment fields.
CLI and provider environment
These inputs are consumed by command options or external provider adapters rather than becoming nested MemorySettings fields. Provider-specific availability depends on the installed extra.
| Variable | Consumer |
|---|---|
|
CLI connection options (database is an MCP serve option). The Python settings family instead uses NAM_NEO4J__… and USERNAME. |
|
MCP serve |
|
MCP serve LLM API-key override; not a MemorySettings field. |
|
OpenAI adapters/embedder when no explicit key is supplied. |
|
Anthropic adapter when no explicit key is supplied. |
|
Bedrock region/profile selection and AWS SDK configuration. |
|
AWS SDK credential chain. |
|
Google SDK application-default credentials when using Vertex AI. |
|
Google geocoder key. There is no automatic GOOGLE_GEOCODING_API_KEY fallback; pass that application variable explicitly if you use it. |
|
Opik SDK credentials for the configured tracer. |
|
External OpenTelemetry exporter convention. The SDK tracer requires an explicit endpoint argument to create an exporter; the variable alone does not enable export. |
The CLI does not automatically load .neo4j-memory.yaml. Review CLI reference for exact flags, including NAMS backend options.
Example dotenv configuration
Copy the credentials from the Aura connection setup.
This example uses the SDK’s native NAM_NEO4J__… fields; the tutorial’s helper explicitly maps its NEO4J_* variables to these settings. Plain NEO4J_* keys are not automatic MemorySettings aliases.
NAM_BACKEND=bolt
NAM_NEO4J__URI="neo4j+s://<instance-id>.databases.neo4j.io"
NAM_NEO4J__USERNAME=neo4j
NAM_NEO4J__PASSWORD=replace-with-your-Aura-password
NAM_NEO4J__DATABASE=neo4j
NAM_EXTRACTION__EXTRACTOR_TYPE=pipeline
NAM_EXTRACTION__ENABLE_SPACY=true
NAM_EXTRACTION__ENABLE_GLINER=true
NAM_EXTRACTION__ENABLE_LLM_FALLBACK=false
NAM_EXTRACTION__GLINER_MODEL=fastino/gliner2.5-base-v1
NAM_EXTRACTION__GLINER_SCHEMA=podcast
NAM_RESOLUTION__RESOLVE_ON_INGEST=true
NAM_ENRICHMENT__ENABLED=false
NAM_GEOCODING__ENABLED=false
Test harness switches
Test-only inputs such as RUN_INTEGRATION_TESTS, SKIP_INTEGRATION_TESTS, AUTO_START_DOCKER, and AUTO_STOP_DOCKER belong to the test harness, not the SDK configuration API. Read the relevant test fixture before relying on their parsing or defaults.