// Character model and character knowledge enum ImportSourceType { file url manual } enum ImportStatus { pending processing completed failed } model Character { id String @id @default(uuid()) name String avatarUrl String? personalityPrompt String attributes Json @default("{}") config Json @default("{}") isPublic Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade) conversations Conversation[] knowledgeSources CharacterKnowledge[] vectorMemories VectorMemory[] @@index([userId]) @@index([name]) } model CharacterKnowledge { id String @id @default(uuid()) name String sourceType ImportSourceType sourceName String mimeType String? fileSize BigInt? rawContent String? status ImportStatus @default(pending) processingInfo Json? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt characterId String character Character @relation(fields: [characterId], references: [id], onDelete: Cascade) vectorMemories VectorMemory[] @@index([characterId]) @@index([status]) }