Introduction to Agentforce for Developers, A Look Inside Salesforce's new AI Tool
Before we dive into Agentforce for Developers, a revolutionary tool by Salesforce, if you are not clear on what Agentforce is, or what an Agent is and what can it do, I would highly recommend going through my earlier blog on Agentforce by Salesforce
Did you know that a survey conducted by Stack Overflow in 2023 revealed that 68% of developers spend a significant amount of time doing repetitive tasks like writing boilerplate code and finding bugs? Agentforce for Developers, an AI-powered coding assistant built by Salesforce, designed to bridge the gap between productivity and data privacy.
Need for yet another AI Productivity tool
Agentforce for Developers can be viewed as an AI Agent that is built for developers and it resides in their IDE. Like how Agentforce Agents autonomously execute tasks, this Developer Agent automates tasks such as documentation, test case generation, and code autocompletion.
Why Frameworks Fall Short Compared to Agentforce for Developers?
The problem initially had to do with the lack of right tools. While frameworks do most of the heavy lifting, they still can't serve organization specific goals. Every company follows their own style of setting up codebases. A generic framework can mould only until some extent, after that point, anymore tweaks to the framework feels like rewriting it again.
Why existing LLMs aren't helpful?
With the advent of Generative AI like ChatGPT, this process becomes little less tedious now. For example, we can instruct ChatGPT about the coding practices in our company and it would setup a boilerplate code for us. However, What about data security? Unless your company is willing to share its secret sauce with some unknown LLM, it is not recommended to upload proprietary code into unknown LLMs. You can read more about lawsuit on OpenAI.
OpenAI announced that they wouldn't use customer data to train their model unless the user opts in. However, by default, everyone is opted in unless you disable the toggle button in the ChatGPT settings page.
Why DIY AI Models aren't helpful?
The other alternative here is DIY AI models, but training your own model with your organizational data can be time consuming and mostly not feasible, it is like assembling your own car just to go to the grocery store everyday!
Need of Agentforce for Developers
So, there is a gap here! Developers need a tool that they can trust, and it shouldn't use thier organizational data to optimise the models and yet it should scan through their organization's code repopsitory and provide intelligent suggestions. And, that is what exactly Agentforce for Developers promises to be!
How to install Agentforce for Developers?
Step 1
Install the Salesforce Extension Pack from here Salesfoce Extension Pack (Expanded). Ensure that you install the “Expanded” version of it. This auto installs the Agentforce for Developers extension as well
Step 2
Enable Telemetry for VS Code so that usage statistics maybe sent to Salesforce for continuous improvement.
Mac users can follow this video, Windows users, please follow the steps mentioned in the Trailhead.
Top Benefits of Agentforce for Developers in Salesforce Projects
As per the official documentation, Agentforce for Developers is a suite of tools specifically designed to ease the monotonous or I would rather call repetitive areas of software development. For example, you created a method which takes in a string parameter and outputs if the string is a palindrome or not. Here the most obvious test case would be to check if the string is null. The same applies for another function that calculates the number of words in a string. Do you see the problem here? The same nature of test got replicated.
What can Agentforce for Developers by Salesforce do for me?
Test case generation for Apex
If you had a tool that automatically generated unit tests for common functions, such as checking for null input, wouldn't you use it? Ofcourse you would if the data being transmitted is not persisted anywhere. Agentforce for developers serves this purpose very well. It is trained on the patterns of the most common test cases that a good software should write for a given type of function. Obviously, for complicated things like finding life outside Milky Way galaxy, it may not write the best test case.
Documenting the code
What other repetitive tasks are part of your regular Software Development Life Cycle (SDLC)? Were you ever chased by your team lead to write exhaustive documentation on some super sophisticated function that you wrote? If my guess is correct, you most probably would have gone through that. Well you're not alone, I've been through that as well! In fact, most developers have been through that phase at some point. Also, it is very important to write documentation for your code. Well, guess what, Agentforce coding assistant does that for you!
Code Explanations
God forbid there is a complex piece of code and no one bothered to document it. It's not always possible to chase the developer who wrote that code. Then what would you do? You might say, I would spend hours and hours understanding that. Well, my friend that's going to be a thing of the past. You give any complex piece of code to Agentforce for Developers and it will explain the code for you!
Code Autocomplete
Agentforce for Developers features a code autocomplete functionality as well. Similar to how your phone predicts the next word you might type, Agentforce for Developers predicts and suggests the next lines of code you might write. This not only speeds up development but also helps maintain consistency with your organization's coding patterns and best practices.
Internals of Agentforce for Developers
Well, it's time to get into some technical stuff. Agentforce for Developers generates code. It is same as generating music, generating movie plots, generating text etc. The idea here is, it is generative in nature. And what tools show this behaviour? LLMs!
What is an LLM?
An LLM stands for Large Language Model, LLMs are a type of AI models that are built by training them on extremely large volumes of data. This data could be anything written on publicly available websites, books, articles etc. They see patterns from all these sources and extrapolate it to a new query. That is how LLMs are built.
Have you heard the popular phrase “Garbage in, Garbage out” ? An LLM trained on garbage data gives garbage response! So the quality of LLM solely depends on the quality of data it is trained on.
The LLMs that power Agentforce coding assistant are CodeGen and xGen-Code. CodeGen takes care of code completion and code generation where as xGen-Code takes care of your chats with the Dev Assistant
CodeGen and xGen-Code are custom AI models developed by Salesforce AI research team, which means that any data you enter while interacting with Agentforce for Developers, never leaves Salesforce. And Salesforce promises that, Salesforce would not use customer data (your data, your prompts etc) to train their LLMs. So there is no chance of your code being spilled out in some other organization's query. This is taken care of!
Then where does the training data come from for Agentforce for Developers? Salesforce employees use a tool called CodeGenie, which may be an earlier version of Agentforce for Developers. The feedback from CodeGenie users feeds directly into improvements for Agentforce for Developers, benefiting external developers. Perhaps, the LLMs of Agentforce for Developers were trained on data that is purely internal to Salesforce and doesn't belong to any other organization.
How Agentforce for Developers stands out from competitors?
As of now, there are quite a few productivity tools in the market. Few of them are Github Copilot, Tabnine AI Code Assistant, Sourcery etc. The major issue with most of these tools is that, they don't have the rich data Salesforce has related to technologies in Salesforce eco system such as LWC, Apex, SOQL etc. Apart from that, most of these tools are completely paid, with no free version at all except for Sourcery. This itself makes them difficult to leverage.
Adding to that, CodeGenie, which can be safely considered the predecessor of Agentforce for Developers, is used by thousands of Salesforce Employees. I personally used CodeGenie for almost an year and it does an excellent job. All the feedback accumulated for the CodeGenie has been transferred to Agentforce for Developers. It clearly has a very big advantage which competitors may not have.
Conclusion
Agentforce for Developers appears to be a promising tool that helps developers improve productivity and reduce the number of times one has to do repetitive tasks. However, one has to keep in mind that, it is still a very new tool and as Salesforce keeps insisting, one has to get the code generated by Agentforce for Developers thoroughly reviewed before committing to the production.
Download Agentforce for Developers now →