SfSkills Domains Docs GitHub

Home / architect / ai-ready-data-architecture

ai-ready-data-architecture

Use when designing or auditing a Salesforce data architecture to support AI features — Einstein, Agentforce, Data Cloud, or custom ML models.

Open the skill folder on GitHub


Use this skill when designing or auditing a Salesforce data architecture to ensure it can reliably support AI features — including Einstein predictive scoring, Agentforce generative actions, Data Cloud-powered insights, and custom ML integrations. This is not a skill about enabling individual Einstein features; it is about making the underlying data model, field design, and data quality posture capable of feeding AI reliably. The difference between an org where Einstein Opportunity Scoring works and one where it produces junk predictions is almost always data architecture, not configuration.


Questions to Ask Before Configuring

Ask these before auditing a single field. Each traces to a gotcha in references/gotchas.md.

QuestionWhy it mattersWhat a good answer addsWhat a proper design adds over just doing it
"Which AI features are in scope, and which licences come with them (Sales Cloud Einstein, Data Cloud, CRM Plus for AI Accelerator)?"Model-factor visibility and use-case metadata need specific licences and permissions (Gotchas 1 and 11)A feature-to-licence mapNo design that depends on metadata or objects the org cannot use
"How fresh must grounded content be, and which articles carry prices, limits, or legal terms?"Knowledge used with Agentforce is reindexed daily (Gotcha 6)A list of policy-critical content and its freshness needDeterministic values come from live actions, not day-old chunks
"Which Knowledge fields hold the content agents should cite, and are any encrypted or URL fields?"Encrypted and URL fields are not used for grounding; files have size limits (Gotcha 7)Identifying and content fields per record typeGrounding reads the fields that actually hold answers
"Will grounding use Knowledge, uploaded files, or both, and what can the agent user see?"A data library takes one source type; retrieval respects the agent's access (Gotcha 8)A library-per-source plan and agent-user access reviewAgents cite what they are allowed to cite, from the right library
"What category is each Data Cloud stream, and what is its identity key?"Categories cannot change after ingestion; mismatched keys split profiles (Gotchas 5 and 9)A stream register with category and identity attributesRe-ingestion is avoided and unified profiles are complete
"Will any flow or trigger branch on a score?"Prediction outputs arrive asynchronously (Gotcha 4)A list of score consumers and their timingNo routing decision races the scoring job

What a proper design adds over "just enabling the AI feature": the data the feature reads is complete, fresh enough, in supported field types, and visible to the user the AI runs as, and every licence the design assumes is confirmed.


Why AI-Readiness Is an Architecture Problem

AI features consume data. The quality of their output is directly bounded by the quality of their input. Salesforce AI features fail silently when:

This skill addresses all five failure modes before they reach production.


Key Design Areas

1. Data Completeness for ML

Einstein predictive models require sufficient field fill rates to produce meaningful predictions. The minimum threshold for a field to influence a model is approximately 70% fill rate across training records. Fields below 40% fill rate are typically ignored by the model during feature selection, which means sparse data silently degrades prediction quality. UNVERIFIED (2026-10-03): the 70% and 40% figures are working heuristics, not documented model behavior. For Opportunity Scoring, the factors the model actually used can be read from SalesAIScoreModelFactor (Object Reference; needs the View Scoring Model Factors permission).

Assessment approach: For each object targeted by an Einstein feature, calculate fill rates for all candidate predictor fields. Use a SOQL aggregate query or CRM Analytics recipe. Flag fields below 70% for remediation before enabling scoring.

Null handling strategies:

2. Structured vs Unstructured Data Placement

Not all data belongs in Salesforce standard objects. AI features have different optimal data sources:

Data typeOptimal locationReason
Structured CRM records (Accounts, Opportunities, Cases)Salesforce standard/custom objectsNative Einstein feature extraction; Data Cloud harmonization
High-volume interaction data (emails, web events, clicks)Data CloudVolume tolerance, calculated insights, identity resolution
Long-form knowledge content (articles, runbooks, policies)Salesforce Knowledge or external CMSRAG retrieval via Data Cloud knowledge base
Binary files, images, audioExternal store (S3, Azure Blob) with URL reference in SalesforceSalesforce storage limits; Data Cloud can reference files in external blob stores through an unstructured data lake object (UDLO, Data Cloud guide glossary)
Real-time sensor or IoT dataMuleSoft or streaming pipeline to Data CloudEvent volume exceeds platform API limits

3. Embedding-Ready Text Field Design

Text fields that will be embedded for vector search require deliberate design. Key rules:

4. Knowledge Article Structure for RAG

Agentforce grounds responses through an Einstein Data Library: the Knowledge articles or uploaded files are indexed in Data Cloud, and a search index and retriever are created automatically (Generative AI guide, "Setting Up Data Libraries"). A library uses either Knowledge or file uploads, not both; you choose identifying fields and content fields, can restrict to public articles, and can filter by data category. Supported knowledge field types are Text, Text Area, Text Area (Long), and Text Area (Rich); encrypted text and URL fields are not used. The quality of retrieval is still determined by how articles are structured.

Chunking-friendly article structure:

5. Data Freshness Requirements

AI models decay. The sync cadence for AI-relevant data should be designed based on the velocity of the underlying business data:

AI featureRecommended sync cadenceStaleness tolerance
Einstein Opportunity ScoringDaily batch24 hours
Einstein Case ClassificationNear-real-time (CDC-triggered)1 hour
Agentforce RAG groundingDaily reindex of Knowledge (Generative AI guide); corrected 2026-10-03 from "near-real-time, 4 hours"24 hours; use live actions for policy values
Data Cloud calculated insightsHourly for high-velocity streams1 hour
Custom ML model retrainingWeekly or on significant data driftOrg-specific

6. Einstein Feature Store

UNVERIFIED (2026-10-03): "Einstein Feature Store" as a product name, and score fields such as EinsteinScoreReason1__c, appear in no fetched guide. What the guides document: Einstein predictions are stored as AIRecordInsight records with child AIInsightReason, AIInsightValue, AIInsightAction, and AIInsightFeedback records, naming the prediction field written (Object Reference); Opportunity Scoring model factors are in SalesAIScoreModelFactor; and custom feature extraction for AI Accelerator use cases is the AIFeatureExtractor part of AIUsecaseDefinition, which needs the CRM Plus licence and the product's CRM licence and reads batch features from CRM Analytics or Data Cloud (Metadata API Developer Guide). Key design decisions:

7. Data Cloud as AI Data Layer

Data Cloud provides the harmonized data layer that connects disparate Salesforce and external data sources for AI consumption:

8. AI-Ready Field Naming

Consistent field naming enables automated field mapping in Data Cloud and reduces manual mapping effort on every ingestion run:

9. Data Quality Gates Before AI Activation

Before activating any Einstein or Agentforce feature, verify:

  1. Completeness: Fill rate ≥ 70% on all planned predictor fields.
  2. Consistency: Picklist values are clean (no duplicates from legacy migration, no "Other" comprising >20% of values).
  3. Timeliness: Sync jobs are confirmed running and within target cadence.
  4. Volume: Sufficient historical records exist for model training (Einstein requires at least 1,000 closed records for Opportunity Scoring; Case Classification requires 1,000 closed cases with populated target fields; UNVERIFIED 2026-10-03, Help-only figures).
  5. No circular dependencies: AI scoring fields are not used as inputs to the same model that produces them.

  1. Identify AI features and their data dependencies. For each Einstein, Agentforce, or custom ML feature in scope, list the source objects, predictor fields, and target fields. Build a dependency map: Feature → Object → Fields → Fill Rate.
  2. Run a data completeness audit. For each object and field in scope, calculate fill rates using SOQL aggregate queries or a CRM Analytics recipe. Flag fields below 70%. This is the single highest-value diagnostic step.
  3. Classify data placement. For each data category (structured CRM records, high-volume events, knowledge content, binary files), apply the placement decision matrix to determine whether data belongs in Salesforce objects, Data Cloud, or an external store.
  4. Remediate field design. Address identified gaps: enforce defaults via Flow or validation rules, curate picklist values, strip HTML from text fields destined for embedding, split monolithic text fields where semantic mixing is detected.
  5. Design knowledge article structure. If Agentforce RAG grounding is in scope, audit existing Knowledge articles against the chunking-friendly structure guidelines. Create or update the Knowledge article template. Apply metadata tagging taxonomy.
  6. Define and validate sync cadence. For each AI feature, specify the required data freshness SLA and confirm the sync mechanism (CDC, scheduled batch, MuleSoft, Data Cloud connector) can meet it; for Knowledge grounding the documented cadence is a daily reindex. Test with a representative data volume before go-live, then run python3 skills/architect/ai-ready-data-architecture/scripts/check_ai_ready_data_architecture.py <completed-assessment.md> to confirm required sections, the quality gate checklist, and declared AI features are present.
  7. Run data quality gate checklist. Complete the pre-activation checklist (completeness, consistency, timeliness, volume, no circular dependencies). Document results. Obtain sign-off before enabling AI features in production.

Package files