AI Audit Trail

Inspect Every Decision the AI Makes

ContentAtlas stores the complete reasoning chain behind every AI response — system prompts, LLM reasoning steps, the generated SQL query, and the retrieved data. Every number in an answer links back to the exact row that produced it.

No Hallucinations

Every figure in an AI response is tagged back to its SQL result row. If it can't be traced, it can't be said.

Full Audit Log

System prompts, user messages, LLM responses, and SQL queries are stored for 90 days and exportable as JSON, CSV, or PDF.

Independent Verification

Copy the generated SQL and run it yourself. The results must match. ContentAtlas never hides the query behind the answer.

AI AUDIT TRAIL

Every Answer. Fully Traceable.

See exactly how ContentAtlas reasoned through a real executive question — from natural language to SQL-verified data, with every figure tagged to its source.

Executive asked:

"What's our most profitable product per category last quarter?"

1

System Context

Role definition, schema access, and behavioral constraints sent to the model.

system prompt
You are ContentAtlas AI, a business analytics assistant.

Database access (read-only):
  orders        (id, customer_id, status, completed_at, total_amount)
  order_items   (id, order_id, product_id, quantity, unit_price)
  products      (id, name, category_id, cost_price, sku)
  categories    (id, name, slug)

Rules:
- All monetary values are in USD
- "Last quarter" = most recently completed fiscal quarter
- Only count completed orders (status = 'completed')
- NEVER estimate or invent numbers — every value must originate from SQL
- Tag all numeric values in your response with [TAG:source_key]
  matching the SQL result column and row identifier
2

LLM Reasoning

How the model interpreted the request and planned the data retrieval strategy.

reasoning
Request analysis: Profitability by product category, last quarter.

Interpretation:
  - "Last quarter" → Q4 2024 (Oct 1 – Dec 31, 2024)
  - "Most profitable" → profit = SUM((unit_price − cost_price) × quantity)
  - "Per category" → one winner per category, not overall top products

Query plan:
  1. JOIN order_items → products → categories → orders
  2. Filter: status = 'completed', completed_at in Q4 2024
  3. Aggregate profit + revenue per (category, product) pair
  4. RANK() OVER (PARTITION BY category ORDER BY profit DESC)
  5. Return only rank = 1 rows — top product per category
  6. Tag each numeric value in the response for full traceability
3

SQL Query Generated

The exact query sent to your database — inspect, copy, or run independently.

sql
WITH ranked AS (
    SELECT
        c.name                                              AS category,
        p.name                                              AS product,
        SUM((oi.unit_price - p.cost_price) * oi.quantity)  AS profit,
        SUM(oi.unit_price * oi.quantity)                    AS revenue,
        ROUND(
            SUM((oi.unit_price - p.cost_price) * oi.quantity) /
            SUM(oi.unit_price * oi.quantity) * 100, 1
        )                                                   AS margin_pct,
        RANK() OVER (
            PARTITION BY c.id
            ORDER BY SUM((oi.unit_price - p.cost_price) * oi.quantity) DESC
        )                                                   AS rnk
    FROM order_items  oi
    JOIN products     p  ON p.id = oi.product_id
    JOIN categories   c  ON c.id = p.category_id
    JOIN orders       o  ON o.id = oi.order_id
    WHERE o.status = 'completed'
      AND o.completed_at BETWEEN '2024-10-01' AND '2024-12-31'
    GROUP BY c.id, c.name, p.id, p.name
)
SELECT category, product, profit, revenue, margin_pct
FROM   ranked
WHERE  rnk = 1
ORDER  BY profit DESC;
4

Data Retrieved

4 rows · 0.08s — export for independent verification.

Category Product Profit Revenue Margin
Electronics UltraScan Pro X $124,380 $298,450 41.7%
Software DataBridge Enterprise $89,720 $102,400 87.6%
Prof. Services AI Migration Suite $67,250 $89,000 75.6%
Hardware SecureVault 2000 $43,890 $78,300 56.1%
Export dataset: CSV JSON PDF

Final Answer — SQL-Verified

Every figure is tagged to its SQL source. Click any tag to jump to the originating data row.

Most profitable products per category for Q4 2024 (Oct – Dec 2024):

Electronics UltraScan Pro X Profit $124,380 TAG:profit_01  · Revenue $298,450 TAG:rev_01  · Margin 41.7% TAG:margin_01
Software DataBridge Enterprise Profit $89,720 TAG:profit_02  · Revenue $102,400 TAG:rev_02  · Margin 87.6% TAG:margin_02
Prof. Services AI Migration Suite Profit $67,250 TAG:profit_03  · Revenue $89,000 TAG:rev_03  · Margin 75.6% TAG:margin_03
Hardware SecureVault 2000 Profit $43,890 TAG:profit_04  · Revenue $78,300 TAG:rev_04  · Margin 56.1% TAG:margin_04

All figures sourced from SQL query results. No values were estimated or generated without a corresponding data row.

See the Audit Trail in Your Environment

Book a 20-minute session to walk through a live audit of your own business data with ContentAtlas.