Chapter 13
The Context Layer: Building the Company Brain
Last updated
In this chapter
- What the context layer (or "company brain") is, and why agents fail without one
- What goes in it: from ICP and positioning to call insights and decisions
- How it relates to the data model, the warehouse, and the CRM
- Structure: structured facts versus documents, schemas, provenance, and freshness
- Ingestion and curation from call recorders, docs, Slack, and the CRM
- Retrieval: RAG, embeddings, hybrid search, long context, and access over MCP
- Governance: ownership, permissions, PII, prompt injection, and staleness
- Build versus buy, a step-by-step playbook, a worked example, and evaluation
13.1What the context layer is, and why it matters
Chapter 12 showed that an AI step is only as good as the inputs it is grounded in. A model knows a great deal about the world in general and nothing about your company in particular: not your ICP, not which claims legal approved last month, not the pricing rule that caps discounts at 15% without a VP's sign-off, not what a prospect's CFO objected to on Tuesday's call. When an agent drafts an email, writes a pre-call brief, or proposes a CRM update without that knowledge, it fills the gap with plausible generic text. That is the most common reason GTM agents produce output that is fluent and useless.
The context layer is the GTM engineer's answer: a governed, maintained body of company and customer knowledge, in forms that both people and agents can use, served to every AI step through one set of interfaces. Practitioners use several names for it.
- Context engineering is the discipline. Andrej Karpathy described it as the "delicate art and science of filling the context window with just the right information for the next step," and Shopify's CEO Tobi Lütke called it a "core skill" (The Decoder). Anthropic's applied AI team defines the goal as "finding the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome" (Anthropic). Gartner, an independent analyst firm, defines context engineering as "designing and structuring the relevant data, workflows and environment so AI systems can understand intent, make better decisions and deliver contextual, enterprise-aligned outcomes" and recommends that organizations appoint an owner for it (Gartner).
- Context layer is the infrastructure term. Vendors use it most. ZoomInfo, for example, defines a context layer as "the unified, governed, agent-accessible surface that exposes verified intelligence to any AI agent in your stack" and contrasts it with a semantic layer, which standardizes metric definitions for dashboards (ZoomInfo, vendor blog).
- Company brain (or "GTM brain") is the practitioner term for the same idea, usually describing the content rather than the plumbing. Vercel's COO Jeanne DeWitt Grosser described Vercel's "GTM brain" as "this incredible, massive Notion doc" of sub-documents covering every persona, value proposition, play, and discovery question, and summarized the lesson as "Garbage in is garbage out with an agent" (OpenGTM podcast). Clay's internal GTM engineering team uses Dust as "an agent layer on top of our company information" spanning Notion, Gong, Salesforce, and Slack (Clay).
This book uses context layer for the system and company brain for its contents. The distinction matters less than the practice: whatever you call it, the job is to decide what your agents should know, keep it correct, and get the right slice of it in front of the model at the right moment.
Why does it deserve a chapter of its own? Three reasons.
- Every agent needs the same knowledge. An outbound drafter, a pre-call brief generator, a reply classifier, and a renewal-risk agent all need your ICP, your positioning, and the account's history. Without a shared layer, each agent gets its own copy pasted into its prompt, and the copies drift apart.
- Company knowledge changes faster than prompts are updated. Positioning shifts, prices change, a competitor launches a feature, a case study is withdrawn. One vendor described play files that carried positioning "hand-typed into markdown" and drifted out of date "within three weeks of a repositioning, quietly, while every message they generated inherited the stale version" (Sentra, a company-brain vendor). A single maintained source fixes that once for every agent.
- More context is not better context. Models do not use long inputs uniformly. Researchers found that performance "is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts" (Liu et al.), and a vendor study of 18 LLMs found performance varying with input length even on simple tasks (Chroma, a vector database vendor). Anthropic calls this effect "context rot" (Anthropic). Selecting the right context is an engineering problem, not a matter of pasting in everything.
13.2What goes in it
A useful company brain holds the knowledge a strong new hire would need to do the job well, in a form an agent can find. The table below lists the usual contents, how each is best stored, who should own it, and how quickly it goes stale.
| Content | Examples | Best form | Typical owner | Goes stale |
|---|---|---|---|---|
| ICP and segments | Firmographic and behavioral criteria, tiers, exclusions | Structured facts plus a short narrative | GTM leadership, RevOps | Quarterly |
| Personas | Roles, responsibilities, pains, goals, qualifying questions | Structured records with prose fields | Product marketing | Quarterly |
| Positioning and messaging | Value propositions per persona and play, approved claims, forbidden claims | Documents plus an approved-claims list | Product marketing | On every repositioning |
| Product facts | Features, limits, integrations, roadmap status (what may be said publicly) | Structured facts | Product, product marketing | Every release |
| Pricing and packaging rules | List prices, discount bands, approval thresholds, what may be quoted | Structured rules | Finance, deal desk | On change; audit monthly |
| Competitive intelligence | Competitor strengths, weaknesses, landmines, win/loss themes | Documents with dated claims | Product marketing, sales enablement | Monthly |
| Proof | Case studies, quotable customers, metrics cleared for public use | Structured records (customer, metric, permission, expiry) | Customer marketing | On permission change |
| Call and meeting insights | Objections, competitors mentioned, commitments, next steps | Extracted structured facts linked to the call | Generated; reviewed by sellers | Per deal |
| Account history | Past opportunities, contacts, products owned, support issues, prior outreach | The CRM and warehouse (referenced, not copied) | RevOps, data | Continuously |
| Decisions and playbooks | Play specs, routing rules, "why we stopped doing X", escalation paths | Versioned documents | GTM engineering, RevOps | On each decision |
| Brand voice and style | Tone, banned phrases, formatting rules, sample approved emails | A short style guide plus examples | Marketing | Yearly |
Two practical points follow from the table. First, ownership is the column most often left blank, and it predicts which content will rot. Second, much of this already exists somewhere (a messaging doc, an enablement wiki, a pricing sheet). The work is rarely writing it from nothing; it is consolidating, structuring, de-duplicating, and assigning owners to what is scattered.
GTM-specific vendors now model these contents explicitly. Octave, for example, describes a "Library" that stores "your ICP definitions, buyer personas, competitive positioning, messaging, proof points, objections, motions, and reference customers" as structured entities for agents to query (Octave, vendor documentation). Whether you buy such a product or build your own, the list of contents is a useful checklist.
13.3How it relates to the data model, the warehouse, and the CRM
The context layer is not a new system of record. It sits beside the systems you already have and borrows from them.
- The GTM data model (Chapter 3) defines the entities (accounts, contacts, opportunities, activities) and the identity rules that resolve them. The context layer depends on it. Call insights, account history, and proof points are useless to an agent if they attach to the wrong account. Entity resolution comes first; a polished retrieval system over unresolved records returns the wrong account faster.
- The warehouse (Chapter 7) holds history, scores, product usage, and modeled metrics. The context layer should reference those models (for example, by exposing a tool that returns an account's fit score and usage summary) rather than copying their values into documents that then go stale. Where the warehouse offers built-in retrieval, such as Snowflake Cortex Search, the unstructured parts of the brain can live next to the structured data under the same access controls.
- The CRM (Chapter 11) remains the system of record for accounts, contacts, opportunities, and ownership. Agents read CRM state through governed tools and write back only through the same field-ownership rules that apply to every other integration. Insights extracted from calls should land in the CRM as reviewed fields or activities, not only in the context layer, so humans and reports see them too.
A simple rule keeps the boundaries clear: systems of record hold facts about customers and deals; the context layer holds knowledge about how your company sells, plus pointers and tools into the systems of record. One vendor put the same split for agent instructions in a memorable line: "A skill should know how. It should never be the only thing that knows what" (Sentra). Procedures belong in prompts and play specs; facts belong in a maintained source the procedure reads at run time.
13.4Structure: facts, documents, schemas, and provenance
Company knowledge comes in two shapes, and each needs different handling.
Structured facts are short, typed, and checkable: a price, a discount threshold, a feature's availability, a customer's permission to be named, a persona's qualifying questions. Store them as records with fields, the same way this book stores volatile numbers in a data file and renders them into the text. Structured facts can be validated, queried exactly, and updated in one place.
Documents are narrative: positioning briefs, competitive battlecards, playbooks, call transcripts, decision memos. They are retrieved by search, chunked into passages, and summarized. They are harder to keep correct, so keep them short, single-topic, and owned.
Wherever possible, turn the parts of documents that agents rely on into facts. "We integrate with Salesforce and HubSpot" belongs in a product-facts record, not buried in a battlecard where an agent might find the version from two releases ago.
Every item in the brain, fact or document, should carry metadata:
# One record in the context layer (illustrative schema)
id: claim.soc2_type2
type: approved_claim
text: "We hold a SOC 2 Type II report, available under NDA."
audience: public # public | internal | restricted
applies_to: [persona.security_lead, play.enterprise_outbound]
owner: [email protected]
source: https://example.com/trust # where this is established
approved_by: legal
valid_from: 2026-03-01
review_by: 2027-03-01 # a date, not "someday"
status: active # active | superseded | retired
supersedes: claim.soc2_type1
The fields that matter most:
- Provenance (
source,approved_by): where the knowledge came from and who vouched for it. Agents should cite it, and reviewers should be able to trace any generated claim back to a record. - Audience (
public,internal,restricted): what may appear in customer-facing output. This is the single most important guard against an agent quoting an internal benchmark or naming a customer who never agreed to it. A vendor that runs its own revenue on a company brain reported exactly that failure, concluding that "the allowlist separating published from merely true is not optional" (Sentra). - Freshness (
valid_from,review_by,status): when the knowledge became true, when it must be re-checked, and whether it has been replaced. Supersede records rather than overwriting them, so you can answer "what did we believe in March?" and audit what an agent knew when it acted. - Ownership (
owner): a named person or team accountable for keeping the record correct.
Schemas also make retrieval better. A query for "approved security claims for a security lead in an enterprise play" can filter on type, audience, applies_to, and status before any semantic search runs, which is faster and far more reliable than hoping the right paragraph ranks first.
13.5Ingestion and curation
Most GTM knowledge is created as a by-product of work: calls, emails, Slack threads, CRM updates, and documents. Ingestion turns that exhaust into usable context; curation keeps it trustworthy.
From call and meeting recorders. Transcripts are the richest source of customer context and the noisiest. Do not index raw transcripts as the main artifact. Extract typed facts (objections, competitors mentioned, stakeholders and their roles, commitments made, next steps, timing) against the resolved account and opportunity, each with a link to the moment in the call. Keep the transcript as the evidence behind the fact. Several recorders now expose their data to agents directly; Gong, for example, says its MCP server is generally available to Gong customers with Gong Credits. Respect recording consent and retention rules (Chapter 20).
From documents. Connect the wiki or drive folders that hold messaging, enablement, and playbooks, but only the curated ones. A crawler over the whole drive will happily ingest a two-year-old pricing deck. Start from an explicit list of approved sources, each with an owner.
From Slack and email. These contain decisions and tribal knowledge, plus a great deal of noise, private conversation, and superseded opinion. Treat them as a source for candidate facts that a human promotes into the brain, not as a source agents search directly by default. Clay reports that the feature its team uses most in Dust is "Slack search with references to other conversations" (Clay), which is useful for people asking questions; for automated agents that write to customers, promote and review first.
From the CRM and warehouse. Do not copy records into the brain. Expose them through tools (Section 13.6) so agents always read current values, under the same permissions as the user they act for.
Curation is the ongoing work that separates a company brain from a pile of embeddings:
- Review queues. Extracted facts and candidate updates go to the owner for approval before they become active, at least until you have measured the extractor's accuracy (Chapter 12).
- Conflict detection. When two active records disagree (two prices, two descriptions of the same feature), flag the conflict to both owners rather than letting retrieval pick one at random.
- Expiry. A job that lists records past their
review_bydate and notifies owners, exactly like the staleness report for this book's own sources. - Change events. A repositioning or price change should be a single edit to the brain that every agent picks up the same day, with a changelog entry.
13.6Retrieval and context engineering
Retrieval is how the right slice of the brain reaches the model. The main techniques, from simplest to most involved:
Long context. If the knowledge an agent needs is small, put all of it in the prompt. Anthropic's guidance is that a knowledge base smaller than about 200,000 tokens (about 500 pages) can be included in full, with prompt caching to control cost (Anthropic). For a single focused agent (say, a reply classifier that needs the persona list and the objection taxonomy), this is often the right answer. Because of the position and length effects described in Section 13.1, keep even "fits in the window" context tight and put the most important material first or last.
Retrieval-augmented generation (RAG). For larger bodies of knowledge, retrieve the relevant passages at run time and include only those. The technique was introduced in research that combined a model's "pre-trained parametric and non-parametric memory" (Lewis et al.). In practice: split documents into chunks, compute an embedding (a numeric vector representing meaning) for each, store them in a vector index such as pgvector in Postgres or a warehouse-native service, and at query time retrieve the chunks closest to the question.
Hybrid search and reranking. Pure embedding search misses exact terms (product names, SKUs, competitor names, error codes) that keyword search finds easily, and vice versa. Production systems combine both and then rerank the candidates. Anthropic reported that adding chunk-level context to embeddings and keyword (BM25) indexes reduced failed retrievals by 49%, and by 67% with reranking, on its test sets (Anthropic). Your numbers will differ; the direction is consistent enough to make hybrid search the default.
Structured lookup and tools. For structured facts and system-of-record data, do not use semantic search at all. Give the agent tools: get_pricing_rule(plan, seats), get_account_summary(account_id), list_approved_claims(persona, play). Exact lookups are cheaper, faster, and cannot return a near miss.
Just-in-time context. Rather than loading everything up front, agents can hold lightweight references (record IDs, stored queries, links) and fetch details only when needed. Anthropic describes teams augmenting retrieval with this "just in time" approach for agentic work (Anthropic). LangChain, an agent framework vendor, groups context engineering strategies into "write, select, compress, and isolate" (LangChain): write notes outside the context window, select what to bring in, compress (summarize) what is long, and isolate subtasks in separate agents with their own context.
Access over MCP. The Model Context Protocol (Chapter 12) is the natural interface for the context layer. Expose the brain as an MCP server with a small number of narrow tools (search the approved knowledge base, get an account summary, list approved proof for a persona), and let every agent and assistant connect to that one server instead of to every underlying system. CRMs and GTM tools increasingly offer their own MCP servers (HubSpot, Salesforce, Clay, Gong); your context server can call them behind the scenes while applying your permission, audience, and logging rules in one place. Follow the protocol's security best practices, which describe attacks such as the confused deputy problem and token passthrough and how to prevent them.
A useful mental model for context engineering in GTM is three layers assembled per task:
- Company context (slow-changing): ICP, persona, positioning, approved claims, voice. Mostly structured facts and short documents.
- Account context (per account): CRM state, history, recent signals, call insights, buying group. Mostly tools into systems of record.
- Task context (per run): the play spec, the specific input (a reply, a meeting), prior steps in this workflow, and the output schema.
Each AI step declares the layers it needs · more context is not better context
Each AI step should declare which of these it needs. A reply classifier needs little company context and the reply itself; a pre-call brief needs all three.
13.7Governance: ownership, permissions, PII, injection, and staleness
A context layer concentrates your company's knowledge and connects it to systems that act. That makes it valuable and risky in equal measure.
Ownership. Every content type in Section 13.2 has a named owner, and every record has one. GTM engineering owns the platform (ingestion, schemas, retrieval, access, monitoring); content owners own correctness. Gartner's recommendation to appoint a context engineering lead and "set up organizational accountability, processes and technologies for curating, governing and evolving the context AI systems use to make decisions" applies at any scale (Gartner).
Permissions. An agent acting for a user should see only what that user may see. Inherit permissions from the source system (a rep who cannot see an account in the CRM should not get its history through an agent), enforce them in the tool layer rather than in the prompt, and log every retrieval with the identity it ran under. Separate read from write: most context-layer tools should be read-only.
PII and sensitive data. Call transcripts and email threads contain personal data, and sometimes special-category data, about prospects and customers. Apply data minimization (extract the business fact; do not index everything), retention limits, and deletion propagation, so that a deletion request removes the person from transcripts, extracted facts, and the vector index as well as the CRM (Chapter 20). Check where your model and retrieval providers process and store data.
Prompt injection. Anything the brain ingests from outside (a prospect's email, a web page, a transcript of something a caller said) can contain instructions aimed at your agents. OWASP's Gen AI Security Project ranks prompt injection first among LLM risks and notes that indirect injections "occur when an LLM accepts input from external sources, such as websites or files" (OWASP). Simon Willison's "lethal trifecta" is the test to apply to any agent: access to private data, exposure to untrusted content, and the ability to communicate externally, all in one agent, is the combination that lets an attacker exfiltrate data (Simon Willison). A context layer gives agents the first leg by design, so control the other two: label ingested external content as untrusted, never let retrieved text grant permissions, keep consequential and outbound actions behind approval, and limit where an agent can send data.
Staleness. Stale context is the quiet failure: nothing errors, and every output is slightly wrong. Defend against it with review_by dates, expiry reports, superseded-not-overwritten history, conflict detection, and regular evaluation against current ground truth (Section 13.11).
For a broader structure, the NIST AI Risk Management Framework, which is "intended for voluntary use," offers a vocabulary for mapping, measuring, and managing these risks that security and legal teams will recognize.
13.8Build versus buy, and the tool landscape
The build-versus-buy framework in Chapter 14 applies here, with a few specifics. The tool category is young, names and positioning change quickly, and the descriptions below come from vendors' own materials; treat them as a starting map, not an endorsement.
| Approach | What it is | Examples (late 2026) | Good fit when | Watch for |
|---|---|---|---|---|
| Docs plus long context | A curated folder of short documents loaded into prompts | A wiki or Notion space, like Vercel's "GTM brain" doc (OpenGTM) | One team, a few agents, small knowledge base | Drift between copies; no audience labels |
| Enterprise knowledge and agent platforms | Connectors to company apps, permission-aware search, agent builders | Glean (enterprise search and agents across company apps) and Dust (agents over connected company knowledge) (Glean, Dust) | Broad internal Q&A across many tools | GTM-specific structure (claims, proof permissions) is up to you |
| GTM-specific context products | Prebuilt models of ICP, personas, messaging, proof, served to GTM agents | Octave (a "Library" of ICPs, personas, positioning, messaging, proof points, and reference customers that agents query at runtime) and ZoomInfo (which markets its GTM.AI platform as a "headless GTM context layer") (Octave, ZoomInfo) | You want GTM structure without designing it | Lock-in of your messaging model; fit with your CRM and warehouse |
| Conversation-intelligence platforms with agent access | Call data and insights exposed to agents over MCP or APIs | Gong's MCP server | Call insights are your main gap | Covers one slice of the brain |
| Warehouse-native build | Facts as tables, documents indexed next to them, tools over MCP | Snowflake Cortex Search (managed hybrid vector and keyword search); pgvector for Postgres | Strong data team; warehouse is already the hub | You own ingestion, evaluation, and UI |
Many teams combine approaches: buy an enterprise search or GTM-context product for documents and people's questions, keep structured facts (pricing rules, approved claims, proof permissions) in tables the GTM engineering team controls, and put a thin MCP server in front of both for agents. Whatever you choose, insist on export (your company brain must not be trapped in a vendor's format), permission inheritance, per-record provenance, and an API or MCP interface your own agents can use.
13.9Implementation playbook
- Pick one workflow. Choose a read-only, high-frequency task where humans can judge quality quickly. A pre-call brief or a first-draft outbound email for one play are good first choices.
- List the questions it must answer. For a pre-call brief: Who is on the buying group? What did they object to? What do we know about their stack? Which proof is relevant and approved? What did we promise last time?
- Inventory the knowledge. For each question, find where the answer lives today, who owns it, and how current it is. Expect duplicates and contradictions; resolve them with the owners.
- Define schemas. Create typed records for the facts the workflow needs (approved claims, proof, personas, pricing rules) with the metadata fields from Section 13.4. Keep documents short and single-topic.
- Fix identity first. Make sure call recordings, emails, and CRM records resolve to the same account and contacts (Chapter 3). This step takes longer than planned and matters more than retrieval quality.
- Build ingestion with review. Extract call insights into the schema, route them to owners or sellers for review, and connect only approved document sources.
- Expose it through one interface. Stand up a small set of read-only tools (search approved knowledge, get account summary, list approved proof) behind one MCP server or API, with permission inheritance and logging.
- Build the evaluation set before launch. Collect real examples with known correct answers and the failure cases you fear (Section 13.11).
- Ship to a pilot group. Run the workflow for a handful of sellers, collect corrections, and fix the brain rather than patching prompts.
- Add governance jobs. Expiry reports, conflict detection, change events, and a monthly review of audience labels and permissions.
- Expand one workflow at a time. Each new agent should reuse the same layer. Vercel's experience is a warning: after building around 20 agents and several new surfaces, the team instituted a rule of "no new surfaces" and consolidated onto shared components (OpenGTM).
13.10Worked example: pre-call briefs from a company brain
(This example, like the other worked examples in this book, is illustrative and not a case study of a real company.)
A mid-market data-security software company has 40 account executives. Its first AI pre-call brief, built quickly, pasted the messaging doc and the last ten CRM activities into a prompt. Sellers stopped reading the briefs within a month: they cited a retired case study, described a feature that had been renamed, and missed an objection raised on the previous call because the call notes were in the recorder, not the CRM.
The GTM engineering team rebuilt the brief on a context layer in six weeks.
- Company context. Product marketing consolidated four messaging documents into 12 persona records, 60 approved-claim records (each labeled public or internal, with an owner and a review date), and 25 proof records (customer, metric, permission to name, expiry). Pricing rules moved into a table owned by the deal desk.
- Account context. The team fixed identity matching between the call recorder and the CRM, then extracted objections, competitors, stakeholders, and commitments from each call into typed facts linked to the transcript timestamp. Sellers confirmed or corrected them in a two-minute review after each call.
- Interface. One MCP server exposed four read-only tools:
account_summary,call_facts,approved_claims, andapproved_proof. Each call ran with the requesting seller's CRM permissions and was logged. - The brief. A prompt (versioned, with an output schema) assembled the three layers: company context filtered to the attendees' personas, account context from the tools, and task context (meeting type and stage). Every claim in the brief had to cite a record ID; any claim without one was dropped by a validator.
- Evaluation. Before launch, the team built 80 test meetings with sellers' "ideal brief" notes and scored briefs on correct objections recalled, wrong or unapproved claims (target: zero), and correct proof selection.
After launch, the team tracked briefs opened before meetings, seller corrections per brief, and unapproved-claim incidents. When the company renamed a product line, product marketing edited three claim records and one persona record; every brief, and the outbound drafter that reused the same tools, reflected the change the same day.
13.11Metrics and evaluation
Measure the context layer on two levels: whether retrieval returns the right context, and whether the workflows built on it get better.
Retrieval quality. For a labeled set of questions with known correct sources:
- Recall@k: how often the correct record or passage appears in the top k results.
- Precision: how much of what was retrieved is relevant (irrelevant context costs tokens and invites errors).
- Exact-fact accuracy: for structured lookups, whether the tool returned the current value.
Answer and output quality (Chapter 12's evaluation methods apply directly):
- Groundedness: share of claims in outputs that cite a valid, active record.
- Unapproved-claim rate: claims with
audience: internalor retired status appearing in customer-facing output. The target is zero; treat any occurrence as an incident. - Staleness incidents: outputs that used superseded knowledge.
- Human correction rate: edits per brief or draft, tracked over time.
Layer health:
- Coverage: share of the workflow's questions the brain can answer from an owned, current record.
- Freshness: share of records past their review date, by owner.
- Conflicts open: unresolved contradictions between active records.
- Time to propagate a change: from a positioning or price change to every agent reflecting it.
Business outcomes follow the same standards as any other GTM system (Chapter 15): compare reply rates, meeting conversion, or seller time saved against a holdout or a before-and-after baseline, and attribute carefully.
13.12Anti-patterns
- The prompt as database. Positioning, prices, and proof pasted into each agent's prompt, so every change requires editing a dozen prompts and some are always missed.
- Index everything. Pointing an embedding pipeline at the whole drive and all of Slack, then wondering why agents quote a 2023 pricing deck.
- No audience labels. Treating everything the company knows as something it may say. The result is internal benchmarks and unapproved customer names in outbound email.
- Copying the CRM. Duplicating account data into documents, where it immediately goes stale, instead of reading it through tools.
- Retrieval before identity. Investing in hybrid search and rerankers while call notes still attach to the wrong account.
- Ownerless content. A brain that GTM engineering "owns" in full, so nobody in product marketing, finance, or sales enablement feels responsible for whether it is right.
- Trusting retrieved text. Letting content from emails or web pages influence what an agent is allowed to do.
- Longer is better. Filling a million-token window because it is available, instead of selecting the smallest high-signal context.
- No evaluation. Judging the layer by demos rather than by labeled questions and measured correction rates.
13.13Chapter summary
- The context layer (or company brain) is a governed, maintained body of company and customer knowledge served to every AI step; context engineering is the discipline of getting the right slice of it to the model at the right moment.
- It holds ICP, personas, positioning and approved claims, product facts, pricing rules, competitive intelligence, proof, call insights, references to account history, decisions and playbooks, and brand voice, each with an owner.
- It complements the data model, warehouse, and CRM: systems of record hold customer facts; the context layer holds how-we-sell knowledge plus tools into those systems.
- Store checkable knowledge as structured facts and the rest as short, owned documents, all with provenance, audience, freshness, and ownership metadata.
- Ingest from calls, documents, Slack, and the CRM with review queues, conflict detection, expiry, and change events.
- Retrieve with the simplest method that works: long context for small sets, hybrid search with reranking for documents, exact tools for facts and records, served through one MCP server or API.
- Govern with named owners, inherited permissions, PII minimization, prompt-injection controls, and staleness monitoring.
- Start with one read-only workflow, evaluate before launch, and make every new agent reuse the same layer.
Checklist: A production-ready context layer
- Every content type and every record has a named owner and a review date.
- Customer-facing agents can use only records labeled for public use; a validator enforces it.
- Structured facts (prices, claims, proof permissions) live in one place and are read at run time, not pasted into prompts.
- Call, email, and CRM data resolve to the same accounts and contacts before indexing.
- Extracted facts link back to their evidence and pass a review step until accuracy is measured.
- Agents reach the layer through a small set of read-only tools with inherited permissions and logging.
- Ingested external content is treated as untrusted; it cannot change permissions or trigger actions.
- Deletion requests propagate to transcripts, extracted facts, and vector indexes.
- A labeled evaluation set measures retrieval recall, groundedness, and unapproved-claim rate, and reruns on every change.
- An expiry report and a conflict report go to owners on a schedule.
Check your understanding
Six questions on applying this chapter. Answer each one yourself, then open the answer to check.
Multiple choice
An agent needs the current price rule for 40 seats on the Pro plan. Which retrieval method fits?
- Embedding search over old pricing decks
- A structured lookup tool such as get_pricing_rule(plan, seats)
- Pasting every pricing document into the prompt
- Asking the model to recall it from training
Show answerHide answer
Answer: B. A structured lookup tool such as get_pricing_rule(plan, seats)
Section 13.6: for structured facts and system-of-record data, give the agent exact tools rather than semantic search, which can return a stale or approximate answer.
Spot the flaw
A team points its embedding pipeline at the entire shared drive and all of Slack. Soon an outbound agent quotes a 2023 pricing deck. What went wrong?
Show answerHide answer
Answer: Indexing everything without curation, ownership, freshness, or audience labels, so stale and internal content gets retrieved.
Section 13.12 names "index everything" and "no audience labels" as anti-patterns; Sections 13.4 and 13.5 call for owned, reviewed records with expiry.
Scenario
Product marketing changes the positioning, and twelve agent prompts still contain the old text pasted in. What do you change?
Show answerHide answer
Answer: Model answer: Move positioning into the context layer; agents retrieve it from one place.
Section 13.12's "prompt as database" anti-pattern: when knowledge lives in prompts, every change means editing many prompts and some are always missed.
True or false
A reply classifier and a pre-call brief need the same context: company, account, and task layers in full.
Show answerHide answer
Answer: False.
Section 13.6 says each AI step should declare what it needs: a reply classifier needs little company context and the reply itself, while a pre-call brief needs all three layers.
Put in order
Order the three context layers from slowest-changing to per-run.
- Task context (the play spec, this input, the output schema)
- Company context (ICP, positioning, approved claims)
- Account context (CRM state, signals, buying group)
Show answerHide answer
Answer: B (Company context (ICP, positioning, approved claims)) → C (Account context (CRM state, signals, buying group)) → A (Task context (the play spec, this input, the output schema))
Section 13.6 assembles company context (slow-changing), account context (per account), and task context (per run) for each task.
Pick the metric
How should you judge whether the context layer is actually working?
- How impressive the demo looks
- Measured retrieval and output quality on labeled questions, such as recall, groundedness, and human correction rate
- Number of documents indexed
- Total tokens per prompt
Show answerHide answer
Answer: B. Measured retrieval and output quality on labeled questions, such as recall, groundedness, and human correction rate
Section 13.11 measures retrieval quality, output quality (groundedness, unapproved claims, corrections), and layer health; Section 13.12 warns against judging by demos.
Sources for this chapter
- Context Rot: How Increasing Input Tokens Impacts LLM Performance
- How to connect agents across your tech stack with MCP
- Introducing Contextual Retrieval
- Glean
- What is the Octave Library?
- Cortex Search
- Shopify CEO and ex-OpenAI researcher agree that context engineering beats prompt engineering
- Context Layer for AI Agents: A Guide for GTM Teams
- Jeanne DeWitt Grosser, COO, Vercel
- How we built Clay’s GTM engineering function
- Running Revenue on a Company Brain: Our GTM Engineering Setup
- pgvector: Open-source vector similarity search for Postgres
- HubSpot MCP Server
- Hosted MCP Servers: Get Started
- Clay MCP
- Security Best Practices
- AI Risk Management Framework
- Dust
- Effective context engineering for AI agents
- Context Engineering Is the New Prompt Engineeringblocks bots
- Lost in the Middle: How Language Models Use Long Contexts
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Context Engineering
- LLM01:2025 Prompt Injection
- The lethal trifecta for AI agents: private data, untrusted content, and external communication