All chapters
  1. Start hereA model knows only what it can see now
  2. Foundations · 1The context window: tokens, messages and order
  3. Foundations · 2Signals and authority: who is allowed to instruct the model
  4. Foundations · 3The context assembly pipeline: select, rank, deduplicate, pack
  5. Retrieval · 4Retrieval fundamentals: lexical search, embeddings, hybrid search, reranking
  6. Retrieval · 5RAG architecture: chunks, metadata, grounding, citations, freshness
  7. Budget · 6Context budgeting: truncation, dilution, token cost and caching
  8. Budget · 7Compression, summarization and compaction, with loss tests
  9. Agents · 8Coding-agent context: repository maps, instruction files, diffs and tool outputs
  10. Agents · 9Working context, durable memory and checkpoint state
  11. Agents · 10Dynamic context: just-in-time retrieval, selective tool disclosure, delegation
  12. Agents · 11Multi-agent context isolation and scoped handoffs
  13. Trust · 12Context security: injection, poisoning, access controls, tenant boundaries
  14. Trust · 13Measuring context quality: recall, utilization, grounding, ablation
  15. Practice · 14Frameworks and standards: what each one assembles for you
  16. Practice · 15Context in production: versions, drift, refresh, observability, incidents
  17. Practice · 16The insurance lab: one submission, every context decision
  18. ReferenceGlossary
  19. AboutAbout this site and its sources
Reference

Glossary

Every term this site uses, each with what it is, what it is not, and how it shows up in the insurance example.

Every term this site uses, in one place. Each card opens the same drill-down as the underlined phrases in the text: one line, why it matters here, what it is, what it is not, and how it shows up in the insurance example.

AblationAn experiment that removes one item from a window, or one stage from the assembler, reruns the model and compares the answer with the original.Access controlThe rule that decides which items a given agent, acting for a given person and purpose, may read.Agent SDKA library you import that already runs the agent loop (call the model, run the tools it asks for, call it again) and handles some context for you.Agentic searchSearch in which the model chooses each query or tool call from what the previous results showed, step by step.AGENTS.mdA plain Markdown file in a repository that many coding agents read as their instructions; described on its site as a README for agents.Answer groundingThe share of an answer's citations whose source text was readable in the window of that model call.Attention dilutionThe effect that the more irrelevant text a window holds, the smaller the share of the model's attention the relevant sentences receive.AuthorityThe right of an item in the window to give the model orders. In the example only the system instructions have it.BM25A scoring formula that adds a weight for each query word in a chunk, high for rare words, dampened for repetition and for long chunks.Cache prefixThe section of a request from its first token up to a marked or chosen point, which must be identical to an earlier request for the provider's cache to be used.CandidateAn item that could go into the window, before selection, filters, ranking and packing.Checkpoint stateWhat a run needs to resume after a pause or a crash: the last completed step, open questions, the attempt number, ids of gathered evidence.ChunkA piece of a document, cut so that it can be retrieved and placed in a window on its own.ChunkingThe step that cuts documents into the pieces a retriever returns.CitationAn id in the answer that names the source a claim relies on: a rule id or an evidence id.CLAUDE.mdThe instruction file Claude Code loads at session start, in several scopes: organization, user, project and personal.Coding agentAn agent that reads, searches and edits files and runs commands such as tests in a repository, building its context from the repository and its own tool results.CompactionReplacing part of a run's history with a shorter form (truncated, cleared or summarized) so that the run can continue inside its window.CompressionRepresenting information in fewer tokens; it can be exact (removing whitespace, extracting fields) or lossy (summarizing).Context assemblyThe step that builds the window for one model call: gather candidates, keep what the step needs and may read, rank, deduplicate, pack under a budget, and record the result.Context budgetThe number of tokens the application allows a window, or one part of it, to use; a decision made in code below the model's limit.Context driftA change in the windows an agent receives that comes from a change in its parts (policy, index, retriever, embedding model, model), not from its inputs or its code.Context editingA Claude API feature that, past a threshold you set, replaces old tool results (or old thinking) with a short placeholder on the provider's side, while your program keeps the full history.Context engineeringThe work of choosing, for each model call, what goes into the window, what stays out, in what order and within what budget.Context isolationEach agent's window holds only what its own task needs; anything that crosses from one agent to another crosses deliberately, in a chosen form.Context itemOne unit the assembler includes or omits as a whole: a passage, a field group, a tool result, a past decision, an earlier turn.Context leakAn item reaching a window whose task does not need it and whose agent should not see it.Context limitThe largest window a model accepts, counting input and output together.Context manifestFor one model call: every included item with its size and reason, every omitted item with its omission reason, plus the identifiers and versions of the call.Context observabilityThe ability to say, for any past model call, what its window contained, what was left out and why, from records kept at the time.Context poisoningPutting content into a store that later windows are assembled from (an index, a document store, a memory), so that it reaches many calls.Context rotThe observed decline in a model's ability to recall and use information as the number of tokens in its window grows.Context utilizationThe share of the window's data items, and of their tokens, that the answer actually rested on.Context versionA name for every setting that decides which items enter a window and how: retriever, embedding model, reranker, k, filters, deduplication, budget and shares, label format.Context windowThe block of tokens that one model call receives, and the maximum size that block may have.ContextThe information a model can see in one call: everything the application put in front of it this time, and nothing else.Cosine similarityA number from -1 to 1 that says how much two vectors point the same way; 1 is the same direction.DeduplicationRemoving a candidate whose content nearly repeats a better-ranked item already kept, so that copies do not use up slots and tokens.DelegationHanding a subtask to another agent with its own window, and receiving only the result.DelimiterA marker around a data item, such as a tag, that separates it from the instructions and carries its label.Diff contextUsing a diff as context for a model: the lines removed and added, with a few unchanged lines around them, instead of whole files before and after.Durable memoryInformation stored outside any window because it stays true and useful across sessions and submissions.EmbeddingA vector produced from a text so that texts with similar meaning get nearby vectors.Evidence idA stable id for one item of evidence (a field group, a tool result, a policy chunk, a past decision), so that manifests, citations and audits can point at it.FreshnessThe property that every item in a window belongs to the version of its source that is in force at the time of the call.GroundingThe property that the answer's claims and citations rest on items that were actually in the model's window.Handoff briefThe task, the evidence the receiver needs with its sources, the rule it applies and the form of its answer, and nothing else.HandoffThe moment one agent passes a task, and some context, to another agent, and later receives a result.Hybrid searchRunning lexical and vector search for the same query and merging the two rankings into one.Incident analysisRebuilding, from records, the window behind a wrong answer, finding the item that misled it, and naming the stage that let that item in.Index refreshThe job that adds new chunks, replaces changed ones, removes withdrawn ones and marks superseded ones in the retrieval store.Indirect injectionInjection that arrives inside third-party content the model reads on someone's behalf: a web page, a file, an email, a tool result.Instruction fileA file in a repository that a coding agent's harness loads into the window at session start, so that build, test and never-do rules need not be repeated in every request.Instruction versus dataAn instruction is text the application wants followed; data is text the model should read as facts about the world, even when it looks like an order.Just-in-time retrievalThe window starts with a small core and tools; the agent fetches each item at the moment a step needs it, instead of loading everything before the call.LangChainA library that gives model and tool abstractions, an agent loop and middleware, which are functions that run before or around each model call; LangGraph is a lower-level runtime for long-running, stateful agents.Least contextGiving each model call only the items its step needs, so that what can steer the model and what it can disclose are both as small as possible.Lexical searchSearch that scores a chunk by the query words it contains, weighting rare words more.LlamaIndexA Python library that loads documents, splits them into chunks it calls nodes, embeds and indexes them, and returns the most similar nodes for a query.Loss testA check run after compaction: is each fact a later step needs still present, and does the next step still decide the same way?MCPA protocol that says how an AI application (the host) asks a separate program (a server) for tools, prompts and resources, so any host can use any server.MCP resourceOne item of data, such as a file or a policy section, that an MCP server offers at a URI so that a host can read it and place it in the window.Memory recallThe step that takes an item from durable memory or checkpoint state and makes it a candidate for the current window.MessageOne entry in the list a model call receives: a role that says who is speaking, and the content.Metadata filterA condition on fields stored next to each chunk, such as tenant, audience or status, that removes chunks before they are ranked.MRRFor one query, 1 divided by the rank of the first relevant result; MRR is the mean over all labelled queries.Omission reasonOne value from a fixed list that says why a candidate is not in the window.Output tokensThe tokens the model generates in its answer; a request reserves room for them inside the same limit as the input.OverrideA decision by the underwriter that differs from the agent's recommendation, recorded with the person's role, the decision and the reason.PackingThe last stage of assembly: placing items into the window within the token budget, by priority and share.pgvectorAn open-source extension for PostgreSQL that adds a vector type, distance operators and approximate indexes (HNSW, IVFFlat).Pinned factA fact the compactor copies verbatim into a separate block, whatever the target size, because a later step depends on it.Policy fixtureThe invented underwriting guide of the example, UW-GUIDE, with rule ids and versions; a fixed test input, not insurance practice.Progressive disclosureShowing a short list of what exists (names and one-line descriptions) and loading the full content only when it is asked for.Prompt cachingA provider feature that reuses the processing of the beginning of an earlier request when a new request begins with exactly the same tokens.Prompt injectionText that reaches a model through some input and tries to make it do what its developer did not intend.ProvenanceThe record of an item's origin: which source produced it, which version, when, and which audience and tenant may read it.QuarantineReading untrusted text in a separate model call with no tools, whose only output is typed fields from an allow-list; the main agent gets the fields, never the text.RAGRetrieving relevant passages from a store and putting them in the window before the model answers, so the answer can rest on them.RankingOrdering candidates of one kind by how relevant they are to the current step, usually by a retrieval score.ReplayRebuilding the window of a past call from its recorded inputs and versions, and where useful running the model on it again.Repository mapA compact list of a repository's files (or modules) with their purpose, read first so the agent can open only what the task needs.RerankingTaking the top of a first ranking and scoring it again with a more careful, more expensive method.Retrieval precision at kThe share of the first k results that are labelled relevant, counting near-copies once.Retrieval recall at kThe share of the labelled relevant chunks for a query that appear in the first k results.RetrievalFinding, for a query, the items in a store that are most likely relevant, as a ranked list the assembler cuts at k.RoleA label on each message that says who is speaking: the application's standing instructions (system), the request and data (user), or the model's earlier output (assistant).Run idThe id of one execution of the workflow for one submission; retries inside it are attempts, and the whole run is one trace.SessionA conversation or a run during which the application keeps re-sending a growing history to the model.Shared stateA store that several agents read or write: a database row, a file, an evidence store, the checkpoint of a run.SignalAn item in the window looked at by the claim it makes: an instruction, a fact, a rule, an opinion, an order.Stateless callA model call in which the model remembers nothing from earlier calls; whatever it should know must be sent again.SubagentAn agent with its own instructions, its own tools and a window that starts empty, started by another agent for one task.SubmissionThe JSON record that intake writes from a broker's email; every later step reads it instead of the email.SummarizationWriting new, shorter text that represents a longer text; lossy by construction, so the question is what it keeps.System promptThe text in the system role: who the model is in this application, what it must do, and how to treat everything else in the window.Tenant boundaryThe rule that data of one customer of a shared platform must never reach a window built for another, however relevant it looks.Token costThe input tokens a call reads and the output tokens it writes, each billed by the provider at its own rate.TokenThe unit a model reads and writes: a piece of text, often part of a word, sometimes a short word or one punctuation mark.TokenizerThe program that turns text into the tokens a particular model reads; each model family has its own.Tool disclosureThe choice of which tool definitions are in the window at a given step, so each step sees only the tools it needs.Tool outputThe result of a tool call that the application adds to the next window; it is data, whatever tool produced it.Tool-result clearingReplacing the content of an old tool result with a short placeholder while keeping the rest of the history, including the agent's own conclusions.Top-kThe cut that keeps only the first k items of a ranking for the window.TruncationCutting a text or a history to a size by keeping its head (or its newest part) and dropping the rest, whatever the rest said.Trust labelA value the assembler writes next to an item to say how far it may be believed and whether it may instruct.Underwriter cockpitThe web application in which a human underwriter reads the agent's recommendation, reasons and citations, and makes the decision.UnderwriterThe authorized person who reads the agent's recommendation and makes the decision.Underwriting agentThe program in the example that calls a language model in a loop, uses tools to gather evidence, and writes a recommendation for a person.Vector indexAn index that finds the vectors nearest to a query without comparing it with every row, at the cost of being approximate.Vector searchSearch that embeds the query and returns the chunks whose embeddings are closest to it.Working contextThe items in the window of the current model call; rebuilt for every call and gone when it ends.Working setThe items the assembler chose to put into the window for one call, out of all the candidates it could have chosen.