Skip to article
CogniTech.Docs

Neon database architecture

Logical tables, ownership, ordered conversations and graph version relationships.

On this page

Versioned SQL migrations define the application schema. The Neon serverless driver provides HTTP queries and a pooled client for explicit multi-statement transactions. This reference describes logical public-facing behavior and contains no real user records.

Users, sessions, and messages

TableKey and relationshipPurpose
usersUUID primary key, unique wallet addressVerified wallet identity
auth_challengesUUID primary key and wallet scopeExpiring single-use nonce digest and consumption status
auth_sessionsUUID primary key, user foreign keyToken digest, expiration and revocation
user_chat_sessionsUUID primary key, user foreign keyTitle and activity timestamps
chat_messagesUUID primary key, session foreign keyRole, sequence, content, state, response_blocks JSONB, feedback and provider metadata
chat_actionsUUID primary key, unique message foreign keyLocal action identifier and application state
chat_tool_callsUUID primary key, message foreign keySafe tool status and metadata
chat_message_sourcesUUID primary key, message foreign keyCitation order, title, normalized URL, optional excerpt and publication time
ai_usage_logsUUID primary key, user/session/message referencesReported model and tool usage
cogni_chat_requestsCompound request ownership key and session referenceIdempotent conversation creation
Logical foreign-key relationships
  1. users
  2. user_chat_sessions
  3. chat_messages
  4. chat_actions
  1. chat_messages
  2. chat_tool_calls and chat_message_sources
  1. users
  2. user_strategies
  3. strategy_versions
  4. strategy_runs
  5. strategy_run_steps

Message sequence numbers are unique inside a conversation. The application queries with owner constraints and orders history by sequence; database IDs do not themselves confer access.

Strategies

TableKey and relationshipPurpose
user_strategiesUUID primary key, user foreign key, unique user/request pairJSONB draft, revision, status and timestamps
strategy_versionsUUID primary key, strategy foreign key, unique strategy/version numberVersioned graph snapshots and change summaries
strategy_runsUUID primary key, strategy/version/user referencesNode or workflow test state and sanitized aggregate summary
strategy_run_stepsUUID primary key, run foreign key, unique run/node pairExecution order, node type, state and sanitized summaries
strategy_ai_usageUUID primary key, user foreign key and optional strategy referenceModel, operation, usage, latency

Private Gloam notes, passwords, receiving keys and payroll settlement journals are not database tables in Neon. See browser encryption and Neon documentation.