conversation
Workspace API / types/conversation
types/conversation
Interfaces
Conversation
Defined in: types/conversation.ts:25
Conversation database model Matches app_data_conversations table schema
Extended by
Properties
conversation_id
conversation_id:
string
Defined in: types/conversation.ts:26
user_id
user_id:
string
Defined in: types/conversation.ts:27
organization_id
organization_id:
string
Defined in: types/conversation.ts:28
title
title:
string
Defined in: types/conversation.ts:29
project_id?
optionalproject_id:string|null
Defined in: types/conversation.ts:30
scope
scope:
ConversationScope
Defined in: types/conversation.ts:31
scope_ids
scope_ids:
string[]
Defined in: types/conversation.ts:32
agent_id
agent_id:
string
Defined in: types/conversation.ts:33
domain_key?
optionaldomain_key:string|null
Defined in: types/conversation.ts:34
created_at
created_at:
Date
Defined in: types/conversation.ts:35
updated_at
updated_at:
Date
Defined in: types/conversation.ts:36
deleted_at?
optionaldeleted_at:Date|null
Defined in: types/conversation.ts:37
ConversationWithSummary
Defined in: types/conversation.ts:44
Conversation with computed summary fields Result from app_data_get_conversation_summary function
Extends
Properties
conversation_id
conversation_id:
string
Defined in: types/conversation.ts:26
Inherited from
user_id
user_id:
string
Defined in: types/conversation.ts:27
Inherited from
organization_id
organization_id:
string
Defined in: types/conversation.ts:28
Inherited from
title
title:
string
Defined in: types/conversation.ts:29
Inherited from
project_id?
optionalproject_id:string|null
Defined in: types/conversation.ts:30
Inherited from
scope
scope:
ConversationScope
Defined in: types/conversation.ts:31
Inherited from
scope_ids
scope_ids:
string[]
Defined in: types/conversation.ts:32
Inherited from
agent_id
agent_id:
string
Defined in: types/conversation.ts:33
Inherited from
domain_key?
optionaldomain_key:string|null
Defined in: types/conversation.ts:34
Inherited from
created_at
created_at:
Date
Defined in: types/conversation.ts:35
Inherited from
updated_at
updated_at:
Date
Defined in: types/conversation.ts:36
Inherited from
deleted_at?
optionaldeleted_at:Date|null
Defined in: types/conversation.ts:37
Inherited from
message_count
message_count:
number
Defined in: types/conversation.ts:45
last_message_preview?
optionallast_message_preview:string|null
Defined in: types/conversation.ts:46
last_message_at?
optionallast_message_at:Date|null
Defined in: types/conversation.ts:47
ConversationSummaryData
Defined in: types/conversation.ts:53
Conversation summary fields for history context
Properties
summary_text?
optionalsummary_text:string|null
Defined in: types/conversation.ts:54
summary_updated_at?
optionalsummary_updated_at:Date|null
Defined in: types/conversation.ts:55
key_facts?
optionalkey_facts:Record<string,any> |null
Defined in: types/conversation.ts:56
summarized_turn_count?
optionalsummarized_turn_count:number|null
Defined in: types/conversation.ts:57
summary_user_confirmed?
optionalsummary_user_confirmed:boolean|null
Defined in: types/conversation.ts:58
summary_user_edited?
optionalsummary_user_edited:boolean|null
Defined in: types/conversation.ts:59
summary_confirmed_at?
optionalsummary_confirmed_at:Date|null
Defined in: types/conversation.ts:60
Message
Defined in: types/conversation.ts:67
Message database model Matches app_data_messages table schema
Properties
message_id
message_id:
string
Defined in: types/conversation.ts:68
conversation_id
conversation_id:
string
Defined in: types/conversation.ts:69
role
role:
MessageRole
Defined in: types/conversation.ts:70
content
content:
string
Defined in: types/conversation.ts:71
chunks?
optionalchunks:RAGChunk[] |null
Defined in: types/conversation.ts:72
thoughts?
optionalthoughts:ThoughtChunk[] |null
Defined in: types/conversation.ts:73
metadata?
optionalmetadata:MessageMetadata|null
Defined in: types/conversation.ts:74
error?
optionalerror:MessageError|null
Defined in: types/conversation.ts:75
created_at
created_at:
Date
Defined in: types/conversation.ts:76
RAGChunk
Defined in: types/conversation.ts:82
RAG chunk from document retrieval
Properties
chunk_id
chunk_id:
string
Defined in: types/conversation.ts:83
document_id
document_id:
string
Defined in: types/conversation.ts:84
document_filename?
optionaldocument_filename:string
Defined in: types/conversation.ts:86
Filename of the source document - may be undefined if not available
document_path?
optionaldocument_path:string
Defined in: types/conversation.ts:87
page_numbers?
optionalpage_numbers:number[]
Defined in: types/conversation.ts:89
Page numbers where the chunk appears - may be undefined for some documents
similarity
similarity:
number
Defined in: types/conversation.ts:90
text
text:
string
Defined in: types/conversation.ts:91
classification?
optionalclassification:"public"|"confidential"|"attorney_client_privileged"
Defined in: types/conversation.ts:92
viewer_url?
optionalviewer_url:string
Defined in: types/conversation.ts:93
ThoughtChunk
Defined in: types/conversation.ts:99
Chain-of-thought reasoning chunk (V2)
Properties
step
step:
number
Defined in: types/conversation.ts:100
reasoning
reasoning:
string
Defined in: types/conversation.ts:101
evidence
evidence:
string[]
Defined in: types/conversation.ts:102
confidence
confidence:
"high"|"medium"|"low"
Defined in: types/conversation.ts:103
MessageMetadata
Defined in: types/conversation.ts:109
Message metadata from RAG processing
Properties
traceId
traceId:
string
Defined in: types/conversation.ts:110
retrievalTimeMs?
optionalretrievalTimeMs:number
Defined in: types/conversation.ts:111
generationTimeMs?
optionalgenerationTimeMs:number
Defined in: types/conversation.ts:112
totalTimeMs?
optionaltotalTimeMs:number
Defined in: types/conversation.ts:113
chunkCount?
optionalchunkCount:number
Defined in: types/conversation.ts:114
enhancedQuery?
optionalenhancedQuery:string
Defined in: types/conversation.ts:115
agentId?
optionalagentId:string
Defined in: types/conversation.ts:116
promptVersion?
optionalpromptVersion:string
Defined in: types/conversation.ts:117
MessageError
Defined in: types/conversation.ts:123
Message error information
Properties
code
code:
string
Defined in: types/conversation.ts:124
message
message:
string
Defined in: types/conversation.ts:125
CreateConversationData
Defined in: types/conversation.ts:135
Data for creating a new conversation
Properties
user_id
user_id:
string
Defined in: types/conversation.ts:136
organization_id
organization_id:
string
Defined in: types/conversation.ts:137
title?
optionaltitle:string
Defined in: types/conversation.ts:138
project_id?
optionalproject_id:string
Defined in: types/conversation.ts:139
scope
scope:
ConversationScope
Defined in: types/conversation.ts:140
scope_ids
scope_ids:
string[]
Defined in: types/conversation.ts:141
agent_id?
optionalagent_id:string
Defined in: types/conversation.ts:142
domain_key?
optionaldomain_key:string|null
Defined in: types/conversation.ts:143
UpdateConversationData
Defined in: types/conversation.ts:149
Data for updating a conversation
Properties
title?
optionaltitle:string
Defined in: types/conversation.ts:150
project_id?
optionalproject_id:string|null
Defined in: types/conversation.ts:151
scope?
optionalscope:ConversationScope
Defined in: types/conversation.ts:152
scope_ids?
optionalscope_ids:string[]
Defined in: types/conversation.ts:153
agent_id?
optionalagent_id:string
Defined in: types/conversation.ts:154
domain_key?
optionaldomain_key:string|null
Defined in: types/conversation.ts:155
CreateMessageData
Defined in: types/conversation.ts:161
Data for creating a new message
Properties
message_id
message_id:
string
Defined in: types/conversation.ts:162
conversation_id
conversation_id:
string
Defined in: types/conversation.ts:163
role
role:
MessageRole
Defined in: types/conversation.ts:164
content
content:
string
Defined in: types/conversation.ts:165
chunks?
optionalchunks:RAGChunk[]
Defined in: types/conversation.ts:166
thoughts?
optionalthoughts:ThoughtChunk[]
Defined in: types/conversation.ts:167
metadata?
optionalmetadata:MessageMetadata
Defined in: types/conversation.ts:168
error?
optionalerror:MessageError
Defined in: types/conversation.ts:169
created_at?
optionalcreated_at:Date
Defined in: types/conversation.ts:170
ConversationFilters
Defined in: types/conversation.ts:176
Filters for listing conversations
Properties
user_id
user_id:
string
Defined in: types/conversation.ts:177
organization_id
organization_id:
string
Defined in: types/conversation.ts:178
project_id?
optionalproject_id:string
Defined in: types/conversation.ts:179
scope?
optionalscope:ConversationScope
Defined in: types/conversation.ts:180
include_deleted?
optionalinclude_deleted:boolean
Defined in: types/conversation.ts:181
limit?
optionallimit:number
Defined in: types/conversation.ts:182
offset?
optionaloffset:number
Defined in: types/conversation.ts:183
MessagePaginationOptions
Defined in: types/conversation.ts:189
Pagination options for messages
Properties
conversation_id
conversation_id:
string
Defined in: types/conversation.ts:190
limit?
optionallimit:number
Defined in: types/conversation.ts:191
before_message_id?
optionalbefore_message_id:string
Defined in: types/conversation.ts:192
CreateConversationRequest
Defined in: types/conversation.ts:202
Request body for creating a conversation
Properties
title?
optionaltitle:string
Defined in: types/conversation.ts:203
projectId?
optionalprojectId:string
Defined in: types/conversation.ts:204
scope
scope:
ConversationScope
Defined in: types/conversation.ts:205
scopeIds
scopeIds:
string[]
Defined in: types/conversation.ts:206
agentId?
optionalagentId:string
Defined in: types/conversation.ts:207
domainKey?
optionaldomainKey:string|null
Defined in: types/conversation.ts:208
UpdateConversationRequest
Defined in: types/conversation.ts:214
Request body for updating a conversation
Properties
title?
optionaltitle:string
Defined in: types/conversation.ts:215
AddMessageRequest
Defined in: types/conversation.ts:221
Request body for adding a message
Properties
messageId
messageId:
string
Defined in: types/conversation.ts:222
role
role:
MessageRole
Defined in: types/conversation.ts:223
content
content:
string
Defined in: types/conversation.ts:224
chunks?
optionalchunks:RAGChunk[]
Defined in: types/conversation.ts:225
thoughts?
optionalthoughts:ThoughtChunk[]
Defined in: types/conversation.ts:226
metadata?
optionalmetadata:MessageMetadata
Defined in: types/conversation.ts:227
error?
optionalerror:MessageError
Defined in: types/conversation.ts:228
createdAt?
optionalcreatedAt:string
Defined in: types/conversation.ts:229
SyncConversationRequest
Defined in: types/conversation.ts:235
Request body for sync endpoint
Properties
conversationId
conversationId:
string
Defined in: types/conversation.ts:236
messages
messages:
SyncMessageData[]
Defined in: types/conversation.ts:237
deletedMessageIds?
optionaldeletedMessageIds:string[]
Defined in: types/conversation.ts:238
SyncMessageData
Defined in: types/conversation.ts:244
Message data in sync request
Properties
messageId
messageId:
string
Defined in: types/conversation.ts:245
role
role:
MessageRole
Defined in: types/conversation.ts:246
content
content:
string
Defined in: types/conversation.ts:247
chunks?
optionalchunks:RAGChunk[]
Defined in: types/conversation.ts:248
thoughts?
optionalthoughts:ThoughtChunk[]
Defined in: types/conversation.ts:249
metadata?
optionalmetadata:MessageMetadata
Defined in: types/conversation.ts:250
error?
optionalerror:MessageError
Defined in: types/conversation.ts:251
createdAt
createdAt:
string
Defined in: types/conversation.ts:252
BulkSyncRequest
Defined in: types/conversation.ts:258
Bulk sync request for multiple conversations
Properties
conversations
conversations:
SyncConversationRequest[]
Defined in: types/conversation.ts:259
ConversationResponse
Defined in: types/conversation.ts:269
Conversation response for frontend
Extended by
Properties
id
id:
string
Defined in: types/conversation.ts:270
userId
userId:
string
Defined in: types/conversation.ts:271
organizationId
organizationId:
string
Defined in: types/conversation.ts:272
title
title:
string
Defined in: types/conversation.ts:273
projectId?
optionalprojectId:string|null
Defined in: types/conversation.ts:274
scope
scope:
ConversationScope
Defined in: types/conversation.ts:275
scopeIds
scopeIds:
string[]
Defined in: types/conversation.ts:276
agentId
agentId:
string
Defined in: types/conversation.ts:277
domainKey?
optionaldomainKey:string|null
Defined in: types/conversation.ts:278
messageCount
messageCount:
number
Defined in: types/conversation.ts:279
lastMessage?
optionallastMessage:string|null
Defined in: types/conversation.ts:280
lastMessageAt?
optionallastMessageAt:string|null
Defined in: types/conversation.ts:281
createdAt
createdAt:
string
Defined in: types/conversation.ts:282
updatedAt
updatedAt:
string
Defined in: types/conversation.ts:283
MessageResponse
Defined in: types/conversation.ts:289
Message response for frontend
Properties
id
id:
string
Defined in: types/conversation.ts:290
conversationId
conversationId:
string
Defined in: types/conversation.ts:291
role
role:
MessageRole
Defined in: types/conversation.ts:292
content
content:
string
Defined in: types/conversation.ts:293
chunks?
optionalchunks:RAGChunk[]
Defined in: types/conversation.ts:294
thoughts?
optionalthoughts:ThoughtChunk[]
Defined in: types/conversation.ts:295
metadata?
optionalmetadata:MessageMetadata
Defined in: types/conversation.ts:296
error?
optionalerror:MessageError
Defined in: types/conversation.ts:297
createdAt
createdAt:
string
Defined in: types/conversation.ts:298
ConversationWithMessagesResponse
Defined in: types/conversation.ts:304
Conversation with messages response
Extends
Properties
id
id:
string
Defined in: types/conversation.ts:270
Inherited from
userId
userId:
string
Defined in: types/conversation.ts:271
Inherited from
organizationId
organizationId:
string
Defined in: types/conversation.ts:272
Inherited from
ConversationResponse.organizationId
title
title:
string
Defined in: types/conversation.ts:273
Inherited from
projectId?
optionalprojectId:string|null
Defined in: types/conversation.ts:274
Inherited from
ConversationResponse.projectId
scope
scope:
ConversationScope
Defined in: types/conversation.ts:275
Inherited from
scopeIds
scopeIds:
string[]
Defined in: types/conversation.ts:276
Inherited from
agentId
agentId:
string
Defined in: types/conversation.ts:277
Inherited from
domainKey?
optionaldomainKey:string|null
Defined in: types/conversation.ts:278
Inherited from
ConversationResponse.domainKey
messageCount
messageCount:
number
Defined in: types/conversation.ts:279
Inherited from
ConversationResponse.messageCount
lastMessage?
optionallastMessage:string|null
Defined in: types/conversation.ts:280
Inherited from
ConversationResponse.lastMessage
lastMessageAt?
optionallastMessageAt:string|null
Defined in: types/conversation.ts:281
Inherited from
ConversationResponse.lastMessageAt
createdAt
createdAt:
string
Defined in: types/conversation.ts:282
Inherited from
ConversationResponse.createdAt
updatedAt
updatedAt:
string
Defined in: types/conversation.ts:283
Inherited from
ConversationResponse.updatedAt
messages
messages:
MessageResponse[]
Defined in: types/conversation.ts:305
hasMoreMessages
hasMoreMessages:
boolean
Defined in: types/conversation.ts:306
nextBefore?
optionalnextBefore:string
Defined in: types/conversation.ts:307
ListConversationsResponse
Defined in: types/conversation.ts:313
List conversations response
Properties
conversations
conversations:
ConversationResponse[]
Defined in: types/conversation.ts:314
total
total:
number
Defined in: types/conversation.ts:315
limit
limit:
number
Defined in: types/conversation.ts:316
offset
offset:
number
Defined in: types/conversation.ts:317
SyncResponse
Defined in: types/conversation.ts:323
Sync response
Properties
synced
synced:
number
Defined in: types/conversation.ts:324
deleted
deleted:
number
Defined in: types/conversation.ts:325
conflicts
conflicts:
SyncConflict[]
Defined in: types/conversation.ts:326
errors
errors:
SyncError[]
Defined in: types/conversation.ts:327
serverTimestamp
serverTimestamp:
string
Defined in: types/conversation.ts:328
maxAcceptedTimestamp
maxAcceptedTimestamp:
string|null
Defined in: types/conversation.ts:330
Max timestamp of messages actually accepted by server (for incremental sync watermark)
SyncConflict
Defined in: types/conversation.ts:336
Sync conflict details
Properties
messageId
messageId:
string
Defined in: types/conversation.ts:337
reason
reason:
string
Defined in: types/conversation.ts:338
serverVersion?
optionalserverVersion:MessageResponse
Defined in: types/conversation.ts:339
SyncError
Defined in: types/conversation.ts:345
Sync error details
Properties
messageId?
optionalmessageId:string
Defined in: types/conversation.ts:346
conversationId?
optionalconversationId:string
Defined in: types/conversation.ts:347
code
code:
string
Defined in: types/conversation.ts:348
message
message:
string
Defined in: types/conversation.ts:349
Type Aliases
ConversationScope
ConversationScope =
"organization"|"project"|"documents"
Defined in: types/conversation.ts:13
Conversation scope type - determines what context the conversation covers
MessageRole
MessageRole =
"user"|"assistant"
Defined in: types/conversation.ts:16
Message role type
SyncStatus
SyncStatus =
"pending"|"synced"|"error"
Defined in: types/conversation.ts:19
Sync status for tracking conversation sync state
Variables
MAX_CONVERSATIONS_PER_USER
constMAX_CONVERSATIONS_PER_USER:100=100
Defined in: types/conversation.ts:357
Maximum number of conversations per user per organization
MAX_MESSAGE_CONTENT_LENGTH
constMAX_MESSAGE_CONTENT_LENGTH:number
Defined in: types/conversation.ts:360
Maximum message content length in bytes
MAX_CHUNKS_PER_MESSAGE
constMAX_CHUNKS_PER_MESSAGE:50=50
Defined in: types/conversation.ts:363
Maximum chunks per message
DEFAULT_MESSAGE_LIMIT
constDEFAULT_MESSAGE_LIMIT:50=50
Defined in: types/conversation.ts:366
Default page size for messages
MAX_MESSAGE_LIMIT
constMAX_MESSAGE_LIMIT:100=100
Defined in: types/conversation.ts:369
Maximum page size for messages
DEFAULT_CONVERSATION_TITLE
constDEFAULT_CONVERSATION_TITLE:"New Conversation"='New Conversation'
Defined in: types/conversation.ts:372
Default conversation title
MAX_TITLE_LENGTH
constMAX_TITLE_LENGTH:255=255
Defined in: types/conversation.ts:375
Maximum title length
MAX_TIMESTAMP_SKEW_MS
constMAX_TIMESTAMP_SKEW_MS:number
Defined in: types/conversation.ts:378
Maximum timestamp skew allowed (5 minutes)