> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcemedium.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Analyst

> Ask questions about your e-commerce data in plain English and get answers with summaries, charts, CSV exports, and SQL

The AI Analyst lets approved Slack users ask questions about your e-commerce data in plain English. It understands your question, finds the right data, writes SQL, and returns results with summaries, tables, files, and visualizations when useful.

## How It Works

When you ask a question, the AI Analyst:

1. **Classifies your question** — Determines whether you need data analysis, a definition, or a diagnostic check
2. **Identifies relevant tables** — Finds the right data sources for your question
3. **Generates SQL** — Writes a query against your BigQuery warehouse
4. **Executes and responds** — Runs the query and returns a summary, table, CSV, and chart when appropriate

<Info>
  The AI Analyst queries your actual data in BigQuery. Results reflect your real business metrics, not sample data.
</Info>

***

## What You Can Ask

The AI Analyst handles several types of questions:

### Data Questions

Questions that require querying your warehouse and interpreting the result:

* "What was our revenue last week?"
* "Show me top 10 products by units sold this month"
* "How many new customers did we acquire in January?"
* "What's our average order value by channel?"

### Raw Data Pulls

Requests where you want rows or specific fields, not interpretation:

* "Pull order ID, order date, UTM source, UTM medium, and revenue for last week"
* "Give me customer email, first order date, and lifetime revenue for customers acquired in March"
* "Export line items for SKU ABC-123 from the past 30 days"

<Info>
  Raw data pulls skip Deep Analysis, avoid charts by default, and attach the returned data as a CSV.
</Info>

### Definitions, Schema & Diagnostics

Questions about metrics, tables, data structure, and how SourceMedium works:

* "What is LTV?"
* "How is conversion rate calculated?"
* "Which table has order data?"
* "What columns are in the customers table?"
* "How does attribution work in SourceMedium?"
* "How is my data health?" — Check table freshness and availability
* "How is my attribution health?" — Check UTM tracking coverage

<Tip>
  Definition and schema questions draw from SourceMedium documentation and metadata. Data Health and Attribution Health run live diagnostics.
</Tip>

<CardGroup cols={2}>
  <Card title="Data Health" icon="stethoscope" href="/ai-analyst/diagnostics/data-health">
    Understand whether your data is fresh and ready for analysis.
  </Card>

  <Card title="Attribution Health" icon="heart-pulse" href="/ai-analyst/diagnostics/attribution-health">
    Diagnose tracking gaps and improve attribution coverage.
  </Card>
</CardGroup>

***

## Analytical Domains

The AI Analyst can query data across these domains:

| Domain               | What You Can Analyze                                    |
| -------------------- | ------------------------------------------------------- |
| **Orders & Revenue** | Revenue, AOV, order counts, discounts, shipping         |
| **Customers**        | New vs. repeat, cohort analysis, customer-level metrics |
| **Marketing**        | Ad spend, ROAS, CPO, channel performance                |
| **Email & SMS**      | Campaign performance, engagement metrics                |
| **Web Analytics**    | Funnel events, page views, conversion paths             |
| **Cohort LTV**       | Lifetime value by acquisition cohort                    |
| **Attribution**      | Multi-touch attribution, channel contribution           |

***

## Analysis Workflows

The AI Analyst uses different workflows depending on your question type:

| Question Type                 | Workflow                                                           |
| ----------------------------- | ------------------------------------------------------------------ |
| Specific metrics              | [Standard Analysis](/ai-analyst/workflows/standard)                |
| Raw rows or fields            | [Standard Analysis](/ai-analyst/workflows/standard) as a data pull |
| Open-ended/strategic          | [Deep Analysis](/ai-analyst/workflows/deep-analysis)               |
| Definitions & schema          | [Knowledge Retrieval](/ai-analyst/workflows/knowledge)             |
| Summaries and recommendations | Same-thread follow-up using prior analysis context                 |

<Card title="Learn about Workflows" icon="diagram-project" href="/ai-analyst/workflows/index">
  Understand how different question types are routed and processed.
</Card>

<Note>
  Follow-ups work within the same Slack thread. The AI carries context in that thread, not across different threads. Start a new thread to reset context.
</Note>

### Deep Analysis

For complex, open-ended questions — like "How can we improve our marketing performance?" or "What trends should we be aware of?" — the AI Analyst automatically engages **Deep Analysis**.

In this mode, the AI breaks your question into multiple analytical perspectives, runs parallel Standard Analyses, and synthesizes the findings into a comprehensive answer.

<Card title="Deep Analysis Details" icon="brain" href="/ai-analyst/workflows/deep-analysis">
  Learn how Deep Analysis works, when it activates, and how to get the best results.
</Card>

<Card title="Thread continuity and follow-ups" icon="message-lines" href="/ai-analyst/thread-continuity-follow-ups">
  Learn what carries forward in the same thread and how to reset context cleanly.
</Card>

***

## Feedback

Every response includes a **feedback button**. Use it to:

* Rate whether the answer was helpful
* Report issues or inaccuracies
* Suggest improvements

Your feedback directly improves the AI Analyst. We review feedback regularly to refine prompts, fix edge cases, and prioritize enhancements.

***

## Getting Started

<Steps>
  <Step title="Install the app">
    Visit `https://uni.sourcemedium.com/slack/install` and click "Add to Slack" to install the AI Analyst in your workspace. See [Setup & Installation](/ai-analyst/setup) for details.
  </Step>

  <Step title="Invite to a channel">
    Add the bot to a channel where you want to ask questions, or send it a direct message.
  </Step>

  <Step title="Ask a question">
    Type your question in natural language. Be specific about time ranges and metrics when possible.
  </Step>

  <Step title="Review results">
    The AI Analyst returns a response with data, files, a chart if applicable, and the SQL query used.
  </Step>
</Steps>

***

## What It Can't Do

The AI Analyst is designed for analytics questions against your SourceMedium data. It cannot:

* Access systems outside your BigQuery warehouse
* Modify data or run write operations
* Answer questions unrelated to your e-commerce analytics
* Guarantee real-time data (see [Data Health](/ai-analyst/diagnostics/data-health) for freshness)
* Access custom tables or customized logic built on top of SourceMedium data

***

## Data Access & Security

### Data Access Scope

Currently, the AI Analyst has access only to **SourceMedium out-of-the-box transformed tables**. If you have built custom tables or added customized logic on top of our data within your BigQuery instance, the agent will not have visibility into those for now.

<Note>
  Support for custom tables and user-defined schemas is planned for a future update.
</Note>

### Access Control

The AI Analyst uses a single shared Slack app with tenant-level isolation. Access is checked at install time and again when a user asks a question:

* **Domain and email gating**: Users must match your tenant's configured allowed email domain or exact allowed email.
* **Tenant isolation**: Each request is routed to the matching tenant's BigQuery project and allowed tables.
* **Multi-Store Organizations**: If your tenant includes multiple stores, analysis is scoped by thread after store confirmation. Start a new thread to switch stores.

<Warning>
  Customer-managed permissions for specific users, stores, tables, or analytical domains are not yet available.
</Warning>

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Example Questions" icon="lightbulb" href="/ai-analyst/what-you-can-ask">
    See examples of questions across different domains.
  </Card>

  <Card title="Understanding Results" icon="chart-simple" href="/ai-analyst/understanding-results">
    Learn how to read responses, charts, and SQL output.
  </Card>

  <Card title="Building Trust" icon="shield" href="/ai-analyst/building-trust">
    How to validate results and establish a reliable workflow.
  </Card>
</CardGroup>

***

## Related Resources

The AI Analyst queries the same data that powers your SourceMedium dashboards. These resources help you understand the underlying data:

<CardGroup cols={3}>
  <Card title="Metrics Reference" icon="chart-line" href="/onboarding/data-docs/metrics">
    Definitions for all SourceMedium metrics.
  </Card>

  <Card title="Dimensions Reference" icon="table-columns" href="/onboarding/data-docs/dimensions">
    Available dimensions for filtering and grouping.
  </Card>

  <Card title="Table Schemas" icon="database" href="/data-activation/data-tables/sm_transformed_v2/index">
    Column-level documentation for all tables.
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="Attribution in SourceMedium" icon="route" href="/help-center/core-concepts/attribution/attribution-in-sourcemedium">
    How we attribute orders to marketing channels.
  </Card>

  <Card title="Data Transformations" icon="wand-magic-sparkles" href="/data-transformations/philosophy">
    How raw data becomes analytics-ready tables.
  </Card>
</CardGroup>
