Database & Data Management
Database Schema
Core Tables
LLMConversation
Conversation metadata.
| Column | Description |
|---|---|
id |
Primary key |
userId |
User identifier |
userCompanyId |
Company identifier |
title |
Conversation title |
entityType |
Entity type |
sessionId |
Session identifier |
conversationSource |
Source platform |
createdAt, updatedAt |
Timestamps |
LLMConversationMessage
Individual messages.
| Column | Description |
|---|---|
id |
Primary key |
llmConversationId |
Parent conversation |
externalMessageId |
External platform message ID |
parentMessageId |
Thread parent |
userPrompt |
User's input |
structuredUserPrompt |
Processed prompt |
llmParsedOutput |
AI response |
llmTaskId |
Associated task |
entityType, entityId |
Related entity |
language |
Detected language |
LLMTask
AI processing tasks.
| Column | Description |
|---|---|
id |
Primary key |
status |
Task status |
llmSettingsId |
Settings reference |
llmRawPrompt |
Raw prompt |
llmStructuredPrompt |
Structured prompt |
llmRawOutput |
Raw AI output |
llmStructuredOutput |
Structured output |
totalInputTokens |
Input token count |
totalOutputTokens |
Output token count |
totalTokens |
Total tokens |
errorMessage |
Error if failed |
LLMAgentImport
File import tracking.
| Column | Description |
|---|---|
id |
Primary key |
userId, userCompanyId |
User info |
inputFileName, inputFileUrl |
Input file |
outputFormat, outputFileUrl |
Output file |
outputContent |
Processed content |
processingStatus |
Status |
errorMessage |
Error if failed |
commercialImportId |
Commercial API reference |
LLMAgentInstallation
Platform installations.
| Column | Description |
|---|---|
id |
Primary key |
companyId |
Company identifier |
platform |
Platform name |
enabled |
Is enabled |
settings |
Platform settings (JSON) |
createdAt, updatedAt |
Timestamps |
Data Flow
- Message Reception - Platform-specific webhooks receive messages
- User Validation - Verify user exists in system database
- Conversation Management - Find or create conversation records
- Message Processing - Process content through AI pipeline
- Response Generation - Generate and send responses
- Persistence - Save conversation history and usage metrics