For one in all New York’s most celebrated jewellery manufacturers, luxurious merchandise go hand in hand with a curated white glove expertise. The corporate not too long ago turned to agentic AI to scale the unequalled customer support that it’s well-known for, however shortly bumped into a typical impediment: latency. Prospects had been generally ready so long as 15 seconds in between agent responses.
With no apparent resolution, Salesforce’s Ahead Deployed Engineers (FDEs) stepped in to assist. FDEs are technical specialists that work immediately with clients to unblock deployment challenges. Armed with deep technical experience and located on the product crew, their suggestions immediately shapes the Agentforce roadmap. They quickly identified two issues: overly-prescriptive Apex code was bogging down the system, and a identified bug was including lag to every token earlier than it obtained despatched again to the client. Partnering with Salesforce engineering, the FDE crew devised an answer that introduced down latency from 15 seconds per response to three or 4.
Although every buyer faces their very own distinctive challenges in bringing AI brokers from pilot to manufacturing, each deployment can profit from the battle-tested finest practices gleaned from numerous FDE engagements. Under are 6 developer-level ideas from the agentic frontlines to unblock your Agentforce deployments.
- Efficient Subject and Motion Design: Deal with creating sturdy subjects and actions that reliably produce the specified output. Consider every subject as a bucket of actions, whereas directions are a strategy to additional outline the subject. You shouldn’t depend on directions to good your outputs since this will confuse the LLM and result in inconsistent or hallucinated responses. Finest practices for subjects and actions can be found within the Agentforce Information to Matters, Directions and Actions. At all times keep in mind these three finest practices:
- Use quick, clear directions so as to add nuance to agent responses.
- Let actions deal with deterministic logic.
- Don’t use directions as a backdoor to immediate the LLM to behave a sure approach. As a substitute, use a Immediate Template.
Don’t depend on directions to good your outputs. This will confuse the LLM.
- Understanding Agent Studying and Enchancment: Whereas Agentforce offers a strong suite of analytics instruments and methods to gather suggestions, it’s essential to notice that brokers gained’t mechanically be taught from this knowledge. Agentforce employs an AI-assisted human-in-the-loop mannequin the place people seize suggestions and manually replace the agent inside the planner. The purpose is to enhance the agent based mostly on person utterances and turn-by-turn responses, though the LLM doesn’t retain data from context variables past particular person conversations. Whereas instruments like Omni Supervisor and Interplay Explorer enable clients to audit agent conduct and shortly establish shortfalls, fixing these gaps nonetheless requires human intervention.
- Leveraging Context and Customized Variables for Agent Reminiscence: Prospects typically face eventualities the place knowledge must be saved and referenced for later use, corresponding to getting knowledge after which performing an motion with it, or mapping variables to motion inputs and outputs. To do that, you should use context and customized variables as a type of reminiscence to attach knowledge to subsequent actions. Customized variables are significantly useful for deterministic logic. To take care of agent reminiscence past the default 5-6 turns, you’ll be able to retailer context in a customized variable (e.g., `currentKnowledge`) and reference it all through the dialog. This successfully creates a persistent data base throughout the agent’s runtime, enabling the agent to reference responses from earlier within the dialog. This addresses the problem of the agent not having the ability to bear in mind info from, for instance, 30 turns in the past.
Customized variables can be utilized as a type of reminiscence.
- Strategic Use of Structured Responses: Whereas LLMs excel at pure language era, they often don’t present persistently structured responses. Not like a chatbot the place you anticipate the precise reply each time, Agentforce responses will likely be distinctive every time. Forcing an agent to generate a structured response provides appreciable complexity to directions and prompting, which ought to be prevented until there’s a transparent enterprise justification. If a structured response is critical, use Immediate Builder and take a look at totally different fashions. Each LLM has distinctive efficiency variations in latency, structured response output and token depend. Select the one which works finest in your use case. For those who want deterministic logic or outcomes, use Flows or Apex to deal with the enterprise logic and map customized variables to enter and output. Retailer the result in a customized variable and output it to the agent for use within the subsequent motion.
To be used instances like Order Administration, keep away from utilizing prompts to create logic mappers corresponding to if/else logic, or for loops. As a substitute, do that in Apex or Circulate for finest outcomes. LLMs and directions are usually not well-suited for dealing with business-specific if/else deterministic mappings, math, or calculations. When coping with knowledge, moderately than utilizing if/else logic or calculations inside directions or prompts, use Circulate or Apex to realize the specified deterministic outcomes.
Use Circulate or Apex to realize deterministic outcomes.
- Simulating Subject Sequencing: Although subject chaining isn’t natively supported, you’ll be able to work round this by prompting the person for a affirmation (e.g., a sure/no query like “Can we escalate this dialog to a dwell agent?”). This permits for a deterministic Circulate, helpful for eventualities like case creation or escalation. Prompting for affirmation is especially essential for subjects that may’t be simply reverted.
- Making certain Clear Descriptions for Customary Actions: For traditional actions like querying information, at all times make sure that objects and fields have clear and exact descriptions. Good knowledge results in good responses. Whether or not it’s CRM information, Knowledge Cloud knowledge, data, or exterior knowledge — all ought to have clear metadata, descriptions, fields, and content material to make sure correct grounding. One widespread subject for a lot of clients is having descriptions that match one merchandise however the intent is for one more, like “Work Order line objects” versus “Order Line objects.”