本文へ移動
cccskills
無料GitHub で公開

einstein-discovery-setup

Use this skill when an admin needs to create an Einstein Discovery story in CRM Analytics Studio, configure prediction definitions, deploy writeback fields, set up what-if analysis, or manage model refresh and activation. Trigger keywords: Einstein Discovery story, prediction definition, writeback field, CRM Analytics Studio, model refresh, what-if analysis, bulk scoring, prediction field, 1OR prefix. NOT for the Einstein Discovery Flow action or model-health monitoring in Model Manager — use admin/einstein-discovery-deployment. NOT for Einstein Prediction Builder, a separate product needing no CRM Analytics license — use agentforce/einstein-prediction-builder. NOT for programmatic scoring through the Connect REST API — use agentforce/einstein-discovery-development.

インストール方法を見る

含まれるファイル(8)

  • SKILL.md15.1 KB
  • references/examples.md6.4 KB
  • references/gotchas.md6.7 KB
  • references/llm-anti-patterns.md11.0 KB
  • references/metadata-examples.md6.6 KB
  • references/well-architected.md6.7 KB
  • scripts/check_einstein_discovery_setup.py8.8 KB
  • templates/einstein-discovery-setup-template.md2.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Einstein Discovery Setup

Use this skill when an admin configures Einstein Discovery: creating stories, deploying prediction definitions, writing predictions back to Salesforce fields, enabling improvements for what-if analysis, and managing model refresh and activation. It covers the admin path and the metadata that carries a prediction definition between orgs. For programmatic scoring and REST endpoints, use agentforce/einstein-discovery-development.

Grounding note: the Einstein Discovery admin guide pages are on help.salesforce.com, which did not fetch for this pass, and the Einstein Discovery REST API guide did not fetch either. The grounded source here is the Metadata API Developer Guide's DiscoveryAIModel, DiscoveryGoal, and DiscoveryStory types. Wizard and UI behavior carried from earlier versions of this skill is marked UNVERIFIED where it is stated as fact.


Before Starting

  • CRM Analytics license. Einstein Discovery requires a CRM Analytics license; Einstein Prediction Builder does not. The Analytics Platform Setup Guide lists Einstein Predictions as a separately purchased capability alongside CRM Analytics Growth and Plus.
  • What a prediction definition is. In metadata it is a DiscoveryGoal (Package Manager label "Discovery Prediction"): "a container object in Einstein Discovery that is associated with one or more deployed models". It names the Salesforce object (subscribedEntity), the outcome, the deployed models, and the writeback field (pushbackField).
  • Segmented models. A prediction definition "can contain up to ten active models"; each deployed model can carry segmentation filters, and "the first model that has filters matching a specific input row will be used to make the prediction".
  • Writeback field lifecycle. "Removing a pushback field from the goal metadata causes the field to be deleted from the Salesforce object as well." Treat the goal file as the owner of that field.
  • UNVERIFIED (2026-10-03) claims carried from earlier versions of this skill: story creation happens only in Analytics Studio (App Launcher, Analytics Studio, Create, Story); at most three writeback fields per object; writeback fields get no field-level security by default; refreshed models are not activated automatically; prediction definition IDs start with 1OR. These are help-only and should be checked in the org.

Questions to Ask Before Configuring

Ask these before creating a story. Each one traces to a gotcha in references/gotchas.md.

QuestionWhy it mattersWhat a good answer addsWhat proper configuration adds over just doing it
"Which outcome are we predicting, and which fields are only known after it happens?"Leakage fields inflate accuracy and produce useless live scores (gotcha 7)The outcome field and an excluded-variables listA model whose scores hold up on open records
"Do different segments (region, product line) behave differently enough to need their own model?"One prediction definition holds up to ten active models; the first matching filter wins (gotcha 2)Segment filters in priority orderPredictions from the right model for each record
"Which fields are sensitive, and could any act as a proxy for a protected attribute?"Model fields carry isSensitive and isDisparateImpact flags (gotcha 6)A reviewed list of sensitive and disparate-impact fieldsA bias review on record before scores reach users
"Who sees the prediction field, and where?"The writeback field lives on the record; its visibility follows field-level security (gotcha 8)The permission sets and layouts that show the scoreScores visible to the right users from day one
"Will this prediction be moved between orgs with metadata?"Removing pushbackField from the goal file deletes the field (gotcha 1); models are not authored in metadata (gotcha 3)A retrieve-then-deploy procedure that never drops the fieldPromotions that do not destroy the writeback field or its history
"Who reviews and activates each refreshed model, and how is accuracy judged?"terminalStateFilters define when an outcome is final for accuracy monitoring (gotcha 5)An owner, a cadence, and a terminal-state definitionModel drift caught by a person, not discovered by users

What a proper setup adds over "just deploying the story": the right model scores each segment, sensitive fields are reviewed, the writeback field survives every deployment, and someone owns each refresh.


Core Concepts

Story, model, and prediction definition

ConceptMetadata typeKey facts
StoryDiscoveryStoryThe analysis Einstein Discovery builds from a dataset
ModelDiscoveryAIModel (.model file plus -meta.xml, in the discovery folder)algorithmType, predictionType, modelFields, status; "write operations for DiscoveryAIModel objects are generally not supported"
Prediction definitionDiscoveryGoal (.goal, in the discovery folder)subscribedEntity, outcome, deployedModels, pushbackField, pushbackType, terminalStateFilters, active

Algorithms and prediction types

DiscoveryAlgorithmType values are Best (tournament model), Glm (generalized linear model), Gbm (gradient boosting machine), Xgboost, and Drf (random forest). DiscoveryPredictionType values are Regression, Classification (binary), MulticlassClassification, and Unknown. Earlier versions of this skill said Einstein Discovery chooses only between regression and GBM; the metadata enumeration lists more algorithms. UNVERIFIED (2026-10-03): which algorithms the story wizard offers, and whether the admin chooses or the tournament picks, is help-only.

Writeback (pushback) fields

pushbackField is the "automated writeback field for predictions. A custom field on the Salesforce object specified in subscribedEntity." pushbackType "must be set to AiRecordInsight"; Direct is reserved. UNVERIFIED (2026-10-03): earlier versions of this skill said the field is read-only, updates only through bulk scoring or explicit API calls (never on record save), and is limited to three per object. Test record-update behavior in a sandbox before telling users how fresh scores are.

Model refresh and activation

Each deployed model has an active flag, and the prediction definition has its own active flag. UNVERIFIED (2026-10-03): that a completed refresh leaves the new model inactive until an admin activates it in Model Manager is help-only, but the operating rule is the same either way: someone reviews accuracy and decides which model is active.


Common Patterns

Pattern 1: End-to-end story deployment with writeback

When to use: Score open Opportunities with a win prediction and show the score on the record page.

How it works:

  1. Create the story from the Opportunity dataset with the outcome and explanatory variables; exclude fields populated only after close.
  2. Review model fields flagged sensitive or disparate impact before deploying.
  3. Deploy the model to a prediction definition on Opportunity, with a writeback field and improvements if what-if suggestions are wanted.
  4. Grant field-level security on the writeback field and add it to the page layout or the record page.
  5. Score existing records and spot-check values.
  6. Retrieve the DiscoveryGoal into source control so the field and model mapping are versioned (see references/metadata-examples.md).

Pattern 2: Segmented prediction definition

When to use: Win drivers differ by region.

How it works: Deploy one model per region to the same prediction definition, each with a filter on the region field. Put the most specific filters first, because the first matching model scores the row. Keep a final model with no filters as the catch-all ("no filters indicates that the model matches all input rows"). Stay within ten active models.


Decision Guidance

SituationRecommended ApproachReason
No CRM Analytics licenseEinstein Prediction BuilderEinstein Discovery needs CRM Analytics
Different behavior by segmentSeveral deployed models with filters in one prediction definitionUp to ten active models; first matching filter wins
Promote to productionRetrieve DiscoveryGoal, deploy it, keep pushbackFieldRemoving pushbackField deletes the field
Need model authored outside SalesforceModel Manager upload, not metadataUserUpload source type is not supported in the Metadata API
Fresh scores at a business momentDeveloper scoring API (agentforce/einstein-discovery-development)Admin path is not built for event-driven scoring
Accuracy monitoringDefine terminalStateFiltersAccuracy compares predictions with outcomes that have reached a terminal state

Recommended Workflow

  1. Confirm prerequisites. CRM Analytics license, admin permissions, target object, outcome field, and the excluded-variables list.
  2. Create and review the story. Build it in Analytics Studio, exclude leakage fields, and review fields flagged sensitive or disparate impact.
  3. Deploy the prediction definition. Choose segments and filters (up to ten active models), the writeback field, and improvements; define terminal-state filters for accuracy monitoring.
  4. Make the score visible. Grant field-level security on the writeback field, add it to layouts, and score existing records.
  5. Put it under source control. Retrieve the DiscoveryGoal (and the models it references) with package.xml; never deploy a goal file that has lost its pushbackField.
  6. Run refresh as an operation. Name the owner who reviews each refreshed model's metrics and decides which model is active, then rescore.

Review Checklist

  • CRM Analytics license confirmed
  • Leakage fields excluded from explanatory variables
  • Sensitive and disparate-impact fields reviewed and recorded
  • Segment filters ordered most-specific first, with a catch-all model, at most ten active models
  • Writeback field field-level security and layout placement done
  • terminalStateFilters defined for accuracy monitoring
  • DiscoveryGoal retrieved into source control with pushbackField intact
  • Refresh owner and activation procedure documented

Salesforce-Specific Gotchas

The deep versions, with sources, live in references/gotchas.md.

#GotchaOne-line consequence
1Removing pushbackField from goal metadata deletes the fieldA careless deploy destroys the score field
2Up to ten active models; the first matching filter winsBadly ordered filters send rows to the wrong model
3DiscoveryAIModel write operations are generally not supportedHand-authored model files do not deploy
4pushbackType must be AiRecordInsightOther values are reserved or unsupported
5Accuracy needs a terminal-state definitionMonitoring compares against outcomes that are not final
6Model fields carry sensitive and disparate-impact flagsBias review skipped if nobody reads them
7Leakage fields inflate accuracyLive scores are poor despite great training metrics
8Writeback visibility and refresh behavior are help-only claimsTest before promising score freshness

Output Artifacts

ArtifactDescription
Story configuration summaryOutcome, explanatory variables, excluded leakage fields, sensitive-field review
Prediction definitionDiscoveryGoal with models, segment filters, writeback field, terminal-state filters
Writeback field visibilityField-level security and layout placement
Model refresh runbookOwner, cadence, accuracy review, activation, rescoring

Related Skills

  • agentforce/einstein-discovery-development: Connect REST API scoring, bulk predict jobs, and model management via API
  • agentforce/einstein-prediction-builder: binary predictions without a CRM Analytics license
  • architect/crm-analytics-vs-tableau-decision: whether Einstein Discovery is the right tool
  • admin/einstein-discovery-deployment: the Flow action and Model Manager monitoring

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use this skill when writing test-first, behavior-driven acceptance criteria in Given/When/Then format for a Salesforce user story. Covers happy path, edge cases, negative paths, permission boundaries, and data-state preconditions so the AC block can drive UAT scripts and Apex test design downstream. Trigger keywords: given when then, gherkin, behavior driven AC, test first acceptance criteria, scenario outline, BDD acceptance criteria. NOT for the user-story format itself (use admin/user-story-writing-for-salesforce). NOT for UAT script writing (use admin/uat-test-case-design). NOT for Apex test method generation (use agents/test-class-generator). NOT for high-level UAT planning (use admin/uat-and-acceptance-criteria). More triggers: acceptance criteria record, ac_id, req_id on a criterion, artefact under test, negative case for a rule-type requirement, no-match fall-through criterion, oracle for a Then clause, test type apex flow manual, criteria linter, check_ac_format.py, --manifest-dir.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Task and Event objects: polymorphic WhatId/WhoId, Activity object model, ActivityHistory vs OpenActivity, activity timeline customization, bulk task creation, Einstein Activity Capture boundaries. NOT for turning on EAC or calendar sync — use admin/einstein-activity-capture-setup. NOT for Email-to-Case — use admin/case-management-setup. Covers ActivitiesSettings metadata, enableActivities, shared Task/Event custom fields and FLS, TaskStatus value sets, Shared Activities and TaskRelation/EventRelation, recurring and child activities, and partial-success bulk DML on Task.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Design Invocable Apex actions that return deterministic, agent-friendly errors instead of surfacing raw exceptions to the LLM. NOT for authoring the action itself — @InvocableMethod schema, labels, security context — use agentforce/custom-agent-actions-apex. NOT for the Apex tests that force each error branch — use agentforce/agent-action-unit-tests.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Use when designing how an Agentforce agent extracts structured input parameters (slots) from a user's natural-language utterance to invoke an action. Triggers: 'agent extract date from user', 'agent action argument extraction', 'agentforce slot filling', 'agent invocable input mapping', 'agent fails to fill required parameter'. NOT for action authoring (use agentforce/agent-actions) or for prompt-template variable binding (use agentforce/prompt-builder-templates).

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Apex test patterns for @InvocableMethod agent actions: per-reason-code branch coverage, bulk safety, callout mocking, deterministic assertions. NOT for testing whether the agent routes to the right topic or answers well — use agentforce/agent-testing-and-evaluation. NOT for designing the error envelope the tests assert on — use agentforce/agent-action-error-handling.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Designing or reviewing Agentforce actions: Flow actions, Apex invocable actions, prompt-template actions, action naming, input and output contracts, confirmation requirements, and safe error behavior. Triggers: 'agent actions', 'build an agent that can look up an order', 'make the agent able to check order status', 'give the agent a capability', 'agent that can retrieve a record', 'flow action for agent', 'agent invocable action', 'action schema design'. NOT for writing the Apex class itself — use agentforce/custom-agent-actions-apex. NOT for the reason_code error envelope that stops an agent retry loop — use agentforce/agent-action-error-handling.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

PranavNagrecha のスキルをすべて見る

このスキルの問題を報告する