CRM AI Context Layer
Chapters
  1. 01 · The Context Problem
  2. 02 · Give the Data Business Meaning
  3. 03 · Decide What the AI Should Trust
  4. 04 · Build the Context Layer
  5. 05 · Connect It to Live Data
  6. 06 · Control What AI Can See and Do
  7. 07 · Test the System
  8. 08 · Operate It
  9. 09 · Expand Beyond the First Workflow
  10. 10 · Capstone: Trace a Reliable Answer
Guide overview →

14 min · Interactive exercise

Chapter 4 of 100 complete

Build the Context Layer

Turn the rules into a small, structured implementation.

View your context layer

You now have field meaning and one authority rule. The next step is turning those decisions into data the system can validate, retrieve, version, and test.

Start smaller than feels comfortable

A useful first library has fewer than ten rules. The existing starter file uses seven: fiscal calendar, currency handling, reporting exclusions, attribution, deprecation, an allowlist, and known query anti-patterns. Each prevents a failure you already understand.

Do not document every field. Import existing help text as a baseline, then add context where a missing definition changes an answer.

Give every entry a governance envelope

A rule needs an ID, title, category, scope, status, owner, source, version, and review date. Field entries add authority, provenance, freshness, value maps, and dependencies. Store the rule body as data rather than burying it in one system prompt.

id: field.renewal_risk_score
title: Use renewal risk score for renewal health
category: field-interpretation
scope: Account.renewal_risk_score
authority: authoritative
owner: revenue-operations
status: active

Titles are retrieval keys

“Opportunity exclusions” is a folder name. “Exclude test and CPQ-generated opportunities from pipeline totals” tells the planner exactly when to fetch the rule. Write titles as conditions, not labels.

Always load what the agent cannot notice is missing

Exclusions, access boundaries, temporal rules, currency rules, and known anti-patterns belong in the stable prefix. Optional interpretation can be selected from an index. A skipped definition may cause a hedge. A skipped exclusion creates a confident wrong total.

Build the smallest safe payload in the GTM Lab. Presentation preferences do not belong in it.

Reference

GTM Lab

Saved locally

Your field meaning and authority decisions now become structured, reusable rules.

Opportunity report

Qualified pipeline

RPT-2081
Requested period
Last quarter
Calendar-quarter total
$4.8M
Fiscal-quarter total
$3.1M
Currencies present
USD, EUR, GBP
Test records
38
Legacy amount field
Available
Sample CRM data. No live CRM is connected.

Assemble the starter layer

Choose the rules that must load before the agent answers a pipeline question.

What happened

Marcus, CRO asked:

How much qualified pipeline did we create last quarter?

Agent response

$4.8M in qualified pipeline from April 1 through June 30.

Raw plan: count every opportunity created in the calendar quarter, sum Amount as one currency, and query any field that sounds relevant.

How to complete this chapter

  1. Select every rule the agent cannot safely infer.
  2. Leave optional presentation preferences out.
  3. Build the payload.
Build your decision
Chapter 4 of 100 complete