CI · Customer Intelligence

AI Chat Audit

Every AI conversation on the DATAP.AI platform is persisted and archived to S3 Parquet. Queryable via Amazon Athena.

Live (PostgreSQL)

Real-time on the stock backend:

  • datapai.chat_sessions — one row per session
  • datapai.chat_messages — every turn + tool calls

Archive (S3 → Athena)

Parquet export for audit retention:

s3://codepais3/stock/raw/chat_history

Athena database: stock · table: chat_history · 346+ rows

Table schema — stock.chat_history

ColumnTypeDescription
ge_idbigintAuto-increment row ID
session_idstringUUID per conversation session
session_user_idbigintUser ID (0 = anonymous / COPILOT)
tickerstringStock ticker context (e.g. COPILOT)
exchangestringExchange code (e.g. US, ASX)
session_titlestringChat session title
session_created_atbigintEpoch millis when session started
rolestringuser | assistant | tool
contentstringMessage body (markdown)

Sample queries (copy → paste into Athena)

-- All conversations (most recent first)
SELECT session_id, session_user_id, ticker, exchange,
       session_title, session_created_at, role, content
FROM   stock.chat_history
ORDER  BY session_created_at DESC
LIMIT  100;
-- Quick stats
SELECT COUNT(DISTINCT session_id)   AS total_sessions,
       COUNT(*)                     AS total_messages,
       MIN(session_created_at)      AS earliest,
       MAX(session_created_at)      AS latest
FROM   stock.chat_history;

Inline dashboard — coming soon

A searchable table embedded directly on this page (querying Athena via API) is on the roadmap. For now, use the Athena Query Editor link above.