Skip to content
October 12, 2026

Where to add context in Omni so the AI gets it right

Josh adding field metadata in Omni while the Omni Agent answers a revenue question, from the free mini workshop. Watch every layer in the free mini workshop

Point an AI agent at a raw Salesforce model and ask "how much have we booked?" It gets it right. Ask "show me revenue" and it comes back about 5x too high, because it summed every opportunity, open pipeline and lost deals included. Same metric, one word different, and nothing on screen tells you it guessed.

The model isn't bad at math. It's guessing at your vocabulary. A more expensive model doesn't fix that, it just guesses with more confidence. What fixes it is context: telling the AI what your data means, in the places it reads. That work is called context engineering.

I built a small demo in Omni to show where that context goes. Six tables of Salesforce-style data, a handful of questions, and five layers added one at a time. After each layer I asked the Omni Agent the same questions again. The whole thing is a free, self-paced mini workshop you can follow in your own Omni instance; this post is the short version.

1. Joins and relationships

In Omni the AI answers from a Topic, a curated dataset with a starting table, the tables joined to it, and the context written for the AI. If a table isn't joined into the Topic, the Agent doesn't error out. It answers from whatever it can reach. Declaring the join puts the fields in scope, and declaring the relationship type (one-to-one, many-to-one) keeps Omni from double counting when it sums across tables.

2. Field metadata

Your field definitions are the prompt. Labels with units, descriptions that say what a field is not, synonyms pulled from how people actually ask, the list of valid values, and governed measures. That last one is the fix for "revenue": define it once as a measure (closed won amount) and the word resolves to one calculation instead of five.

3. AI context

Every dataset has a person who knows where the traps are. In this one, competitor_c holds the competitor on lost deals and the win channel on won deals. Nobody would guess that from the name. AI context is where you write that down, in plain English, at the model, Topic, view, or field level.

Here's the same question before and after adding a few lines of it:

Omni Agent on the raw model cannot find a channel field and asks what channel wins means.
Before: the Agent can't find anything called "channel" and asks.
After AI context, the Omni Agent recognizes channel wins, asks which time window, and for 2026 applies the business rule and returns 31.
After: same question. Now it knows what a channel win is and only asks which time window. Given 2026, it applies the business rule (won deals where competitor_c starts with "CH") and answers 31.

4. Sample queries

A worked example beats another paragraph of description. A sample query pairs a real question with the right query, and the Agent reuses the pattern on similar questions. Keep them short. One clean example of a tricky filter gets reused everywhere; a 200-line CTE teaches it nothing.

5. The fiscal calendar

This one surprised me. I wrote "our fiscal year starts in July" in the AI context, and the Agent read it, agreed, and still answered on the calendar year. Relative dates in Omni resolve against the model's fiscal calendar, which is a setting (fiscal_month_offset), not a sentence. One line of config fixed it.

Strictly speaking that's semantic modeling more than context engineering, and that's the point. When a rule can be enforced in the model, enforce it. Then it holds no matter what the AI decides.

Keeping it right

Context goes stale like any other code. The habit that works: keep ten or so real questions as a prompt set, make every change on a branch, and run an eval against the branch before you merge. When a user reports a wrong answer, it becomes a new question in the set.

Free mini workshop

Try it in your own Omni instance

The intro to context engineering in Omni walks through all five layers with short videos, the demo data, and copy-paste YAML. Self-paced, about 60 minutes.

Get the free workshop