Skip to main content

Get to Know Agentforce for Developers

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe how Salesforce protects customer data.
  • Explain how Agentforce for Developers can increase developer productivity.
  • List the generative AI tools available in Agentforce for Developers.

What’s Agentforce for Developers?

Agentforce for Developers is a set of generative AI tools designed to increase developer productivity and assist with complex coding tasks. With Agentforce for Developers, you can use chat and prompts to generate Apex code, see code completion suggestions as you type, quickly generate unit tests, and more. Boilerplate code generation is at its core, so the toolset also makes it easier for new developers to get started on the Salesforce Platform.

As a pair programmer, Agentforce for Developers assists you throughout the development process with expertise learned from anonymized code patterns in CodeGen and xGen-Code, the secure, custom AI models from Salesforce. We enforce development best practices with code generation and our suite of recommended static analysis and security scanning tools.

Agentforce for Developers works with ‌Salesforce DX projects. It’s available as a part of the Salesforce Extension Pack (Expanded) on the Visual Studio Marketplace. You can install it in the VS Code IDE, and it’s preinstalled in Code Builder.

Trusted Generative AI at Salesforce

We designed, developed, and delivered the Agentforce solutions to be compliant with our five principles for trusted generative AI.

Accuracy: We prioritize accuracy, precision, and recall in our models. We explain our model outputs and sources whenever possible. We recommend that a human check the model output before sharing with end users.

Safety: We work to mitigate bias, toxicity, and harmful outputs in our models using industry-leading techniques. We protect the privacy of personally identifiable information (PII) in our data by adding guardrails around this data.

Honesty: We make sure that the data we use in our models respects data provenance and that we have consent to use the data.

Empowerment: Whenever possible, we design models to include human involvement as part of the workflow.

Sustainability: We strive to build right-sized models that prioritize accuracy and reduce our carbon footprint.

Note

Salesforce doesn’t use your data or code to improve the Agentforce for Developers product, or to train a global model. See our terms of use.

Salesforce Large Language Models

Agentforce for Developers is powered by custom large language models (LLMs) developed by Salesforce. These models are CodeGen2.5 and xGen-Code.

CodeGen2.5

A member of the growing family of Salesforce CodeGen models, CodeGen2.5 shows that a small model, if trained well, can achieve surprisingly good performance. This model powers the Inline Autocompletions feature in Agentforce for Developers.

xGen-Code

Our newest LLM, xGen-Code, has been fine-tuned to handle code-related tasks and support interactive features such as Dev Assistant. The xGen-Code model is well-equipped to handle tasks that require deeper code understanding and more complex reasoning.

Key Features of Agentforce for Developers

Agentforce for Developers is your helpful coding assistant in Visual Studio Code and Code Builder as you work on Apex and Lightning web component (LWC) files in your Salesforce DX project. Here’s an overview of features.

Dev Assistant: Code with ease with the help of your Dev Assistant right beside you. Get started with code generation and Salesforce development by asking Agentforce for assistance. With easy-to-use slash commands, you can also focus on specific tasks like understanding new code and improving your code documentation.

Command Palette: Use the Einstein: Generate Code command in the VS Code Command Palette to enter a question about what you want to build. Agentforce responds with Apex code suggestions right in your editor.

Inline Autocompletions: As you type, Agentforce for Developers can suggest code completions without any interruptions to your workflow. Easily choose the suggestion that works for you. Use this feature in Apex and LWC (JavaScript, CSS, and HTML) files.

Test Case Generation for Apex: Use Agentforce for Developers to get a head start on writing unit test cases for your Apex methods. Quickly get to required Apex test coverage and get your code ready for deployment.

Before You Start

Before you start using Agentforce for Developers, you must enable Salesforce telemetry. Our telemetry monitors and audits Salesforce generative AI to ensure that it functions properly. Enabling it is ‌easy to do. Just follow these steps in VS Code or Code Builder.

  1. Select File | Preferences | Settings (Windows or Linux) or Code | Settings | Settings (macOS).
  2. Search for salesforcedx-vscode-core.telemetry.enabled to confirm that this Salesforce telemetry setting is on in your workspace.
  3. If the setting isn’t on, select the checkbox to enable telemetry.
  4. Next, search for telemetry, then choose all from the dropdown menu for the Telemetry: Telemetry Level setting.
  5. Open a terminal and run sf config set disable-telemetry=false --global to enable CLI telemetry.
  6. Press Command+Shift+P on Mac or Ctrl+Shift+P in Windows to open the Command Palette, and run Developer: Reload Window.

By default, Agentforce for Developers is enabled in the desktop application, and can be easily enabled in Code Builder too. To enable Agentforce for Developers in Code Builder, just click the Einstein icon in the status bar. This icon displays the status of Agentforce for Developers in your project. Click the icon to turn it off or on at any time.

VS Code window with the Einstein icon highlighted in the status bar

Note

Agentforce for Developers uses generative AI, which can produce inaccurate or harmful responses. The output generated by AI is often nondeterministic. Before using the generated output, review it for accuracy and safety. You assume responsibility for how the outcomes of Agentforce are applied to your organization.

Now that you have the basics, let’s take a closer look at these features in ‌the next units.

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈