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 sessiondatapai.chat_messages— every turn + tool calls
Archive (S3 → Athena)
Parquet export for audit retention:
s3://codepais3/stock/raw/chat_historyAthena database: stock · table: chat_history · 346+ rows
Table schema — stock.chat_history
| Column | Type | Description |
|---|---|---|
| ge_id | bigint | Auto-increment row ID |
| session_id | string | UUID per conversation session |
| session_user_id | bigint | User ID (0 = anonymous / COPILOT) |
| ticker | string | Stock ticker context (e.g. COPILOT) |
| exchange | string | Exchange code (e.g. US, ASX) |
| session_title | string | Chat session title |
| session_created_at | bigint | Epoch millis when session started |
| role | string | user | assistant | tool |
| content | string | Message 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.