Skip to main content
This guide provides a hands-on reference for building out AI context within a SaaS-focused Omni instance, specifically centered on Salesforce Opportunities. By following this example, you can see how to move beyond basic schema discovery to a high-precision setup where the AI understands complex sales logic and terminology like “pipeline,” “IQCC,” and “weighted forecasts.”

Why AI context matters

While Omni understands your schema, ai_context lets you encode sales-specific knowledge — like what ‘pipeline’ means or how to calculate IQCC — so the AI can answer questions accurately. For example, sales context could look like:
  • Defining terminology: Does “pipeline” mean every open deal, or only “new business” in specific stages?
  • Handling personas: Automatically filtering by a manager’s specific region or segment when they ask about my team using user attributes.
  • Calculating velocity: Defining terms like IQCC (In-Quarter Create & Close) so the AI can track speed-to-revenue without manual intervention.

The AI context hierarchy

To help the AI return accurate, business-aligned answers, you can add context to the underlying data model. For this example, think of the context in three layers: model, topic, and view. Omni applies this logic from the top down - starting at the model level - allowing you to set universal rules that get more specific as you move toward individual fields.

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 SaaS or sales-related data
1

Setting universal rules in the model file

The model file defines your universal rules that will exist across the entire model. These rules act as permanent guardrails, ensuring the AI adheres to your core business standards regardless of which topic in the model a user is exploring.
Model-level context
2

Setting dataset logic in the topic

Topic-level context defines more specific details scoped to your pre-defined datasets. This tells the AI how to navigate stages, deal types, and user permissions for Salesforce data.
Topic-level context
Include sample queries. By including all three sample_queries above, you ensure the AI has explicit examples of how to handle trials, quarterly wins, and cumulative revenue.
3

Adding precision at the view level

View-level context ensures the AI knows the difference between a lead source and a forecast category, and provides synonyms to catch natural language variations.
View-level context

Iterating on AI context

Improving AI quality is an iterative process. Use this workflow to refine your context:
  1. Monitor: Use the AI usage dashboard in the Analytics section to find queries with negative (👎) feedback.
  2. Identify: Did the AI fail due to a missing synonym or lack of business logic?
  3. Tune: Update the YAML at the appropriate level (Model, Topic, or View).
  4. Verify: Re-run the prompt in the Omni Agent to ensure the fix worked.
When you correct the AI in a chat session (e.g., "Actually, always use Fiscal Year"), click the (brain) icon to have the AI learn from the conversation and propose model changes to incorporate the correction.

Next steps