Scarica Salesforce Agentforce Specialist Certification - part 2 e più Appunti in PDF di Sistemi Informativi solo su Docsity!
Prompt Engineering (30%)
This section of the exam tests these topics:
1. Given business requirements, identify when it's appropriate to use
Prompt Builder.
2. Identify the right user roles to manage and execute prompt templates.
3. Identify the considerations for creating a prompt template using field
generation and flex types.
4. Given a scenario, identify the appropriate grounding technique.
5. Explain the process for creating, activating, and executing prompt
templates.
6. Explain how to use best practices for writing effective prompts.
Given business requirements, identify when it's
appropriate to use Prompt Builder.
Prompt Builder Key Concepts
Prompts
Generative language models are versatile and can create different types of responses. To produce a response, tell the LLM what you want in the form of a prompt. Prompts determine the quality and relevance of the LLM’s response, so it’s important to craft prompts that the model can understand and use.
Prompt Design
Prompt design is the process of creating prompts that improve the quality and accuracy of the model’s responses. Many models expect a certain prompt structure, so it’s important to test and iterate them on the model you’re using. After you understand what structure works best for a model, you can optimize your prompts for the given use case. To scale the prompt design process, create reusable prompts called prompt templates.
Prompt Templates
Behind the scenes, Einstein generative AI uses prompt templates. Prompt templates are reusable, detailed prompts that you can create and manage in Prompt Builder. These templates are use case-driven and include the information that helps the LLM generate a high-quality response, such as a goal, constraints, and brand guidelines. And to make sure that the prompts you send to the LLM are grounded in the most up- to-date data, prompt templates include placeholders for information that changes, such as customer names, contact information, and product prices.
Prompt Template Type
Prompt template types help you to create a prompt template for your particular use case. For example, a Sales Email prompt template helps your sales team to draft personalized emails for a contact or a lead.
Using prompt templates is ideal for B2C communications because they can generate consistent and data-driven output at scale. Templates that contain the same brand guidelines generate content with a unified voice and style. Each template is developed for a specific use case, and you can reuse it by tailoring the prompt with different data. Scenari di utilizzo ideali: Automazione di comunicazioni ricorrenti: E-mail di follow-up, risposte standardizzate Generazione di contenuti personalizzati: Proposte commerciali, descrizioni prodotto Analisi e sintesi dati: Report automatici, riassunti di casi Supporto alle decisioni: Raccomandazioni basate su dati CRM Elaborazione linguaggio naturale: Classificazione testi, sentiment analysis Criteri per l'adozione: Presenza di pattern ripetitivi nelle attività Necessità di consistenza nella comunicazione Volumi elevati di contenuto da generare Requisiti di personalizzazione basata su dati Salesforce Integrazione con processi esistenti di Sales/Service Cloud Business requirements che indicano l'uso di Prompt Builder: Scalabilità: Necessità di gestire volumi crescenti mantenendo qualità Compliance: Standardizzazione comunicazioni per requisiti normativi User experience: Miglioramento customer/agent experience Data utilization: Massimizzare valore dati CRM esistenti
Identify the right user roles to manage and execute
prompt templates.
Ruoli di gestione (Management): System Administrator Configurazione iniziale Prompt Builder ed Einstein settings Gestione permessi e sicurezza Supervisione architettura prompt Integration setup con altri Salesforce clouds Prompt Builder Administrator Creazione e modifica template prompt Gestione libreria template e versioning Configurazione grounding sources e data mapping Quality assurance e testing dei template Business Process Owner Definizione business requirements per template Approval workflow per template production Monitoraggio performance e ROI measurement Ruoli di esecuzione (Execution): Standard User/Sales User Esecuzione prompt preconfigurati nel daily workflow Utilizzo template approvati con parameter input Feedback provision per template optimization Service Agent Utilizzo prompt per case resolution e customer communication Generazione risposte clienti contextual Accesso template specifici per team e product line Marketing User Campaign content generation attraverso template Lead nurturing automated messaging Content personalization per audience segments
La creazione di template efficaci richiede un approccio strutturato che considera tecnica, business e governance. Struttura del template - Components essenziali: System instructions: Contesto, ruolo AI e obiettivi chiari User input placeholders: Variabili dinamiche con validation Output format specifications: Struttura, lunghezza, stile risposta Constraints e guardrail: Limitazioni content e behavior
Prompt Template Types , sono container preconfigurati da SFDC. Controllano: quali
dati puoi usare (grounding sources disponibili), quale object context è automaticamente disponibile, quali campi sono pre-mappati e accessibili, quali integrazioni sono pre-built (flow, api, etc.). I prompt template sono riutilizzabili, permettendoci di scalare.
- FLEX : Content for any business purposes that other templates don’t cover. Flex prompt templates let you define your own resources. Any object selection - puoi scegliere qualsiasi Salesforce object. Up to 5 resources per template. No predefined workflow - massima customization.
- FIELD GENERATION : Content for record fields in Lightning Experience. In Salesforce, users click a button to run this prompt and populate the field with output. Popola campi automaticamente usando AI. Real-time field updates durante record creation/edit. Integration con page layouts e forms.
- SALES EMAIL : Personalized customer email based on record data. You can select only one recipient (either a Contact or Lead) and one related object.
- RECORD SUMMARY : Summarized record data for a comprehensive view of a record. Record summary prompt templates are used by the Summarize Record standard invocable action. Agents use the Summarize Record standard agent action. Use cases per esame: Account executive summaries, Case resolution summaries, Opportunity pipeline reviews, Customer health scoring narratives.
- RECORD PRIORITIZATION : Prioritized records based on user input or available data. Using agents, the record prioritization prompt templates are used by the Prioritize Opportunities standard agent action. The Record Prioritization Template enables you to focus user attention on records based on specific criteria. Einstein Copilot conversational interface, Dynamic filtering capabilities.
Advanced Prompting Techniques , sono “ come scrivi il prompt” all’interno di un
qualsiasi tipo di template.
1) Zero-shot prompts (or direct prompts): they involve giving a model direct
instructions with no additional context or examples. This can be useful for things like generating new ideas for creative projects or summarizing a website—tasks where you won’t necessarily need a lot of additional framing to get a reliable output.
- Few-shot prompts: technique in which you give the AI a few examples of the task you want it to complete. By showing the AI examples in your prompt, it learns the pattern and produces a relevant result. This is especially useful when working with Salesforce records, automated email drafts, case summaries, or custom flows where structure and style matter. Use few-shot prompting when… a. You need specific output formatting. b. You want the AI to mimic a particular tone, structure, or style. c. The task is complex or domain-specific, like summarizing a customer support case in your company’s voice.
- Chain-of-thought prompts : this guides the AI to “think out loud” before delivering an answer. Instead of jumping straight to a response, the model walks through intermediate steps or reasoning, which improves accuracy— especially for multistep or logic-heavy tasks. This is especially helpful in Salesforce scenarios where reasoning is key, including lead qualification, case routing, and forecasting scenarios. Here are some opportunities to use chain-of-thought prompting: a. You want the AI to explain its reasoning before giving an answer. b. You’re completing a task that involves multiple steps, like checking record conditions or evaluating business logic. c. You’re debugging an AI response and want transparent thinking. Es.
"Ragiona passo dopo passo e spiega come costruire una query SOQL che
recupera tutte le opportunità chiuse vinte nell’ultimo trimestre, raggruppate
per owner."
- Role-based prompting : Is a technique where you assign the AI a specific role or persona before asking it to complete a task. Use role-based prompting when: a. You want the AI to mirror the tone and decisions of a specific Salesforce persona (for example, Sales Rep, Service Agent, Admin). b. You’re working on a task that relies on business context, like customer relationship management best practices, key performance indicators, or workflows.
- Creative prompts : help an AI generate original, imaginative, or stylistically engaging content. Use creative prompting when: a. You need fresh ideas (names, slogans, headlines, or concepts). b. You’re crafting content that has a tone, theme, or brand personality. c. You want variety and inspiration to get past the blank page. d. You’re supporting teams like marketing, enablement, or communications. Es.
"Genera 5 idee creative per un nome di campagna di marketing Salesforce
per promuovere un nuovo prodotto AI."
- Prompt lifecycles : Like software development or product management processes, prompts have lifecycles that make or break their value to the long-term function of a business. For any prompt that you might want to reuse, keep the following in mind.
- Develop: Plan and create prompts based on business needs using things like Prompt Builder, Prompt Templates, model APIs, and platform tools.
- Test: See how the prompts you’ve built work when you run them and compare your results to your intended goal (Prompt Playground).
- Monitor: Once you’re confident that a prompt is ready for use, rely on security and analytics from sources like Data Cloud AI reporting and the Einstein Trust Layer to get a complete view of how your prompts impact your business. (Prompt Metrics o Agent Analytics)
- Iterate: As you learn from the previous steps, adjust improve performance and accuracy. Prompt templates let you create new versions based on feedback data and save you the work of recreating complex prompts each time you want to alter or add a function.
|| Best practices di design || Chiarezza e specificità Istruzioni precise e non ambigue con esempi concreti Role definition chiaro per AI assistant Definizione esplicita del tono, stile e audience Gestione variabili dinamiche
Placeholder meaningful {!Contact.FirstName} non generici
Validazione e handling per input obbligatori vs opzionali Graceful degradation per valori nulli/vuoti Data type consideration (text, number, date, picklist) Controllo qualità integrato Testing con sample data rappresentativi della production Validazione output consistency across different inputs Performance monitoring e optimization triggers Error handling e fallback mechanisms || Governance considerations || Compliance requirements: Rispetto normative settoriali (GDPR, HIPAA, SOX) Brand guidelines: Coerenza comunicazione e voice aziendale Data privacy: Protezione PII e sensitive information
Field generation prompt templates can have merge field corresponding to these objects: Current User, Current Org (the User’s Org), The object that you associated with the prompt template. Flex prompt templates can have merged fields corresponding to these objects: Current User, Current Org (the user’s Org), The objects that you associate with the prompt template. When you select a standard or custom object field in the Prompt Template Workspace, the field is added to your template as
Input:RecordName.FieldName. During prompt resolution, real CRM values
populate the merge fields based on the specific records that your user selects. Es. Generare e-mail di follow-up per un'opportunità. Fonte: Record Opportunity (ID specifico) Campi inclusi: Opportunity.Name Opportunity.StageName Opportunity.Amount Opportunity.CloseDate Account.Name Account.Industry Contact.FirstName Template con grounding:
System: Scrivi email follow-up professionale
DATI CLIENTE (da grounding):
- Cliente: {!Account.Name}
- Settore: {!Account.Industry}
- Contatto: {!Contact.FirstName}
- Opportunità: {!Opportunity.Name}
- Valore: {!Opportunity.Amount}
- Fase: {!Opportunity.StageName}
- Chiusura prevista: {!Opportunity.CloseDate} Genera e-mail personalizzata usando questi dati specifici. Output risultante:
Caro Mario,
Spero tu stia bene. Volevo aggiornarti sul progetto "Digital
Transformation Initiative" da €150.000 che stiamo discutendo per
TechCorp.
Vedo che siamo nella fase di "Proposal/Price Quote" con chiusura
prevista per il 30 settembre. Nel settore Technology come il vostro,
questo tipo di implementazione...
- Flow Merge Fields : Use Flow Builder to add complex logic to a prompt template. With flows, you can also access unified Data Cloud objects. By referencing Data Cloud data, you can use real-time information that was consolidated across multiple data sources.
You can create a flow for use with a prompt template by
selecting Template-Triggered Prompt Flow in Flow Builder. A prompt
template flow launches from a prompt template, and then it adds prompt
instructions to the associated prompt template. To reference Data Cloud
data, use the Get Records element. In the Get Records element, select
Data Cloud Object as your data source. Next, select the relevant data
space or object, and specify filters to narrow your data. After that, use
Data Cloud record data as you do with any record variable in the flow.
Then, use Create Prompt Instructions elements to write the prompt
instructions that the flow returns to the associated prompt template.
These prompt instructions can include merge fields for CRM and Data
Cloud data based on the outcome of a Decision element. Each merge
field returns a value as a string of text in the prompt instructions.
Recuperano ed elaborano dati tramite un Flow Salesforce. I risultati del Flow possono poi essere usati nel prompt come merge fields (es. {{! FlowOutput.CaseSummary}}). Vantaggio: permettono dati dinamici, aggiornati e arricchiti con logiche di business. Sono ideali quando servono riepiloghi personalizzati che coinvolgono più record o relazioni (come Account + Case).
- Apex Merge Fields : You can use an Apex merge field in a prompt template to return data from a SOQL query or an external API. Apex is also effective if you want to generate well-formatted JSON or do programmatic data filtering. To use Apex in Prompt Builder, you must create an Apex class that contains at least 1 method annotated with InvocableMethod. If desired, the InvocableMethod annotation can specify a CapabilityType that matches the prompt template type. Example annotation: @InvocableMethod(CapabilityType='PromptTemplateType://einstein_gpt__sal esEmail'). This table lists the CapabilityType for each prompt template type.
Sales Email PromptTemplateType://einstein_gpt__salesEmail
Field Generation PromptTemplateType://einstein_gpt__fieldCompletion
Record Prioritization
PromptTemplateType://einstein_gpt__recordPrioritization
Record Summary PromptTemplateType://einstein_gpt__recordSummary
The method’s input parameter must have a List type. The Request class defines an InvocableVariable member for each input defined by the prompt template type. All inputs are passed from the prompt
Multi-language knowledge base support Content freshness filtering Es. Scenario: Customer service che deve rispondere a un problema tecnico Setup grounding: Fonte: Knowledge Articles in Salesforce Filtri: Categoria = "Technical Issues", Prodotto = quello del case Modalità: Search semantico basato sulla descrizione del problema Caso del cliente: Problema: "Il software si blocca quando importo file CSV grandi" Prodotto: "DataManager Pro" Grounding automatico trova: Articolo KB001: "Risoluzione crash import CSV - DataManager Pro" Articolo KB045: "Ottimizzazione performance import dati" Articolo KB088: "Limiti file size e workaround" Template con grounding:
System: Risolvi questo problema tecnico usando la knowledge base
PROBLEMA CLIENTE: {!Case.Subject}
DESCRIZIONE: {!Case.Description}
PRODOTTO: {!Case.Product__c}
KNOWLEDGE BASE RILEVANTE:
{grounded_knowledge_articles}
Genera risposta che:
1. Riconosce il problema specifico
2. Fa riferimento agli articoli KB appropriati
3. Fornisce step-by-step solution
4. Include preventive measures
Output risultante:
Caro Cliente,
Ho analizzato il problema con i crash durante l'import di file CSV in
DataManager Pro.
Dalla nostra knowledge base (articolo KB001), questo è un problema noto
che si verifica con file superiori a 50MB. La soluzione consiste in:
1. Dividere il file in chunks più piccoli (max 25MB)
2. Utilizzare la funzione "Import progressivo" nel menu Strumenti
3. Verificare che il formato CSV rispetti le specifiche dell'articolo KB045...
- Knowledge Using Retrieval Augmented Generation (RAG) (= Search-based Grounding):
Il prompt fa ricerche real-time in fonti esterne per informazioni aggiornate. Scenario appropriato: Information retrieval real-time da fonti multiple. Utilizzo optimale: Competitive intelligence gathering Market research integration External data enrichment Real-time content verification Dati fonte: External APIs, Web sources, Third-party databases. Considerations: Data accuracy e source reliability API rate limits e cost management Privacy implications di external data usage Es. Scenario: Sales rep deve preparare meeting con prospect nel settore automotive Setup grounding: Fonte: Web search, industry reports, news APIs Query automatica: "automotive industry trends 2024 digital transformation" Filtri: Date recenti, fonti affidabili, industry-specific Grounding automatico trova: Trend: "80% automotive companies investing in AI" News: "New regulations for connected vehicles" Report: "Supply chain digitalization priorities" Template con grounding:
System: Prepara briefing pre-meeting per sales call
CLIENTE TARGET: {!Account.Name}
SETTORE: {!Account.Industry}
MEETING DATE: {!Event.ActivityDateTime}
INDUSTRY INTELLIGENCE (real-time):
{grounded_search_results}
Genera briefing che include:
1. Trend settoriali rilevanti per il cliente
2. Challenges specifici dell'industry
3. Come il nostro prodotto si collega ai trend
4. Domande intelligenti da porre
Output risultante:
BRIEFING PRE-MEETING - AutoParts Corp
✅ Industry intelligence è importante
✅ Dati cambiano frequentemente
✅ Competitive analysis è necessaria
Explain the process for creating, activating, and
executing prompt templates.
Fase 1: Creazione Prompt Template Setup e Planning:
- Business Requirements Analysis o Stakeholder interviews -> Identify use case e business objectives o Define success metrics e KPIs misurabili
- Technical Prerequisites: o Einstein enabled nell'org o Prompt Builder permissions assegnate agli user appropriati o Object access permissions per grounding data o License requirements verified (Einstein 1 license, etc.) Template Configuration:
- Initial Setup Process o Navigate: Setup → Einstein → Prompt Builder o Create New Template: Click "New Prompt Template" o Select Template Type
- Template Design elements o Prompt Content Creation:
- System instructions clear e specific
- Merge field placement strategico {!Object.Field}
- Output format specifications dettagliate
- Tone e style guidelines definite o Grounding Configuration:
- Data source selection (quale objects)
- Field mapping per record merge fields
- Relationship traversal setup se necessario
- Data validation rules o Input Parameters Setup:
- Required vs optional inputs definition
- Data type specifications (text, number, picklist)
- Default values configuration
- Validation rules per input quality Testing e Validation: