CRM AI Context
Everything here is about one problem: an agent can read your CRM but not the rules around it, so it guesses, and the guesses look like answers. Read top to bottom, or jump to the stage you're stuck on.
How to build a CRM AI context layer
Why CRM AI gives confidently wrong answers, and how to ground agents in what your fields mean, which rules apply, and what the agent may touch.
Concepts
What the thing is, where its edges are, the smallest version worth building, and the terms it uses.
- The minimum viable CRM context layer
Seven rules you can write today without research, as a copyable YAML file. The whole starting library for grounding CRM AI, and why it's supposed to look this small.
5 min · Salesforce · HubSpot - The CRM context layer rule schema
A canonical schema for CRM AI context entries: the governance envelope, field entries, rule entries, the thirteen rule categories, and a JSON Schema file you can validate against.
9 min · Salesforce · HubSpot - Context layer vs. RAG vs. semantic layer
Three things that get substituted for each other and answer different questions. Why embedding your field descriptions doesn't work, and where a semantic layer genuinely overlaps.
4 min · Salesforce · HubSpot - CRM AI context layer glossary
Every term used across this site, defined once: context layer, rule categories, phased retrieval, hard and soft controls, resolution states, and the failure modes each one prevents.
6 min · Salesforce · HubSpot
- The minimum viable CRM context layer
Architecture and MCP
Where the protocol ends and your rules begin, and what wins when two rules disagree.
- MCP vs. CRM context layer: what each one does
MCP standardizes how an AI application connects to your CRM. A context layer defines what the data means and what the agent may touch. You need both, and one will not do the other's job.
6 min · Salesforce · HubSpot - Context precedence: what wins when rules disagree
Authority is a ladder that doesn't bend; specificity breaks ties among equals. Where a live user instruction sits, and what to do when two active rules genuinely contradict.
5 min · Salesforce · HubSpot
- MCP vs. CRM context layer: what each one does
Platform implementations
The same pattern, three ways. Start with whichever is closest to your stack.
- How to build a Salesforce context layer as a custom object
Store AI guidance rules in Salesforce as admin-maintained records, enforce object and field access in Apex, and load only the rules a question needs before the agent writes a line of SOQL.
20 min · Salesforce - How to build a HubSpot context layer for custom properties
The HubSpot implementation of a CRM AI context layer: teach agents which custom properties to trust, what their values mean, how associations behave in practice, and how to manage the rules with files, prompts, or Enterprise custom objects.
20 min · HubSpot - How to build a portable AI context layer outside your CRM
A working, CRM-independent context layer. The reusable knowledge and prompts live in git, an app runtime loads only the relevant rules, and a rep gets a grounded first-draft email.
11 min · Portable · Claude · Postgres
- How to build a Salesforce context layer as a custom object
Security and governance
Who the agent runs as, what a suppressed null hides, and who is allowed to change the rules.
- Permissions and safety for CRM AI agents
Object, field, and row scope; running as the asking user; why a permission-suppressed null looks exactly like a blank; who is allowed to edit the rules; and a five-level model for letting an agent act.
7 min · Salesforce · HubSpot
- Permissions and safety for CRM AI agents
Testing and shipping
How you know a change helped, and what has to be true before real users see it.
- Golden-question testing for CRM AI
A regression suite for your context layer: targeted and broad questions, an evaluation rubric that goes beyond pass/fail, and a 30-question starter set as executable YAML.
6 min · Salesforce · HubSpot - CRM AI production-readiness checklist
What has to be true before a CRM AI agent answers for real users: enforcement in code, always-load rules, phased retrieval, disclosure, and attributable logging. Every item is done or not done.
3 min · Salesforce · HubSpot
- Golden-question testing for CRM AI
Architecture in motion
One question all the way through, with the real artifacts at every step, then the same architecture failing on purpose.
- One CRM question, traced end to end
What actually happens between a question and an answer: phase-1 payload, rule index, selection, query plan, tool-boundary validation, and the audit log. Plus the same question failing on purpose.
8 min · Salesforce
- One CRM question, traced end to end
Failure modes
The wrong answers that look right, and the rule that prevents each one.
- Debugging wrong CRM AI answers
Your CRM AI gave a confident wrong answer. A symptom-to-cause index for the twenty failures that actually happen, what each one means, and the rule that prevents it recurring.
7 min · Salesforce · HubSpot - CRM AI context layer anti-patterns
Eleven ways this gets built wrong, starting with dumping your CRM schema into the prompt. What each one looks like, why it fails, and what to do instead.
6 min · Salesforce · HubSpot - AI-generated CRM fields are not a source of truth
A generated summary field is more dangerous than a stale one, because it's fresh, fluent, and it asserts things. The two failure modes, compounding fabrication, vocabulary decay, and the controls that contain them.
6 min · Salesforce · HubSpot · n8n
- Debugging wrong CRM AI answers
Running it
Where you are on the ladder, keeping rules honest, and the metrics worth watching.
- Operating a CRM context layer
The part after it works: a maturity model, the rule lifecycle, expiry and review SLAs, what to do when the CRM schema changes underneath you, and the metrics worth watching.
6 min · Salesforce · HubSpot
- Operating a CRM context layer
Files
Copyable artifacts rather than prose. Fetch them, or hand the URLs to a coding agent.
- context-layer-entry.schema.jsonJSON Schema (draft 2020-12) for a context entry
- minimum-viable-context-layer.yamlSeven starter rules that validate against it
- golden-questions.yamlThirty regression questions with pass criteria