CREATE MEMORY
Enterprise command reference.
Command Snapshot
| Field | Value |
|---|---|
| Category | Platform Extensions |
| Mutates Data | Yes/Depends |
| Scope | Cluster / Object |
| Privilege Model | Requires administrative or feature-specific governance/cluster privileges. |
Purpose
Defines, changes, or removes schema and metadata objects.
Syntax
CREATE MEMORY [IF NOT EXISTS] memory_name [WITH (...)]
Operational Notes
- Use schema-qualified identifiers in automation and automation pipelines.
- Validate behavior in staging for cluster-impacting or governance-impacting changes.
- Confirm runtime effects through system tables and metrics before and after execution.
When to Use
- Use for graph, memory, governance, and licensing lifecycle management.
- Use when feature-specific metadata and policy controls are required.
When Not to Use
- Avoid enabling strict enforcement modes before validation and staged verification.
Common Errors and Troubleshooting
| Symptom | Likely Cause | Action |
|---|---|---|
| Permission denied / unauthorized | Missing privilege on object or cluster scope | Re-run with required grants or elevated admin role. |
| Analysis/parse error | Syntax variant or object shape mismatch | Compare with canonical syntax and object definition. |
| Runtime failure under load | Resource limits, breaker pressure, or node state transitions | Check sys.jobs, sys.operations, sys.checks, and retry after mitigation. |
Cross-References
Detailed Reference
Creates a memory namespace for short-lived key/value state.
SQL Statement
CREATE MEMORY [IF NOT EXISTS] memory_name [WITH (...)]
Parameters
memory_name: Memory namespace identifier.WITH (...): Common options includestrict,entry_ttl_ms, andmax_entries.
Privileges
Requires DDL privilege for memory objects.
Example
CREATE MEMORY session_store
WITH (strict = true, entry_ttl_ms = 3600000, max_entries = 1000);
SELECT memory_name, options['strict'], options['entry_ttl_ms'], options['max_entries']
FROM memory.memories
WHERE memory_name = 'session_store';
Notes
- Use
strict = truefor bounded-write behavior under capacity constraints. - Query and mutate entries through
memory.memory_entries.