Agentforce has taken the Salesforce and AI world by storm, aiming to revolutionize a user’s day-to-day tasks through agentic workflows.
Over the last few months, I have been fortunate enough to explore Agentforce and apply it to several use cases successfully.
Here are some of my key learnings:
Any new technology comes with a learning curve. With Agentforce, you can easily find yourself trying to build a perfect Agent that can do everything. Instead, start with a specific use case that helps you understand some key concepts of an Agent, such as topics, instructions, or even Agent actions. Then, you can take those learnings to improve your Agent over time.
Think of an Agent Topic as a guide for your Agent on when to act and what to do when prompted. It’s almost like a recipe for baking a cake, which tells you the exact quantities of items needed, when to mix them together, and how to mix them to achieve the perfect cake as the output.
A topic consists of four key areas: Classification Description, Scope, Instructions, and Example User Input. Each has its own nuances to consider and build into your Agent plan, and we’ll go through each area in the remaining learnings.
The Classification Description is a short description that helps the Agent understand what context/engagement should invoke this topic. Using the cake example from above, this might be something as simple as “when a user is trying to bake a cake and requires guidance.”
When creating the Description, be precise and concise. There were times when I experimented by moving formatting instructions, such as “each ingredient should be listed as a dot point with its quantity in the user’s desired form of measurement,” into the Classification Description to see what would happen. While moving the formatting instructions saw the topic being invoked, this did result in the output losing formatting that the Agent was previously getting from the instructions.
For optimal results, don’t set too many boundaries. Defining a broader classification description results in your Agent being able to handle prompts outside of your instructions that are still relevant to your topic.
Scope is the definition of the Agent’s activities and boundaries. In our cake-baking example, the scope would be something along the lines of “Understand the unit of measurement that the user works in, as well as which recipe the user is focusing on. Using the recipes defined, help, clarify, and recommend actions to be taken by the user.”
Like the Classification Description, be precise when defining the scope. However, you should not feel the need to condense it into a short sentence. Instead, focus on using commanding words like “Understand,” “Using,” and “Your Job” when defining the scope so it is clear to the Agent what it should be doing at different stages.
You should also take care to define any reference points. If your Agent will interact with other Salesforce objects, it’s important to define what they will be used for in the scope, and the instructions will help define how they are used.
Instructions are descriptions of what the Agent should be doing at different points in the conversation, as well as how the output should be formatted. These instructions can be simple or more extensive.
The most important instructions tend to be the simplest, such as defining the formatting of the output. For example, an instruction indicating how the date should be formatted on all outputs is crucial for catering to your audience. The simple instruction might be written as “All date outputs should be formatted as MM-DD-YYYY.”
Extensive instructions are more detailed instructions for the Agent but it’s still important to be concise and avoid repetition. The detailed instructions can be used to provide additional context on the data the Agent is working with and what to do when a critical piece of information is missing.
Users can combine relevant instructions where applicable. I’ve seen several approaches mentioned by other ISVs and Salesforce admins online around combining instructions into one instruction to rule them all or maintaining separate ones. From my experience, combining instructions does make for a more effective and faster response. However, this approach is only effective when combining relatively intertwined instructions.
Example user input provides prompts you expect your users to use when engaging with this topic.
Are these inputs needed? Up until recently, I always provided Example User Inputs. However, when I was moving my Agent between orgs, I left this out unintentionally and the Agent was able to handle a broader set of prompts than expected
By ensuring you have a strong scope and set of instructions, the Agent doesn’t really need example user inputs, as it will understand when to interact and how to interact. The Agent will also take its instructions and apply its best possible response to an irregular prompt.
In our next blog, we will explore Agent actions and how they expand an Agent’s capabilities even further.
In the meantime, for insight into the data quality issues that might hinder progress with Agentforce (or other AI tools), read our guide “4 Building Blocks of CRM Data Management.”