Architect Notes
- https://architect.salesforce.com/docs/architect/decision-guides/guide/determining-agentic-vs-traditional-workflow-automation.html?d=afx
Agentforce Data Library
- Setup –> Einstein –> Agentforce Data Library –> Upload files there
- Salesforce automaitcally creates Retriever + index file, Domo — verify in data cloud
- In order to use this retriever, we must have data givernance policy enabled: https://help.salesforce.com/s/articleView?id=data.c360_a_create_allow_all_policy.htm&type=5
Conceptual Notes
- Prompt builder can be used in apex like this:
ConnectApi.EinsteinPromptTemplateGenerationsInput input = new ConnectApi.EinsteinPromptTemplateGenerationsInput();
input.additionalConfig = new ConnectApi.EinsteinLlmAdditionalConfigInput();
input.isPreview = false;
Map<String, ConnectApi.WrappedValue> inputParams =
new Map<String, ConnectApi.WrappedValue>();
ConnectApi.WrappedValue oppVal = new ConnectApi.WrappedValue();
oppVal.value = new Map<String, String>{
'id' => String.valueOf(RecordId)
};
inputParams.put('Input:Opp', oppVal);
ConnectApi.WrappedValue searchVal = new ConnectApi.WrappedValue();
searchVal.value = searchQuery;
inputParams.put('Input:SearchQuery', searchVal);
ConnectApi.WrappedValue retrieverVal = new ConnectApi.WrappedValue();
retrieverVal.value = DEFAULT_DATA_LIBRARY_RETRIEVER;
inputParams.put('Input:RetrieverIdOrName', retrieverVal);
input.inputParams = inputParams;
ConnectApi.EinsteinPromptTemplateGenerationsRepresentation result =
ConnectApi.EinsteinLLM.generateMessagesForPromptTemplate(
promptTemplateDeveloperName.trim(),
input
);
ConnectApi.EinsteinLLMGenerationItemOutput generation = result.generations[0];
return parseRequirementsJson(generation.text);
- If we create an agentforce agent with type Employee then we can show in global action on top. You can add ADL in data in the agent
Instruction Canvas:
-
- Use / to put IF/ELSE
-
- Use @ to use varible and actions
Instruction Writing Rules (Golden Rules)
| Rule | Why |
|---|---|
| Write instructions in imperative form | “Always call X” not “X should be called” |
| Keep each instruction to one idea | Multi-idea instructions confuse the LLM |
| Be explicit about order | “First do X, then do Y, then respond” |
| Define fallback behaviour | “If the action returns no data, tell the user you couldn’t find the record” |
| Limit scope creep | Add “Only handle X” to prevent the topic from expanding |
- Set negative scope in instructions
How Atlas Actually Selects a Topic:
User message comes in
↓
Atlas reads ALL topic classification descriptions at once
↓
Scores each topic for semantic similarity to the message
↓
Picks the HIGHEST scoring topic
↓
Executes that topic’s actions + instructions
The classification description VS Topic Instruction:-
- Topic description talks to Atlas (the AI router). Instructions talk to the agent (after routing).
- The classification description is never seen during execution. The instructions are never seen during routing.
How Atlas works with Apex Action
The @InvocableMethod Description Does the Heavy Lifting
Remember the description you wrote on the Apex action:
apex
@InvocableMethod(
label='Create Support Case'
description='Creates a new Salesforce support case for
the customer. Call this only after collecting the issue
description, affected product, and severity from the
customer and after they have confirmed the details.'
)
What a Salesforc Developer need to learn actually:
| Skill | Your status |
|---|---|
Apex + @InvocableMethod |
✅ Already know it |
| Salesforce data model | ✅ Already know it |
| Flow + automation thinking | ✅ Already know it |
| Debugging + org setup | ✅ Already know it |
| Topic + Instruction writing | ⬅ This is the only new muscle |