interaction_id INT not_null auto_increment comment(Primary key - unique interaction identifier)
user_id INT default null comment(User ID who initiated the interaction)
session_id VARCHAR(255) default null comment(Session identifier for tracking user sessions)
question TEXT not_null comment(User question or query text)
response TEXT default null comment(System response to the user query)
request_type VARCHAR(50) default null comment(Type of request: analytics, semantic, error, security_blocked)
confidence DECIMAL(5,2) default null comment(Confidence score of the response (0-100))
response_quality INT default null comment(Quality score of the response (0-100))
response_time INT default null comment(Response time in milliseconds)
execution_time INT default null comment(Execution time in milliseconds)
tokens_used INT default null comment(Number of tokens used in the API call)
api_cost DECIMAL(10,6) default null comment(API cost in USD for this interaction)
language_id INT default 1 comment(Language identifier for the interaction)
entity_id INT default 0 comment(Entity ID (0 = no specific entity, null = unknown))
entity_type VARCHAR(50) default null comment(Type of entity (product, category, page, etc.))
agent_used VARCHAR(50) default null comment(Agent that processed the query (orchestrator, analytics_agent, semantic_agent, etc.))
intent_type VARCHAR(50) default null comment(Intent classification (analytics, semantic, hybrid, web_search))
date_added DATETIME not_null default CURRENT_TIMESTAMP comment(Timestamp when the interaction was created)

--
primary interaction_id
idx_user_id user_id
idx_session_id session_id
idx_request_type request_type
idx_date_added date_added
idx_response_time response_time
idx_entity entity_id entity_type
idx_agent_used agent_used
idx_intent_type intent_type

##
engine innodb
character_set utf8mb4
collate utf8mb4_unicode_ci