AI Aliases and AI Descriptions
Every element of a source object has a display name and a description: the words people see in the Rule Editor's menus and Help String. Two more properties, AiAliases and AiDescription, are written for AI agents instead. They tell an agent what else a field, method, action or enumeration member is called, and what it means, so that a request in your business's own words reaches the right element.
They are read by the Rule Repository's AI features (since v7): the AI Rule Editor, the AI Assistant, and external agents connected through the MCP server. The stand-alone Rule Editor and the Rule Engine ignore them: they never reach the browser, and they change nothing in how a rule is written, stored or evaluated.
Why Agents Need Them
People learn a source object's vocabulary from its menus. An agent learns it from what the Rule Repository tells it about the source, and a user's request rarely uses the display names. A loan officer asks for "applications with a DTI over 43", while the field is labelled "Debt To Income". An underwriter writes "back-end ratio" for the same thing, and another system calls it dti_pct. A display name can only be one of these, and a description written for people ("Debt to income") does not say that the value is a percentage from 0 to 100.
AiAliases lists the other names, and AiDescription says what an agent needs to know:
[Field(DisplayName = "Debt To Income",
Description = "Debt to income",
AiAliases = new[] { "DTI", "debt-to-income ratio", "back-end ratio" },
AiDescription = "Monthly debt payments divided by gross monthly income, as a percentage (0 to 100).")]
public decimal DebtToIncome { get; set; }
With these, an agent finds the field from any of its names, writes 43, not 0.43, and still calls it "Debt To Income" when it shows the rule to the user.
The Two Properties
|
People see |
AI agents read |
| Name |
DisplayName: one name, in the editor's menus and in the rule's text |
DisplayName, plus every name in AiAliases |
| Meaning |
Description: a short text in the Help String and in the Rule Repository |
AiDescription; when it is not set, Description |
AiAliases holds other names an agent may know the element by: industry terms, abbreviations, synonyms, and the names other systems or documents use. It is an array of strings on the attributes (string[]) and a list on the Adaptive Source's classes (IList<string>).
AiDescription holds what an agent should know about the element when its description is not enough: what it means, its units or scale, where its value comes from, and when to use it rather than a similar element. It is a string.
Both are optional and additive. Setting them never changes the display name or the description, and an element without them works exactly as before.
How Agents Use Them
- Finding elements. When an agent looks for the fields, in-rule methods, actions and enumerations that match the user's words (the MCP tool
member_find, which the AI Rule Editor and the AI Assistant use as well), it matches the aliases as well as the display names, and gets each element's AI description with it.
- Enumeration values. An agent may write an enumeration value by its number, its declared name, its display name or one of its AI aliases. The Rule Repository turns it into the member, and refuses a word that matches two members.
- Talking to the user. The agent always calls an element by its display name when it speaks to the user and when it reads a rule back, so people see the same words the editor shows.
- Falling back. An element with no AI description is described to agents by its description; an element with no aliases is found by its display name alone.
Where You Can Set Them
Data sources and their items have neither: an agent searches a data source's live items instead. ExternalMethodAttribute, ExternalActionAttribute and ReturnAttribute have no labels of their own, so an external method or action takes its AI aliases and AI description from its MethodAttribute or ActionAttribute, as it takes its display name.
On a Class
using CodeEffects.Rule.Common.Attributes;
[Source(DisplayName = "Loan Application",
AiAliases = new[] { "loan", "application", "credit application" },
AiDescription = "A consumer loan application, evaluated once when it is submitted and again before funding.")]
public class LoanApplication
{
[Field(DisplayName = "Debt To Income",
AiAliases = new[] { "DTI", "debt-to-income ratio", "back-end ratio" },
AiDescription = "Monthly debt payments divided by gross monthly income, as a percentage (0 to 100).")]
public decimal DebtToIncome { get; set; }
[Field(DisplayName = "Channel", AiAliases = new[] { "origination channel", "lead channel" })]
public Channel Channel { get; set; }
[Method(DisplayName = "Credit Bureau Score",
AiAliases = new[] { "bureau score", "FICO", "live credit score" },
AiDescription = "Calls the credit bureau and returns the applicant's current score (300 to 850). Slow: use it only when the rule needs the live score.")]
public int CreditBureauScore() { /* ... */ return 0; }
[Action(DisplayName = "Notify Underwriter", AiAliases = new[] { "refer", "escalate" })]
public void NotifyUnderwriter(
[Parameter(Description = "Reason", AiDescription = "A short reason the underwriter reads first, such as 'Broker application'.")]
string reason) { /* ... */ }
}
public enum Channel
{
[EnumItem("Online", AiAliases = new[] { "web", "digital", "self-service" })]
Online = 1,
[EnumItem("Broker", AiAliases = new[] { "intermediary", "third party" },
AiDescription = "Submitted by a licensed mortgage or loan broker on the applicant's behalf.")]
Broker = 2,
Branch = 3
}
For a member reached through a reference property, put them on the ParentAttribute when the member means something different through that parent (the applicant's income and the co-applicant's income, for example); each property the parent does not set is taken from the member's own FieldAttribute.
In an Adaptive Source
The Rule Repository reads an Adaptive Source through its provider's GetSource(), so set the properties on the elements that method returns. The Source helpers (GetFields, GetMethods and GetEnum) copy them from a class's attributes for you. The provider's menu methods, which the stand-alone editor calls, may leave them out: nothing reads them there.
using System.Collections.Generic;
using CodeEffects.Rule.Editor.Client;
var field = new Field
{
Value = "DebtToIncome",
DisplayName = "Debt To Income",
DataType = DataType.Numeric,
AiAliases = new List<string> { "DTI", "debt-to-income ratio", "back-end ratio" },
AiDescription = "Monthly debt payments divided by gross monthly income, as a percentage (0 to 100)."
};
The source object's own aliases and AI description go on the Models.Source that GetSource() returns. ISourceProvider itself has no members for them, so an existing provider does not have to change.
In Source XML
In Source XML, they are the aiAliases and aiDescription attributes, the aliases joined by a vertical bar:
<numeric propertyName="DebtToIncome" displayName="Debt To Income" nullable="false"
min="0" max="100" allowDecimal="true" allowCalculation="true" includeInCalculations="true"
aiAliases="DTI|debt-to-income ratio|back-end ratio"
aiDescription="Monthly debt payments divided by gross monthly income, as a percentage (0 to 100)." />
When Code Effects writes Source XML from a class or an Adaptive Source, it writes the two attributes only on the elements that have them, so a source that sets none produces exactly the same Source XML as before. The aliases are cleaned on the way: each one is trimmed, empty ones and repeats (ignoring case) are dropped, and the first spelling is kept, in the order given.
In the Rule Repository
- They are labels, not definitions. Adding, changing or removing them never creates a new source version. The next sync updates the stored version in place, as it does for display names and descriptions, and records what changed in the source version's activity. Rules and tests are not affected.
- People can see them. The source tree of the source objects shows a member's AI Aliases and AI Description beside its description, so the people who review rules can see what agents are told.
- An order is a change. Aliases in a new order count as a change; the same aliases written with extra spaces or repeated do not.
Writing Good Aliases and Descriptions
- Start from the words people use. Read a few real requests, policies or tickets, and add the terms that do not match a display name. Abbreviations ("DTI", "LTV", "APR") and the names in other systems' reports are the usual gaps.
- Keep aliases specific. An alias that fits two elements ("amount", "date") sends an agent to the wrong one or makes it ask. Give a generic word to one element only, or leave it out.
- Say what a value is, not what the field is called. Units, scale (a percentage as 0 to 100 or 0 to 1), currency, time zone, which date it is (submitted, approved, funded), and where the value comes from.
- Say when to use it. For methods and actions especially: what it costs, what it changes, and which similar element to prefer in which case.
- Describe enumeration members whose names are not obvious. A member such as
Tier3 or Code R needs an AI description; Online does not.
- Write them in the language of your rules. Agents work in any language, but aliases are matched as words: add the other language's terms as aliases when your users write in more than one.
- Leave the rest empty. An element with a clear display name and description needs neither property.
Data and Privacy
AI aliases and AI descriptions are sent to the AI provider that your application connects to the Rule Repository, with the rest of the source's definition, whenever an agent works with that source. Write nothing in them that must not leave your organization: no customer data, credentials, internal URLs or confidential business terms. See What Leaves Your Server and Security.
See Also