The Context Layer: How to Feed Your CRM Data It Can Actually Use

A context layer gathers account and person data, resolves who is who, and writes a few clean, scored, explainable fields back to the CRM. Here are the architecture, data model, write-back rules and a 30-day plan.

Pixel-art magnifying glass over a page beside turning gears, a context layer that researches accounts before data reaches the CRM.

A context layer is the system that sits between your data sources and your CRM. It gathers account and person context from first-party data, product usage, the web, enrichment vendors and AI research. It resolves who is who. Then it writes a few clean, scored, explainable fields and one readable note back into the CRM and sales tools.

Most CRMs are full of data and short on context. You have 140 company properties, three enrichment tools and a research agent. Yet a rep still opens six tabs before a call. The data is there. It just isn't joined, dated, ranked or explained.

The fix isn't another integration that dumps fields into HubSpot. It's a layer that does the thinking before the CRM sees anything. This guide covers what a context layer is, the architecture, the data model, the write-back rules, freshness, governance, how agents use it, build vs buy, and a 30-day plan.

Key takeaways

  • The CRM is the output, not the brain. Gather, resolve and score outside the CRM, then write back only what reps and workflows act on.
  • Every fact carries a source and a date. A fact with no source can't be trusted, and a fact with no date can't expire.
  • Write few fields, write them well. About eight properties and one note beat 60 raw vendor fields.
  • Humans win ties. The layer fills blanks and updates its own fields, and it never overwrites a value a person typed.
  • Agents read context, rules write it. Let AI draft and suggest, and let a tested rule set decide what reaches the CRM.

What is a context layer for a CRM?

A context layer is a small data system with one job. It turns scattered facts about accounts and people into a short, trusted brief that the CRM can act on.

Your CRM is the system of record for actions. It knows owners, stages, deals and activities. It is not built to hold every web page you scraped, every product event, every vendor's guess at headcount and every AI summary. When you push all of that straight in, you get field sprawl, conflicting values and reps who trust none of it.

The context layer takes that load. It does five things in order:

  1. Collect. Pull facts from first-party data, product usage, the web, enrichment and AI research.
  2. Resolve. Match every fact to the right company and person. This is identity resolution.
  3. Reason. Turn raw facts into a few judgments: fit, timing and the reason to reach out now.
  4. Score. Rank accounts and people with points you can explain line by line.
  5. Write back. Push a small set of fields and one note into the CRM, under strict rules.

I call it a layer on purpose. It isn't one tool. It's a contract about what goes in, how it's joined and what comes out. You can build it in a database and an automation tool. You can buy parts of it. What you can't skip is the contract.

How is it different from a CDP, a warehouse or an enrichment tool?

People mix these up, so here's the split.

System Built for Unit What it writes to the CRM
Enrichment tool Filling firmographic and contact fields One record at a time Raw vendor fields, often many
Customer data platform Unifying behavior and sending audiences to marketing tools Mostly people Audiences and traits
Data warehouse Storing and modeling all company data Tables Nothing by itself; needs reverse ETL
Context layer Giving sales and agents a ranked, explained view of each account Accounts first, then people A few scored fields and one note

A context layer can use all three. Enrichment is one of its sources. A warehouse can be its store. A CDP can feed it product events. The difference is the output. A context layer ends in a decision a rep can read in ten seconds.

Why can't the CRM be the context layer?

You can try. Most teams do, and they hit the same four walls.

First, there's no home for sources and dates. A HubSpot property holds a value. It doesn't hold "this came from the careers page on November 3, with medium confidence." Property history helps a little, but you can't filter on it or expire it.

Second, conflicts have no referee. Two enrichment tools disagree on headcount. A rep typed a third number. Whichever integration ran last wins. That's not a rule. That's a race.

Third, the CRM is a poor place to reason. HubSpot's custom code actions must finish within 20 seconds and use up to 128 MB of memory. They need Data Hub Professional or Enterprise. That's fine for a lookup. It's tight for an AI research step that reads five pages.

Fourth, API limits shape the design. Per HubSpot's usage guidelines, a private app on Professional gets 190 requests per 10 seconds and 625,000 a day per account. Free and Starter get 100 per 10 seconds and 250,000 a day. Enterprise gets 1,000,000 a day. The daily limit is shared across all apps in the account. Every chatty integration eats from the same pool.

So keep the CRM for what it's great at: owners, stages, tasks and the fields people act on. Do the gathering and thinking next door.

What does the context layer architecture look like?

Here's the shape I build. Five stages, one store, one write-back gate.

 SOURCES                    CONTEXT STORE                       OUTPUTS
 ---------                  -------------                       -------
 CRM (read)          --->   accounts, people                    HubSpot fields (8 or so)
 Forms, web visits   --->   identities (domain, email, IDs)     HubSpot note per account
 Product events      --->   facts (claim, source, date, TTL) -> Slack alert on big change
 Enrichment APIs     --->   signals (type, weight, date)        MCP resources for agents
 Web + AI research   --->   scores (fit, signal, reasons)       Sequencer custom fields
                            writeback_log (what, when, why)
                                    |
                            WRITE-BACK GATE: rules, diff, batch, log

Each stage has its own failure mode, so let's take them one at a time.

What sources feed a context layer?

I group sources by how much I trust them and how fast they go stale.

Source Examples Trust Typical freshness need
CRM history Owner, stage, past deals, last activity High Real time
First-party intent Form fills, pricing page visits, demo requests High Minutes
Product usage signals Signups, seats added, feature use, usage caps hit High Hourly to daily
Enrichment vendors Industry, headcount, tech stack, titles Medium Quarterly, or on event
Web and news Careers page, press releases, funding news Medium Weekly
AI research Summaries of the site, priorities, likely use case Low to medium Monthly, or on event

Your own data comes first. A pricing page visit from a known account beats any vendor's intent topic. Vendor and AI data fill the gaps.

For data enrichment, don't bet on one vendor. Run a waterfall: try the best source, then the next, and stop when you have a verified answer. The enrichment waterfall playbook walks through it. If you're on HubSpot, its native data enrichment is a fair first step. Per HubSpot, it doesn't use HubSpot Credits, keeps existing data unless you choose to overwrite, and ships with automatic enrichment turned off.

How does identity resolution work?

Every fact must land on the right company and the right person. Get this wrong and the smartest scoring in the world points at the wrong account.

My matching order, strongest first:

  1. CRM record ID. If the source already knows the HubSpot ID, use it.
  2. Root domain for companies. Lowercase it, strip "www." and paths, and map known aliases.
  3. Work email for people. Then derive the company from the email domain.
  4. Vendor IDs. Store each vendor's company and person IDs as aliases on your own record.
  5. Name plus country. Last resort, and only into a review queue.

Personal email domains need a rule. A gmail.com signup can't be matched by domain. Match it on other evidence or leave it unlinked. The lead-to-account matching guide covers the edge cases.

One HubSpot detail bites here. Per HubSpot's deduplication docs, companies created through the API are not deduplicated by company domain. So your context layer must search for the domain before it creates a company. If it doesn't, every run can make a duplicate.

Where does the reasoning happen?

Reasoning turns 40 facts into three judgments. Is this account a fit? Is something happening now? What should the rep say?

Use code for what code can do. Headcount bands, industry matches and "visited pricing twice in seven days" are rules. Use an AI model only where judgment on messy text is needed: summarizing a site, reading a job post, naming the likely use case.

When you do use AI, force structured output. Ask for JSON with fixed keys, a source URL per claim and a confidence level. Free text can't be scored or checked. The guide to structured outputs for GTM has schemas you can copy, and the AI account research guide shows how to make an agent cite its sources.

What goes in the context layer data model?

Six tables carry almost every build I've seen work. The GTM data model guide goes deeper on objects. Here's the context layer slice.

Table One row per Key columns
accounts Company account_id, root_domain, crm_company_id, name, country
people Person person_id, email, account_id, crm_contact_id, title, seniority
identities Alias entity_id, id_type (domain, email, vendor ID), value, source
facts Claim about an entity entity_id, attribute, value, source, source_url, observed_at, expires_at, confidence
signals Event that suggests timing account_id, signal_type, weight, occurred_at, evidence_url
scores Score run account_id, fit_score, signal_score, tier, reasons, model_version, scored_at

Add a seventh, writeback_log, and you can answer "why does HubSpot say this?" for any field.

The facts table is the heart of it. Every claim is its own row with a source and an expiry. Here's one:

{
  "entity_id": "acct_8f21",
  "attribute": "employee_count",
  "value": 212,
  "source": "vendor_b",
  "source_url": null,
  "observed_at": "2026-11-18T09:12:00Z",
  "expires_at": "2027-02-16T09:12:00Z",
  "confidence": "medium"
}

When two facts disagree, a resolver picks the winner. My default rule is simple. Higher trust beats lower trust. Within the same trust level, newer beats older. A person's entry beats any machine. The winner becomes the golden record value, and only that value can be written back.

Keep raw vendor payloads too, in a cheap side table. When a vendor changes its schema, you'll want to replay old responses.

Which fields should a context layer write back to the CRM?

Here's my rule: fields for filtering, notes for reading. A rep filters on a tier. A rep reads a paragraph. Don't make a property out of something nobody will ever filter on.

This is the field set I start with on the company object in HubSpot. Prefix them so everyone knows the layer owns them.

Property (internal name) Type Example value Used for
ctx_fit_tier Dropdown: A, B, C, D A Routing, views, account lists
ctx_fit_score Number, 0 to 100 82 Sorting within a tier
ctx_signal_score Number, 0 to 100 64 Timing, sequence triggers
ctx_why_now Single-line text Hiring 3 SDRs; pricing page visited twice The opener for the rep
ctx_last_signal_type Dropdown hiring, funding, product, web_visit Reports and workflow branches
ctx_last_signal_at Date 2026-11-28 Recency filters
ctx_confidence Dropdown: high, medium, low medium Telling reps how hard to lean on it
ctx_updated_at Date and time 2026-12-01T06:00:00Z Freshness checks

On contacts, I add just three: ctx_persona, ctx_seniority and ctx_role_in_deal (champion, economic buyer, user, unknown).

Then one note per account, rewritten when the context changes. HubSpot's notes API caps the note body at 65,536 characters and requires a timestamp. You'll never need that much. Aim for 120 words: who they are, why now, who to call, what to say, and the sources.

Run your names through the CRM field naming checker before you create them. Renaming a property after three workflows use it is a bad afternoon.

What are the write-back rules?

The write-back gate is where most context layers fail. They gather well, score well, then trample the CRM. These seven rules keep it safe.

  1. Never overwrite a human. If a person set a value, the layer doesn't touch it. Track this with a source property or the property history.
  2. Own your fields. The layer can always update its ctx_ fields. On shared fields like industry, it fills blanks only.
  3. Write on change only. Compare the new value to the current CRM value. If they match, skip the call. This saves API budget and keeps history clean.
  4. Make every write repeatable. Running the same job twice must give the same result. That's idempotency, and the idempotency guide shows the patterns.
  5. Batch it. HubSpot's object APIs take up to 100 inputs per batch request. Upsert by a unique ID so create and update happen in one call.
  6. Log every write. Save what changed, the old value, the new value, the rule that allowed it and the run ID.
  7. Stop on surprises. If a run wants to change more than 5% of records in one field, pause and alert. Something upstream probably broke.

What does a write-back payload look like?

Here's a batch upsert for companies, keyed on a custom unique property. HubSpot notes that partial upserts don't work when contacts use email as the ID property, so a custom unique ID is the safer key.

POST /crm/objects/2026-09/0-2/batch/upsert   (0-2 is the company object)

{
  "inputs": [
    {
      "idProperty": "ctx_account_id",
      "id": "acct_8f21",
      "properties": {
        "ctx_fit_tier": "A",
        "ctx_fit_score": "82",
        "ctx_signal_score": "64",
        "ctx_why_now": "Hiring 3 SDRs; pricing page visited twice this week",
        "ctx_last_signal_type": "hiring",
        "ctx_last_signal_at": "2026-11-28",
        "ctx_confidence": "medium",
        "ctx_updated_at": "2026-12-01T06:00:00Z"
      }
    }
  ]
}

Notice what's missing. No industry, no headcount, no 40 vendor fields. Those live in the context store. If a workflow truly needs headcount, write the band, not the raw number.

Which conflicts need a person?

Some changes are too risky to automate. Send these to a review queue instead of the CRM:

  • A tier jump of two or more levels, like D to B.
  • A domain or parent company change.
  • Any change to a customer account's fields.
  • A merge suggestion.

That's human in the loop where it matters, and automation everywhere else. The data contracts guide shows how to write these rules down so engineering and sales agree on them.

How fresh does context need to be?

Not everything needs to be real time. Paying for real time everywhere wastes money and API calls. Set a freshness target per fact type, based on how fast it changes and how much it matters.

Fact type Refresh trigger Default expiry
Demo request, pricing visit Event, within minutes 14 days as a signal
Product usage milestone Event or hourly batch 30 days as a signal
Hiring and job posts Weekly scan 45 days
Funding round Weekly scan, or news alert 90 days as a signal
Firmographics Quarterly, or on a bounce or form fill 90 to 180 days
AI research summary Monthly, or when a new signal lands 30 days

Expiry matters as much as refresh. A hiring signal from June shouldn't still say "why now" in December. That's signal decay, and your scoring must account for it. The signal scoring model guide shows how to weight by age.

For events, use a webhook instead of polling. HubSpot's webhooks guide lists a few rules you must design for. Your endpoint must respond within five seconds. Failed sends are retried up to 10 times over 24 hours. Order isn't guaranteed, and the same event can arrive twice. So accept fast, queue the work, sort by the occurredAt time and dedupe. The webhooks for GTM playbook has the receiver pattern.

Track data freshness as a number. I watch one metric: the share of tier A accounts with ctx_updated_at in the last seven days. If it drops below 95%, a job is broken.

How do you keep a context layer governed?

A context layer touches every account. That makes it powerful and risky. Four habits keep it trustworthy.

Name an owner per field. The GTM engineer owns the ctx_ fields and the rules. Sales leadership owns what the tiers mean. Marketing owns intent and source fields. This is plain data governance, and it settles fights before they start.

Lock the fields down. On HubSpot Enterprise, you can restrict who can view or edit a property. Make ctx_ fields view-only for reps. Know the limit, though. HubSpot says all users can still set restricted properties through the API, so this isn't a security control. It stops accidental edits in the UI. It doesn't stop a rogue integration.

Explain every score. Store the reasons with the score, like "+20 VP Sales hire, +15 pricing visit, -10 under 50 staff." If a rep asks "why is this an A?", the answer should take one click. An unexplained score gets ignored within a month.

Keep personal data tight. Store what you need to sell, and no more. Don't let an AI step pull personal social posts or home details into a CRM note. Write that rule into the research prompt and the review checklist.

Then run the monthly cleanup from the CRM data hygiene guide. A context layer writing into a dirty CRM just spreads the dirt faster.

How do AI agents use a context layer?

This is where the layer pays for itself twice. Without it, every agent does its own research. Each one searches the CRM, scrapes the site and guesses. You pay for the same work many times, and you get different answers each time.

With a context layer, agents read one trusted brief. The Model Context Protocol is the clean way to expose it. MCP's server concepts page defines three building blocks. Tools are functions the model calls. Resources are read-only data the app provides as context. Prompts are templates the user starts.

That maps neatly onto a context layer:

MCP building block What the context layer exposes Example
Resource The account brief, read-only context://account/acct_8f21
Resource The people on the account, with roles context://account/acct_8f21/people
Tool Search accounts by tier and signal find_accounts(tier: "A", signal: "hiring")
Tool Propose a change, not make it propose_update(account_id, field, value, evidence_url)
Prompt A call prep template prep_call(account_id)

Notice the tool list has no "write to HubSpot." Agents propose. The write-back gate decides. That one design choice prevents most agent accidents.

HubSpot also runs a remote MCP server at mcp.hubspot.com. It uses OAuth, acts as the signed-in user, and can read, write and update records. It's handy for a rep asking questions in their AI assistant. For automated jobs, I still route writes through the context layer's gate, so every change gets the same rules and the same log. The MCP server for CRM guide covers setup and scopes, and the AI agents and MCP use case shows where this fits in a wider build.

This is also context engineering at the system level. The best prompt in the world can't fix a model that was handed stale, conflicting facts.

Worked example: the research hours a context layer saves

Let's put numbers on it. These are assumed numbers for an example team, so swap in your own.

Bar chart of monthly rep research hours: manual research 78, enrichment only 45.5, context layer 19.5.Bar chart of monthly rep research hours: manual research 78, enrichment only 45.5, context layer 19.5.
Worked example with assumed numbers: 6 reps, 15 new accounts each a week, minutes per account falling from 12 to 3. Worked example from this guide.

Say you have 6 reps. Each works 15 new accounts a week. Without a context layer, a rep spends 12 minutes per account opening tabs, checking LinkedIn, reading the site and finding a reason to reach out.

That's 6 × 15 × 12 = 1,080 minutes a week, or 18 hours. Over a month of about 4.33 weeks, it's 78 hours.

Now add an enrichment tool, but no context layer. Firmographics show up in the CRM. Reps still dig for the why-now and the right person. Say that drops research to 7 minutes per account. That's 10.5 hours a week, or about 45.5 hours a month.

Now add the context layer. The tier, the why-now line, the people and the sources are already on the record. The rep spends 3 minutes reading and checking. That's 4.5 hours a week, or about 19.5 hours a month.

The bigger win is harder to model. Reps reach out at the right moment with the right reason. In my experience that moves reply rates more than any copy tweak. I won't put a number on it, because yours depends on your market.

Should you build or buy a context layer?

You'll likely do both. The question is which parts.

Option What it looks like Good for Watch out for
CRM-native HubSpot enrichment, scoring and workflows, no outside store Small teams, one segment, mostly inbound No source or date per fact, limited reasoning
Buy a platform A vendor that gathers signals and writes to the CRM Teams that want speed and have budget Their fields, their rules, their black box
Build light Postgres or a small warehouse, an automation tool like n8n, an AI model and your rules Teams with a GTM engineer Maintenance, and someone has to own it
Build on a warehouse Warehouse models, reverse ETL to the CRM Teams with lots of product data Cost and setup time before the first win

My decision rule has three questions.

  1. Do you need a source and date on every fact? If yes, you need your own store. CRM-native won't do it.
  2. Is product usage a top signal? If yes, plan for a warehouse. The data warehouse guide for startups helps you decide when, and reverse ETL for marketing covers the sync back out.
  3. Who owns it next year? If nobody can, buy. A layer nobody maintains rots faster than no layer at all.

The build vs buy guide for GTM tools has a five-factor score if you want to be more formal.

What are the common context layer mistakes?

I see the same five over and over.

Dumping every vendor field into the CRM. Sixty new properties feel like progress. They're clutter. Reps can't tell which ones matter, so they ignore them all.

No identity step. Facts get matched by company name. "Acme" lands on three different companies. Now your best signal points to the wrong account.

Scores with no reasons. A number with no explanation gets questioned once and ignored forever. Store the reasons and show them.

No expiry. Old signals keep accounts at tier A for months. Reps call, find nothing happening and stop trusting the tier.

Agents with write access. An agent with direct CRM write access will one day overwrite something important. Make agents propose, and let rules decide.

How do you build a context layer in 30 days?

Start small. One segment, a few hundred accounts and one team. Prove it, then widen it.

Week 1: write the contract

  • Pick the segment and the 8 or so fields from the table above.
  • Write the rules: who owns each field, which sources win, what never gets overwritten.
  • List your sources and how often each one refreshes.
  • Create the ctx_ properties in HubSpot and a unique ctx_account_id.

Week 2: resolve identity

  • Load accounts and people from the CRM into the store.
  • Build the matching order: CRM ID, then domain, then email, then vendor IDs.
  • Pull in two or three sources, like form fills, product signups and one enrichment vendor.
  • Check 50 matches by hand. Fix the rules until fewer than 1 in 50 is wrong.

Week 3: score and explain

  • Build the fit score in plain rules first.
  • Add signals with weights and an expiry for each type.
  • Add one AI research step with structured output and a source per claim.
  • Draft the 120-word account note template.

Week 4: write back and review

  • Turn on the write-back gate in a test portal or on 50 accounts.
  • Add the alert for big changes and the freshness metric.
  • Sit with two reps for an hour. Watch them use the fields. Cut anything they skip.
  • Then turn it on for the full segment.

If you'd rather not build alone, this is the kind of work my GTM engineering service does. The data enrichment use case shows the enrichment side in more detail.

My take: build the layer before the next agent

Most teams are adding AI agents to a CRM that can't answer basic questions about its own accounts. Each new agent adds cost and a fresh set of guesses.

Flip the order. Build the context layer first. Give it a contract, a resolver, a score with reasons and a strict write-back gate. Then every agent, sequence and rep reads from the same trusted brief.

The CRM gets fewer fields, not more. Reps get one line that tells them why to call today. And when someone asks "where did this come from?", you can answer in one click. That's the whole point.

FAQ

What is a context layer in GTM?

A context layer is the system between your data sources and your CRM. It gathers account and person data from first-party sources, product usage, the web, enrichment vendors and AI research. It works out which records belong to which company and person. Then it writes a short set of clean, scored fields and a readable note back into the CRM, where reps and automations use them.

Is a context layer the same as a customer data platform?

No. A customer data platform is built to unify behavioral events and send audiences to marketing tools, mostly for people. A context layer is built for selling. It works at the account level first, adds outside research and enrichment, keeps a source and date on every fact, and writes scores and reasons into the CRM for reps and routing.

Do I need a data warehouse to build a context layer?

Not at first. A small team can run a context layer on a Postgres database, an automation tool and an AI model. A warehouse starts to pay off when you join large product usage tables, keep long history or feed many tools from one model. Start with the smallest store that keeps a source and a date on every fact.

Which fields should a context layer write back to HubSpot?

Write a small set: a fit tier, a fit score, a signal score, a why-now line, the last signal type and date, a confidence level and an updated-at date. Put the long research in a note on the company record. Keep raw signals and history in the context store, not in CRM properties.

How do AI agents use a context layer?

Agents read from it instead of searching raw CRM records and the web on every task. The context layer hands them clean facts with sources and dates. Agents can draft research, suggest scores or propose field changes, but the write-back rules decide what reaches the CRM, and a person approves anything risky.

How long does it take to build a context layer?

A first version takes about 30 days for one team. Week one is the field contract and sources. Week two is identity resolution. Week three is scoring and the research note. Week four is write-back, alerts and a rep review. Start with one segment and a few hundred accounts before you scale.

More like this

Glossary: Knowledge Base

Startup? Let's talk.

20 minute fit call. You'll leave knowing the first thing we'd fix and roughly what it costs. If we're not the right fit, we'll tell you who is.