Session and Window State Storage

Session History and Windows State are stored in a local database

Database

Database: PGLite (PostgreSQL in WebAssembly)

Table: ai_sessions

Location: ~/Library/Application Support/@preditor/electron/pglite-db/

Session Data Structure

Each session includes:

{
  id: string;              // Unique session ID
  workspacePath: string;   // Workspace this session belongs to
  provider: string;        // AI provider (claude, openai, etc.)
  model: string;           // Model ID
  sessionType: string;     // 'chat' or 'agent'
  messages: Message[];     // Conversation history
  documentContext: object; // Document that was active
  metadata: object;        // Custom metadata
  title: string;           // Session name
  draftInput: string;      // Unsaved user input
  createdAt: number;       // Creation timestamp
  updatedAt: number;       // Last update timestamp
}

Last updated