> ## 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": "/modeling/views/parameters/ai-context",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# ai_context

> Free text that can provide context about a view to the Omni Agent.

Free text that can provide context to the [Omni Agent](/ai/chat). Context could include behavioral prompting or example queries and structured Omni results.

Refer to the [Optimizing models for AI](/modeling/develop/ai-optimization) guide for more information on best practices.

## Syntax

```yaml theme={null}
ai_context: "<context_text>"
```

Or for multiline context:

```yaml theme={null}
ai_context: |
  <multiline_context_text>
```

## Properties

<ParamField path="ai_context" type="string">
  Free text that provides context to the Omni Agent. Can include behavioral prompting, use case descriptions, sample queries, or other contextual information to improve AI query results.

  You can reference [user attributes](/administration/users/attributes) using `${omni_attributes.<attribute_name>}` syntax to personalize the context for each user.
</ParamField>

<Note>
  Only user attribute references are allowed in `ai_context`. Field references and filter conditions are not supported.
</Note>

## Examples

```yaml title="Personalized context using user attributes" theme={null}
ai_context: |
  This view contains data for the ${omni_attributes.region} region only.
```

```yaml title="Behavioral prompting" wrap theme={null}
ai_context: |
  you are the head of finance. you are concerned with the status of customer payments. you often need to project into the future how many invoices are due and for how much. you also need to know if any invoices are late so you can reach out to those customers.
```

```yaml title="Structured query" expandable theme={null}
ai_context: |
  question: which customers are behind due on payment?
    answer:
    {
    "limit": 1000,
    "sorts": [
      {
        "column_name": "share_rillet_omni_omni__invoices.due_date",
        "sort_descending": true,
        "is_column_sort": false,
        "null_sort": "OMNI_DEFAULT"
      }
    ],
    "table": "share_rillet_omni_omni__invoices",
    "fields": [
      "share_rillet_omni_omni__invoices.customer_id",
      "share_rillet_omni_omni__invoices.customer_name",
      "share_rillet_omni_omni__invoices.invoice_number",
      "share_rillet_omni_omni__invoices.due_date",
      "share_rillet_omni_omni__invoices.total_amount"
    ],
    "pivots": [],
    "dbtMode": false,
    "filters": {
      "share_rillet_omni_omni__invoices.due_date": {
        "is_negative": false,
        "kind": "BEFORE",
        "right_side": "today",
        "type": "date",
        "ui_type": "BEFORE"
      },
      "share_rillet_omni_omni__invoices.status": {
        "type": "string",
        "kind": "EQUALS",
        "values": [
          "unpaid"
        ],
        "is_negative": false,
        "case_insensitive": true
      }
    },
    "modelId": "aeb6f3f4-b0e5-4abb-97eb-eaeb42a16944",
    "version": 5,
    "rewriteSql": true,
    "row_totals": {},
    "fill_fields": [],
    "calculations": [],
    "column_limit": 50,
    "join_via_map": {},
    "column_totals": {},
    "userEditedSQL": "",
    "dimensionIndex": 0,
    "default_group_by": true,
    "join_paths_from_topic_name": "invoices"
  }
```
