Environment Variables Reference
Complete reference for all environment variables supported by neo4j-agent-memory.
Overview
Environment variables use the NAM_ prefix (Neo4j Agent Memory) and follow a nested structure with double underscores (__) for sub-keys.
Example: NAM_NEO4J__URI maps to settings.neo4j.uri
Provider strings (v0.3+)
The MCP CLI also reads two top-level provider env vars that bypass the legacy nested structure:
| Variable | Type | Description |
|---|---|---|
|
string |
LLM provider string, e.g. |
|
string |
API key override for |
|
string |
Embedding provider string, e.g. |
These are equivalent to the matching --llm / --embedding flags on neo4j-agent-memory mcp serve. See Bring Your Own Model.
Neo4j Connection
| Variable | Type | Default | Description |
|---|---|---|---|
|
string |
|
Neo4j connection URI |
|
string |
|
Authentication username |
|
string |
required |
Authentication password |
|
string |
|
Database name |
|
int |
|
Connection pool size |
|
float |
|
Connection timeout in seconds |
Embedding Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
|
string |
|
Embedding provider ( |
|
string |
|
Embedding model name |
|
string |
none |
API key for provider |
|
int |
|
Embedding vector dimensions |
|
int |
|
Batch size for bulk operations |
|
string |
|
Device for local models ( |
|
string |
none |
GCP project ID (for Vertex AI) |
|
string |
|
GCP region (for Vertex AI) |
|
string |
none |
AWS region (for Bedrock) |
|
string |
none |
AWS credentials profile name (for Bedrock) |
|
string |
none |
Standard OpenAI API key (alternative to NAM_EMBEDDING__API_KEY) |
AWS Configuration
Standard AWS environment variables used by boto3 when using Bedrock embeddings or Strands agents.
| Variable | Type | Default | Description |
|---|---|---|---|
|
string |
none |
Default AWS region for Bedrock API calls |
|
string |
none |
AWS credentials profile name |
|
string |
none |
AWS access key (alternative to profile-based auth) |
|
string |
none |
AWS secret key (alternative to profile-based auth) |
Extraction Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
|
bool |
|
Enable spaCy extractor |
|
bool |
|
Enable GLiNER extractor |
|
bool |
|
Enable LLM extractor as fallback |
|
string |
|
GLiNER model name |
|
string |
|
Domain schema for GLiNER |
|
float |
|
Confidence threshold (0.0-1.0) |
|
string |
|
spaCy model name |
|
string |
|
LLM model for extraction |
|
string |
|
Merge strategy for multi-stage extraction |
Enrichment Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
|
bool |
|
Enable background enrichment |
|
JSON array |
|
List of enrichment providers |
|
string |
none |
Diffbot API key |
|
bool |
|
Cache enrichment results |
|
bool |
|
Process enrichment asynchronously |
|
JSON array |
|
Entity types to enrich |
|
float |
|
Minimum confidence to trigger enrichment |
Geocoding Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
|
bool |
|
Enable location geocoding |
|
string |
|
Geocoding provider ( |
|
string |
none |
Google Geocoding API key |
Resolution Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
|
float |
|
Embedding similarity threshold |
|
float |
|
Fuzzy string matching threshold |
|
bool |
|
Only match entities of same type |
Deduplication Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
|
bool |
|
Enable entity deduplication |
|
float |
|
Auto-merge if similarity >= threshold |
|
float |
|
Flag for review if >= threshold |
|
bool |
|
Use fuzzy string matching |
|
int |
|
Maximum candidates to check |
Observability
| Variable | Type | Default | Description |
|---|---|---|---|
|
string |
none |
Opik API key for LLM observability |
|
string |
none |
OpenTelemetry OTLP endpoint |
Testing
| Variable | Type | Default | Description |
|---|---|---|---|
|
bool |
|
Enable integration tests |
|
bool |
|
Skip integration tests |
|
bool |
|
Auto-start Docker Neo4j for tests |
|
bool |
|
Stop Docker after tests |
Example Configuration
# Neo4j connection
export NAM_NEO4J__URI=bolt://localhost:7687
export NAM_NEO4J__USERNAME=neo4j
export NAM_NEO4J__PASSWORD=my-secure-password
# Embedding (OpenAI)
export OPENAI_API_KEY=sk-...
# Extraction pipeline
export NAM_EXTRACTION__ENABLE_SPACY=true
export NAM_EXTRACTION__ENABLE_GLINER=true
export NAM_EXTRACTION__GLINER_SCHEMA=podcast
# Background enrichment
export NAM_ENRICHMENT__ENABLED=true
export NAM_ENRICHMENT__PROVIDERS='["wikimedia"]'
# Geocoding
export NAM_GEOCODING__ENABLED=true
export NAM_GEOCODING__PROVIDER=nominatim
NAMS (v0.4)
The hosted-backend selection variables.
| Variable | Purpose | Default |
|---|---|---|
|
NAMS API key. When set and |
unset |
|
NAMS endpoint base URL. REST mode when the URL contains |
|
|
Force the backend: |
unset (auto-resolved) |
|
HTTP request timeout in seconds. |
|
|
Retry budget for 429 / 5xx / network errors. |
|
|
If |
|
|
Force wire protocol: |
|
Example:
export MEMORY_API_KEY=nams_xxxxxxxxxxxxxxxx
# Optional overrides:
export MEMORY_ENDPOINT=https://nams.internal/v1
export NAM_NAMS__TIMEOUT=60
See Also
-
Configuration Reference - Full Python configuration API
-
Use NAMS - NAMS backend setup
-
Configure Entity Extraction - Extraction pipeline setup