home / sales_assistant

Conversas

3 rows sorted by last_activity descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: seller_id, status, started_at (date), last_activity (date)

conversation_id seller_id customer_id status state escalation_level source_channel agent_type_active context_summary metadata started_at last_activity ▲ closed_at
3 Mary 1 Patryck 1 active inquiry 0 telegram consumer   {} 2026-06-23T04:16:37Z 2026-06-23T04:25:54Z  
2 - 0 Patryck 1 closed inquiry 0 telegram consumer   {} 2026-06-16T23:47:28Z 2026-06-16T23:47:28Z  
1 Mary 1 Patryck 1 closed inquiry 0 telegram consumer   {} 2026-06-14T05:50:28Z 2026-06-15T19:04:44Z  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE conversation (
    conversation_id     INTEGER PRIMARY KEY AUTOINCREMENT,
    seller_id           INTEGER NOT NULL REFERENCES seller(seller_id) ON DELETE CASCADE,
    customer_id         INTEGER NOT NULL REFERENCES customer(customer_id) ON DELETE CASCADE,
    status              TEXT NOT NULL DEFAULT 'active',
    state               TEXT NOT NULL DEFAULT 'greeting',
    escalation_level    INTEGER NOT NULL DEFAULT 0,
    source_channel      TEXT NOT NULL DEFAULT 'telegram',
    agent_type_active   TEXT NOT NULL DEFAULT 'consumer',
    context_summary     TEXT,
    metadata            TEXT NOT NULL DEFAULT '{}',
    started_at          TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
    last_activity       TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
    closed_at           TEXT,
    CHECK (status IN ('active', 'closed', 'abandoned')),
    CHECK (escalation_level IN (0, 1, 2)),
    CHECK (agent_type_active IN ('consumer', 'seller'))
);
CREATE INDEX idx_conversation_seller_customer ON conversation(seller_id, customer_id);
CREATE INDEX idx_conversation_status ON conversation(status);
CREATE INDEX idx_conversation_last_activity ON conversation(last_activity);
Powered by Datasette · Queries took 1.2ms