Understanding Context Fields
What are Context Fields?
Context fields are a configuration mechanism in REDA AI that automatically loads specific Salesforce record fields into the AI's context when a user is on a record page. Instead of the AI having to call a query tool to fetch a record's data, the data is pre-loaded and available immediately.
Context fields serve two purposes:
- Awareness — The AI knows which record the user is looking at
- Efficiency — The AI has the record's data without making tool calls (saving tokens and cost)
For example, if a user opens an Opportunity record and your agent has context fields configured for "Amount", "StageName", and "CloseDate", those three fields are automatically available to the AI. The AI can immediately discuss the opportunity without querying it first.
Why Context Fields Matter
Without context fields, when a user asks "What's the next step for this deal?", the AI would need to:
- Call soql_query or get_record to fetch the Opportunity data
- Wait for the result (adds latency)
- Then formulate a response
- Cost: extra tokens for the tool call and its result
With context fields:
- The Opportunity data is pre-loaded in the AI's context
- The AI immediately accesses the data without tool calls
- Instant response (no latency)
- Cost: no additional tokens — the data is already in context
Context Fields Structure
Context fields are stored as configuration records within REDA AI's setup. Each context field specifies:
| Property | Description |
|---|---|
| Agent Definition | Which agent this configuration applies to. Leave it blank to make the configuration universal — it then applies to every agent for that object. |
| Object API Name | The Salesforce object the configuration covers (e.g. Opportunity, Account, Case). |
| Field API Names | The fields to load, as a list of API names (e.g. StageName, Amount, CloseDate). One configuration record carries the whole list — you do not create a record per field. |
| Max Fields | How many fields this configuration may contribute. Default 10. |
| Include Related Names | When on (the default), lookup fields contribute the related record's name rather than its raw Id — so the agent reads “Acme Properties” instead of an 18-character key. |
| Context Description | Optional free text explaining to the agent what this record context represents and how to use it. |
| Record Type Developer Name | Optionally limit the configuration to one record type. A record-type-specific configuration outranks a general one for the same agent. |
| Sort Order | Order in which configurations are applied. Lower numbers first; default 100. |
| Is Active | Only active configurations are loaded. On by default. |
Three rules the field labels do not tell you.
- Max Fields is clamped to 1–25 at run time. The default is 10. Enter 40 and the agent still gets 25; enter 0 and it gets 1. The value is not rejected on save, so a config asking for 40 looks like it is working while quietly delivering 25.
- Sort Order is the last tiebreaker, not the first rule. Agent-specific beats universal, and record-type-scoped beats unscoped, before Sort Order is considered at all. It only orders configurations that are otherwise tied. A universal config with Sort Order 1 still loses to an agent-specific config with Sort Order 100.
- Record Type Developer Name is the DeveloperName, not the label. If the record type shows as “Commercial Lease” in Setup, the value here is likely
Commercial_Lease. A label typed in by mistake simply never matches, and the configuration silently never activates.
At most 50 configurations are considered for one object in a single turn. That is far above any sane setup, but it is the ceiling.
Where Context Fields are Used
Context fields are loaded only on record pages. Specifically:
- Opportunity record page — Context fields for Opportunity object are loaded
- Account record page — Context fields for Account object are loaded
- Case record page — Context fields for Case object are loaded
Context fields are NOT loaded on:
- Home pages
- List views
- Report pages
- External Widget deployments
This is intentional — context fields are for adding record-specific data when the user is focused on a particular record.
Priority Hierarchy
Context fields follow a priority hierarchy to determine which fields are loaded:
- Agent + Record Type — Context fields linked to the specific agent AND a specific record type (highest priority)
- Agent + AnyRecordType — Context fields linked to the agent with no record type restriction
- Universal + Record Type — Universal context fields (no agent) with a specific record type restriction
- Universal + AnyRecordType — Universal context fields with no restrictions (lowest priority)
If a context field is defined at multiple priority levels, the highest priority one is used. This allows for inheritance patterns where universal fields apply to all agents unless overridden by agent-specific fields.
Field-Level Security Applies
REDA AI respects Salesforce's Field-Level Security (FLS). If a user cannot read a field in Salesforce, that field is not included in the context, even if it's configured as a context field. This ensures:
- Sensitive fields are not exposed to users without permission
- Different users can see different context data based on their FLS permissions
- No security breach via the AI
For example, if your agent has "Salary" as a context field for Contact objects, but the user's profile doesn't have read access to the Salary field, that user won't see salary data in the AI's context.
Token Cost of Context Fields
More context fields = more tokens per interaction. Each field included in context consumes tokens. This directly impacts your credit cost. Therefore:
- Include only the 5-10 most relevant fields per object
- Use the Context Field Optimizer to get recommendations
- Remove fields that are rarely referenced by the agent
- Balance breadth of context with cost efficiency
As a rule of thumb, every additional context field adds proportionally more tokens to each interaction, so trimming your list down to only the fields an agent actually references can meaningfully reduce costs over time.
Universal Context Fields
A Context Field with a blank Agent Definition is a "universal" context field — it applies to ALL agents in the org for that object type. This is useful for:
- Shared Standards — Fields all agents should have access to (e.g., "Name", "CreatedDate")
- Consistency — Ensure all agents start with a baseline set of context fields
- Efficiency — Update the field once instead of updating multiple agent-specific copies
Agent-specific context fields can override universal ones using the priority hierarchy.
Common Context Field Patterns
- AccountName (related to Account)
- StageName (opportunity status)
- Amount (deal size)
- CloseDate (expected close)
- Probability (forecast confidence)
- CaseNumber (reference number)
- Status (open/closed)
- Priority (urgency)
- Description (issue summary)
- ContactName (customer contact)
- AccountName
- Industry
- AnnualRevenue
- NumberOfEmployees
Configure reusable business instructions
Exclusive Prompts let administrators assign reusable instructions to selected agents. Review the Exclusive Prompt flag and Summary on Custom Prompt, then the assignment's Agent Definition, Custom Prompt, Active and Load Mode. Use the intended load mode; On Demand needs the context-prompt tool in the agent's loadout. Record-type brackets use shared scope rules, including in preview and prompt administration. Prompt and tool ordering is deterministic, and runtime preview can use an actual record ID. Updated language instructions follow the message on API/external channels; user placeholders apply only where the authenticated user context is intended. Preserve custom prompts when merging the current defaults.
Frequently Asked Questions
Start with the 5-10 fields your agent most frequently references in conversations. Use the Context Field Optimizer to get AI-powered recommendations based on your agent's purpose and Salesforce schema.
Yes, you can add any field that the Salesforce API exposes. However, relationship fields may consume more tokens than simple text/number fields. Use carefully and test the impact on token usage.
Context field changes take effect immediately. The next time the agent loads on a record page, the new context field is included (subject to FLS and priorities).
If a context field has no value for a particular record, the AI sees the field as empty or not provided. The AI handles missing data gracefully and can ask follow-up questions or proceed without that information.
Next Steps
Learn how to add context fields to your agents, or use the Context Field Optimizer to get AI-powered recommendations.