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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.omni.co/feedback

```json
{
  "path": "/guides/patterns/optimizing-ai-context-for-support-operations",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Optimizing AI context for support operations

> Configure AI context across model, topic, and view levels to optimize Omni's AI for support operations.

export const categoryIcons = {
  'administration': 'lock',
  'api': 'terminal',
  'connections': 'database',
  'dashboards': 'table-columns',
  'embed': 'code',
  'errors': 'exclamation',
  'modeling': 'wrench',
  'patterns': 'plus',
  'schedules & alerts': 'envelope',
  'visualizations': 'chart-column',
  'workbooks': 'book'
};

export const GuideSidebar = ({category, relatedLinks, updatedDate}) => {
  const [progress, setProgress] = React.useState(0);
  React.useEffect(() => {
    const sidebar = document.querySelector('.guide-sidebar');
    if (!sidebar) return;
    let container = sidebar.parentElement;
    while (container && !container.querySelector('.guide-header')) {
      container = container.parentElement;
    }
    if (container && !container.classList.contains('guide-page-layout')) {
      container.classList.add('guide-page-layout');
    }
  }, []);
  React.useEffect(() => {
    const handleScroll = () => {
      const scrollTop = window.scrollY;
      const docHeight = document.documentElement.scrollHeight - window.innerHeight;
      const scrollPercent = docHeight > 0 ? scrollTop / docHeight * 100 : 0;
      setProgress(Math.min(100, Math.max(0, scrollPercent)));
    };
    window.addEventListener('scroll', handleScroll, {
      passive: true
    });
    handleScroll();
    return () => window.removeEventListener('scroll', handleScroll);
  }, []);
  const icon = category ? categoryIcons[category.toLowerCase()] || 'book' : 'book';
  return <aside className="guide-sidebar">
      <div className="guide-sidebar-content">
        <a href="/guides" className="guide-sidebar-back">
          <Icon icon="arrow-left" iconType="solid" size={14} />
          <span>All guides</span>
        </a>

        <div className="guide-sidebar-section">
          <div className="guide-sidebar-label">Progress</div>
          <div className="guide-sidebar-progress">
            <div className="guide-mascot">
              <svg viewBox="0 0 450 450" width="48" height="48">
                <defs>
                  <clipPath id="progressClip">
                    <rect x="0" y={450 - progress * 4.5} width="450" height={progress * 4.5} />
                  </clipPath>
                  <linearGradient id="blobbyGradient" x1="55.9753" y1="0" x2="492.197" y2="169.724" gradientUnits="userSpaceOnUse">
                    <stop stopColor="#BCA2F3" />
                    <stop offset="0.572917" stopColor="#FF7AA2" />
                    <stop offset="1" stopColor="#F3D4A2" />
                  </linearGradient>
                </defs>

                {}
                <circle cx="223.901" cy="223.901" r="213.901" transform="matrix(-0.999988 -0.0049013 0.00491945 -0.999988 447.797 449.992)" fill="#FAFAFA" stroke="#480B38" strokeWidth="20" />

                {}
                <circle cx="223.901" cy="223.901" r="213.901" transform="matrix(-0.999988 -0.0049013 0.00491945 -0.999988 447.797 449.992)" fill="url(#blobbyGradient)" stroke="#480B38" strokeWidth="20" clipPath="url(#progressClip)" />

                {}
                <path d="M310.41 195.084C310.41 200.052 301.362 212.472 284.328 212.472C266.585 212.472 258.246 201.294 258.246 195.912" stroke="#480B38" strokeWidth="17.3883" strokeMiterlimit="1.33344" strokeLinecap="round" />
                <circle cx="21.168" cy="21.168" r="21.168" transform="matrix(-1 0 0 1 388.658 169.001)" fill="#480B38" />
                <circle cx="21.168" cy="21.168" r="21.168" transform="matrix(-1 0 0 1 223.467 169.001)" fill="#480B38" />
              </svg>
            </div>
            <span className="guide-sidebar-progress-text">{Math.round(progress)}%</span>
          </div>
        </div>

        {category && <div className="guide-sidebar-section">
            <div className="guide-sidebar-label">Category</div>
            <div className="guide-sidebar-category">
              <Icon icon={icon} iconType="solid" size={14} />
              <span>{category}</span>
            </div>
          </div>}

        {updatedDate && <div className="guide-sidebar-section">
            <div className="guide-sidebar-label">Last updated</div>
            <div className="guide-sidebar-date">{updatedDate}</div>
          </div>}

        {relatedLinks && relatedLinks.length > 0 && <div className="guide-sidebar-section">
            <div className="guide-sidebar-label">Related</div>
            <ul className="guide-sidebar-links">
              {relatedLinks.map((link, index) => <li key={index}>
                  <a href={link.href}>{link.title}</a>
                </li>)}
            </ul>
          </div>}
      </div>
    </aside>;
};

export const GuideTitle = ({title}) => {
  return <div className="guide-header">
      <h1 className="guide-title">{title}</h1>
    </div>;
};

<GuideSidebar
  categoryIcons={categoryIcons}
  category="patterns"
  updatedDate="March 2026"
  relatedLinks={[
{ title: "Optimize models for Omni AI", href: "/modeling/develop/ai-optimization" },
{ title: "Model ai_context", href: "/modeling/models/ai-context" },
{ title: "Topic ai_context", href: "/modeling/topics/parameters/ai-context" },
{ title: "View ai_context", href: "/modeling/views/parameters/ai-context" }
]}
/>

<GuideTitle title="Optimizing AI context for support operations" />

This guide provides a hands-on reference for building out AI context within an Omni instance focused on customer support and Zendesk tickets.

By following this example, you can see how to move beyond basic schema discovery to a **high-precision setup** where the AI understands complex support logic like SLA targets, ticket lifecycles, and account risk.

## Why AI context matters

In support operations, data is often defined by the "state" of a ticket or the urgency of a customer. While Omni understands your tables, `ai_context` codifies the operational knowledge required for the AI to act as a seasoned support lead. For example, support context could look like:

* **Defining "active issues":** Does "active" mean only 'new' tickets, or does it include those 'pending' a customer response?
* **SLA logic:** Mapping priority levels (urgent vs. normal) to specific response time expectations so the AI can identify breaches.
* **Sentiment and risk:** Helping the AI understand that a high volume of tickets for a single `account_id` isn't just "work" - it's a signal of potential churn or a "customer at risk."

## The AI context hierarchy

To build a high-precision instance, think of your context in three layers. Omni applies this logic from the top down, ensuring universal support standards are respected before field-level definitions.

| **Layer**      | **Purpose**                                                                                                      | **Example**                                                                    |
| :------------- | :--------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
| **Model**      | **Universal truths.** The model file defines your universal rules that will exist across your entire Omni model. | "All time durations are in hours; our support week is 24/7."                   |
| **Topic**      | **The persona.** The topic level defines more specific details scoped to your pre-defined datasets.              | "You are a support ops analyst; 'Resolved' means Solved or Closed."            |
| **View/Field** | **Field precision.** Specific definitions, synonyms, and allowed values for columns.                             | "'Urgency' is a synonym for `priority`. 'Bug' is a specific `type` of ticket." |

## Requirements

To implement this example in your own Omni instance, you'll need:

* Familiarity with Omni's modeling layer
* Permissions in Omni that allow you to edit a shared model
* A connected data source that contains support-related data

<Steps>
  <Step title="Set universal rules in the model file" titleSize="h2">
    The [model file](/modeling/models) defines your universal rules that will exist across your entire Omni model. These rules ensure the AI adheres to your core support standards regardless of which topic a user is exploring.

    ```yaml title="Context that applies to the entire model" wrap theme={null}
    ai_context: |-
      ## Global Business Logic
      - All "Time to Resolve" or "Response Time" metrics should be displayed in decimal hours unless minutes are specifically requested.
      - Our support organization operates on a 24/7 basis; do not exclude weekends from duration calculations unless "Business Hours" are specified.
      - When users ask about "At-Risk Customers," prioritize those with more than 5 'Open' tickets or a CSAT score below 3.

      ## Data Handling & Formatting
      - Always hide internal Zendesk system IDs (like user_id) in the final visualization; use Name or Email instead.
      - For any customer satisfaction (CSAT) analysis, the scale is 1-5, where 5 is the best.
      ## Support Definitions
      - "Technical Debt" refers to tickets where the type is 'bug' or 'incident'.
      - "Self-Service" refers to tickets sourced from the 'web' channel that were closed with a single interaction.
    ```
  </Step>

  <Step title="Set dataset logic in the topic" titleSize="h2">
    The topic level defines more specific details scoped to your pre-defined datasets. This tells the AI how to navigate ticket statuses, support channels, and engineering links, like those to a Jira instance.

    ```yaml title="Topic-level context" wrap theme={null}
    base_view: omni_dbt_saas__zendesk_tickets
    label: Support Tickets
    group_label: Product Analytics
    description: |
      Customer support tickets from Zendesk. Use this to track team performance,
      identify product issues, and analyze support channel effectiveness.

    ai_context: |-
      This topic focuses on customer support and service operations.

      ## Support Lifecycle definitions:
      - "Open tickets" or "Active issues": filter on status = [new, open, pending].
      - "Resolved tickets": filter on status = [solved, closed].
      - "High priority": filter on priority = [urgent, high].
      - "Feature requests": filter on type = feature_request.
      - "Technical issues": filter on type = problem or bug.

      ## Analysis Logic:
      - Customer Satisfaction (CSAT): Use the satisfaction_score field.
      - Response Time: Use first_response_time_hours.
      - Resolution Time: Use resolution_time_hours.
      - Account Risk: Use account_id to identify customers with high ticket volumes.
      - Engineering Link: Use jira_issue_id to connect support tickets to development work.

      ## Formatting:
      - Always make dimensions (labels/values) the first columns in the table, and measures (counts/sums) after.
    ```
  </Step>

  <Step title="Add precision at the view level" titleSize="h2">
    The view level ensures the AI knows the operational significance of different fields, such as how `priority` maps to SLAs or how `channel` reflects customer preference.

    ```yaml title="View-level context" wrap theme={null}
    view: omni_dbt_saas__zendesk_tickets
    fields:
      status:
        sql: '"STATUS"'
        all_values: [new, open, pending, solved, closed]
        synonyms: [ticket_status, workflow_status]
        ai_context: |
          New/Open tickets require immediate action. Pending tickets are waiting on a response.
          Solved/Closed represent completed work.

      priority:
        sql: '"PRIORITY"'
        all_values: [urgent, high, normal, low]
        synonyms: [urgency, ticket_priority]
        ai_context: |
          Priority maps to SLA targets: Urgent (<1hr), High (<4hr), Normal (<24hr), Low (<72hr).
          Higher priorities indicate greater business risk.

      type:
        sql: '"TYPE"'
        all_values: [problem, question, task, feature_request, incident, bug]
        ai_context: |
          'Problem' or 'Bug' require engineering attention. 'Feature_request' informs the roadmap.
          'Question' suggests a need for better documentation.

      channel:
        sql: '"CHANNEL"'
        all_values: [web, email, phone, chat, api]
        ai_context: |
          'Phone' is high-cost/urgent. 'Chat' is high-satisfaction/quick.
          'API' represents automated integrations.
    ```
  </Step>
</Steps>

## The feedback loop

Support trends change with every product release. Use this workflow to keep your AI accurate:

1. **Monitor**: Use the **AI usage** dashboard in the [**Analytics** section](/administration/analytics) to see if users are struggling to find bug reports versus feature requests.
2. **Identify**: Did the AI fail because a specific product area wasn't defined in the context?
3. **Tune**: Update the YAML (e.g., add a synonym for "Product Issue" pointing to `type = bug`).
4. **Verify**: Re-run the prompt in the [**Omni Agent**](/ai/chat) to confirm the AI now maps the term correctly.

<Tip>
  **SLA breach tip:** Use `ai_context` in your `resolution_time_hours` field to define a breach.

  For example: `"If priority is urgent and resolution time > 1, this is an SLA breach."`

  This allows users to ask `"How many SLA breaches did we have yesterday?"`
</Tip>

## Next steps

* [Model-level ai\_context](/modeling/models/ai-context) — Reference for model-level `ai_context` syntax
* [Topic-level ai\_context](/modeling/topics/parameters/ai-context) — Reference for topic-level `ai_context` syntax
* [View-level ai\_context](/modeling/views/parameters/ai-context) — Reference for view-level `ai_context` syntax
* [Optimize models for Omni AI](/modeling/develop/ai-optimization) — Broader guidance on optimizing your model for AI
