Skip to main content

Memory Types

Z3rno implements a biologically-inspired four-tier memory model. Each tier has distinct storage characteristics, access patterns, and retention policies.

Working Memory

Working memory holds the ephemeral context for the current task. It is session-scoped, meaning it is created when a session starts and discarded when the session ends.
  • Storage: Valkey (in-memory)
  • Latency: Sub-millisecond
  • Retention: Auto-expires when the session ends or after a configurable idle timeout
  • Use case: Tracking the current conversation turn, intermediate reasoning steps, tool call results

Episodic Memory

Episodic memory stores conversation history and event sequences. Think of it as the agent’s autobiographical memory.
  • Storage: PostgreSQL with temporal indexing
  • Latency: Low single-digit milliseconds
  • Retention: Configurable TTL (default: 30 days). Older episodes decay based on importance score.
  • Use case: Conversation logs, interaction history, temporal queries

Semantic Memory

Semantic memory stores facts, knowledge, and user preferences. This is the agent’s long-term knowledge base.
  • Storage: PostgreSQL with pgvector (vector similarity search)
  • Latency: Single-digit milliseconds (vector index lookup)
  • Retention: Long-lived. No default TTL.
  • Use case: User preferences, learned facts, domain knowledge, entity attributes

Procedural Memory

Procedural memory stores learned behaviours, workflow patterns, and decision rules. This is the agent’s muscle memory.
  • Storage: PostgreSQL with Apache AGE (graph relationships)
  • Latency: Low single-digit milliseconds (graph traversal)
  • Retention: Permanent. Procedural memories are never auto-expired.
  • Use case: Learned workflows, decision trees, behavioural patterns, tool usage sequences

Comparison

Memory Transitions

Memories naturally flow between tiers:
  1. Working to Episodic: When a session ends, relevant working memories are consolidated into episodic memories.
  2. Episodic to Semantic: Repeated patterns across episodes are summarised and promoted to semantic memory.
  3. Episodic to Procedural: Learned behaviours extracted from episode sequences are stored as procedural memory.
These transitions can happen automatically (via the memory lifecycle engine) or explicitly (via API calls). See Memory Lifecycle for details.