📚 KB / Nexus Console / Redis Key Patterns
section

Redis Key Patterns

Redis Key Patterns Used in Console

Documentation of all Redis key patterns queried by Nexus Console.


User Environment (6610/6611)

User Data

user:{username}           # User account data (JSON)

Fields: - id - Stable user ID (u_XXXX) - pin - 4-digit PIN for auth - username - Username - created - Timestamp

Used By: Login authentication


Track Environment (6640/6641)

Projects

track:{user}:projects                    # Set of project IDs
track:{user}:{timestamp}:project:{id}    # Project data (JSON)

Project Fields: - id - Project ID (p_XXXX) - title - Project name - description - Project details - status - active | paused | completed | cancelled - created - Timestamp - updated - Timestamp

Tasks

track:{user}:{timestamp}:task:{id}       # Task data (JSON)

Task Fields: - id - Task ID (t_XXXX) - title - Task name - description - Task details - status - pending | active | in_progress | completed - parent_project - Project ID this task belongs to - created - Timestamp - updated - Timestamp

Queries: - Scan for all tasks: track:{user}:*:task:* - Filter by parent_project field


KB Environment (6625/6626)

KB Roots

kb:{user}:roots                          # Set of root node IDs
kb:{user}:all_nodes                      # Set of all node IDs

KB Nodes

kb:{user}:{timestamp}:node:{id}          # Node data (JSON)
kb:{user}:node:{id}                      # Alternative pattern
kb:{user}:node:{id}:children             # List of child IDs

Node Fields: - id - Node ID (UUID) - title - Node title - content - Markdown content - description - Short description - node_type - root | section | page - category - infrastructure | training | operations | etc. - parent_id - Parent node ID (null for roots) - depth - Nesting level - order - Sort order - path - Breadcrumb path array - tags - Array of tags - created - Timestamp - updated - Timestamp

Queries: - Find node: kb:{user}:*:node:{id} (scan with wildcard) - Get children: LRANGE on kb:{user}:node:{id}:children


Session Environment (6645/6646)

Current Session

sess:current:{user}                      # Current session ID (string)

Session Data

sess:s_{id}                              # Session data (hash) - new pattern
sess:{user}:{timestamp_suffix}           # Session data (JSON) - legacy

Hash Fields (New Pattern): - session_id - Full session ID with timestamp - stable_id - Stable ID (s_XXXX) - started - ISO timestamp - status - active | archived - title - Session title - owner_id - User ID - item_count - Number of work items

Legacy JSON Fields: - session_id - Session ID - created - Timestamp - objectives - Array of objectives

Session Items

session:{user}:{session_id}:items        # List of item IDs
session:{user}:item:{id}                 # Work item data (JSON)

Context Environment (6620/6621)

Notes

ctxt:{timestamp}:NOTE:{type}:{id}        # Note data (JSON)
ctxt:{timestamp}:NOTE:{type}:{id}:embedding     # Vector embedding (skip)
ctxt:{timestamp}:NOTE:{type}:{id}:timestamp     # Timestamp key (skip)

Note Fields: - id - Note ID (n_XXXX) - title - Note title - content - Note content - type - idea | voice | session - tags - Array of tags - timestamp - ISO timestamp - created - ISO timestamp - owner - User ID

Queries: - Scan pattern: ctxt:*:NOTE:* - Skip sub-keys containing :embedding or :timestamp


Chrono Environment (6680/6681)

Reminders

chrono:{user}:reminder:{id}              # Reminder data (JSON)

Reminder Fields: - id - Reminder ID (r_XXXX) - title - Reminder title - description - Details - due - Due datetime (ISO) - scheduled - Scheduled datetime (ISO) - status - pending | completed | dismissed - priority - high | medium | low - created - Timestamp

Events

chrono:{user}:event:{id}                 # Event data (JSON)

Event Fields: - id - Event ID (e_XXXX) - title - Event title - start - Start datetime (ISO) - end - End datetime (ISO) - scheduled - Scheduled datetime (ISO) - location - Event location - description - Details - attendees - Array of attendee IDs - status - pending | completed | cancelled - created - Timestamp


Contact Environment (6630/6631)

Contacts

contact:system:{timestamp}:contact:{id}  # Contact data (JSON) - new
contact:{user}:*                         # Contact data (JSON) - legacy

Contact Fields: - id - Contact ID (c_XXXX) - firstName - First name - lastName - Last name - fullName - Full name (computed) - name - Display name - company - Company name - email - Email address - phone - Phone number - category - client | partner | vendor | investor | lead | personal - notes - Additional notes - tags - Array of tags - created - Timestamp - updated - Timestamp - owner - User ID

Queries: - New pattern: contact:system:*:contact:c_* - Legacy pattern: contact:{user}:* - Skip index keys (contain 'index' or too short)


Query Strategies

Pattern Matching

Console uses Redis SCAN for pattern matching:

keys = r.scan_iter(pattern, count=limit)

Examples: - kb:{user}:*:node:{id} - Find KB node with timestamp variance - track:{user}:*:task:* - All tasks for user - sess:s_* - All stable session IDs

Set Operations

Some environments use sets for indexes:

members = r.smembers(f"track:{user}:projects")

List Operations

Children relationships use lists:

children = r.lrange(f"kb:{user}:node:{id}:children", 0, -1)

Performance Notes

  1. Read from Operational Ports - Console defaults to operational (odd) ports for reads
  2. Write to Vault Ports - API endpoints write to vault (even) ports
  3. SCAN Limits - Most scans use count=200 to avoid loading entire keyspace
  4. Result Limits - Most views limit to 50-100 items for performance

Migration Patterns

Some environments have evolved key patterns:

Session: - Old: sess:{user}:{timestamp} (JSON string) - New: sess:s_{id} (hash type)

Contact: - Old: contact:{user}:{timestamp}:{id} - New: contact:system:{timestamp}:contact:{id}

Console handles both patterns for backwards compatibility.

ID: b002e7dc Path: Nexus Console > Redis Key Patterns Updated: 2026-01-13T17:01:40