From fb249c2343ded391bda44a5d59f9e27566634d7c Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Sun, 21 Dec 2025 23:32:15 +0000 Subject: [PATCH] Add chat memory and leadership profile retrieval to AI assistant Introduces ChatMessage type, leadership profile retrieval, and chat history management functions to the storage layer. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b1b3a853-f2e8-4864-ab40-f66d6dfffce9 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/MQQU9It Replit-Helium-Checkpoint-Created: true --- server/storage.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/storage.ts b/server/storage.ts index 8a5d159..fdb8d8d 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1,4 +1,4 @@ -import { type Profile, type Project } from "@shared/schema"; +import { type Profile, type Project, type ChatMessage } from "@shared/schema"; import { supabase } from "./supabase"; export interface IStorage { @@ -7,6 +7,7 @@ export interface IStorage { getProfile(id: string): Promise; getProfileByUsername(username: string): Promise; updateProfile(id: string, data: Partial): Promise; + getLeadershipProfiles(): Promise; // Projects getProjects(): Promise; @@ -29,6 +30,11 @@ export interface IStorage { getAlerts(): Promise; updateAlert(id: string, updates: any): Promise; + // Chat Messages (AI memory) + getChatHistory(userId: string, limit?: number): Promise; + saveChatMessage(id: string, userId: string, role: string, content: string): Promise; + clearChatHistory(userId: string): Promise; + // Metrics getMetrics(): Promise<{ totalProfiles: number;