On this page
- The retrieval was right. The decision context was wrong.
- What's the difference between RAG and context assembly?
- Start from the decision, not the search query
- Enterprise context comes in many shapes
- Who is allowed to see this context?
- Is the latest data always the right data?
- Evidence informs. It never gives orders.
- Transformations and budgets change meaning
- When is context sufficient to act?
- Record what the model actually saw
- Common anti-patterns
- Ten rules for governed context assembly
- The result: decisions built on enough, not just on related
- Frequently asked questions
- How Frozion assembles the context behind each action
- Sources
Context engineering means building everything an AI decision needs, not just retrieving related text. RAG finds candidate documents. Context assembly starts from the decision, pulls in structured state, features, history and policy alongside documents, checks scope and freshness, keeps instructions separate from evidence, and refuses to proceed when mandatory facts are missing.
The retrieval was right. The decision context was wrong.
A corporate-lending application reviews a borrower's request for a 90-day covenant waiver. The agreement allows a temporary waiver only if the borrower hasn't had another in the past 12 months and current exposure stays under $50 million.
Retrieval does its job. It finds the signed agreement, the latest amendment and the borrower's letter. The model extracts the waiver clause accurately and classifies the request as a routine exception.
The facts that decide the case live elsewhere. Current exposure is $58.4 million, in a feature store. A previous waiver was granted eight months ago, in the case system. The risk grade sits behind a structured service. The rule requiring committee review lives in policy. None of it reaches the model or the decision.
The proposal is well-formed, the citations are real and every dashboard is green. The request goes to routine approval instead of mandatory credit committee.
What's the difference between RAG and context assembly?
RAG answers which documents look related to a request; context assembly answers what one specific decision needs, whether the requester may use it, and whether it's complete. RAG is one input to that process, not the whole of it.
Retrieval-augmented generation is valuable. It brings current enterprise information into a model call, improves relevance and supports citations. But retrieval asks "what's related?" An enterprise decision also has to ask what's mandatory, allowed, current, authoritative and safe to show the model.
| Question | What retrieval answers | What context assembly must also answer |
|---|---|---|
| Relevance | Which passages or records look related? | Which source types does this decision require? |
| Eligibility | Which indexed items match the filter? | Which items may influence this person, tenant, purpose and location? |
| Completeness | How many results came back? | Are the required facts, rules and contrary evidence all present? |
| Freshness | Which revision was retrieved? | Does each item meet this decision's time requirements? |
| Meaning | What text came back? | What role, units, trust level and precedence does each item carry? |
| Boundary | What did the retriever return? | What exact package reached the model after trimming and ordering? |
Start from the decision, not the search query
A search-first design begins with a question, a query and a top-k value. A decision-first design begins with what must be evaluated and what has to be true before an answer or action is allowed.
For the waiver, the agreement text is necessary but nowhere near sufficient. The decision also needs current exposure, waiver history, risk grade, the applicable policy, the requester's authority, the legal entity and the decision date. Documents explain the rule. Structured systems supply the facts the rule applies to.
Separate mandatory context from useful context. A missing market commentary makes the answer less rich. A missing exposure figure makes automation impermissible. Treating both as ordinary retrieval misses hides that difference.
Enterprise context comes in many shapes
Decisions rarely live entirely in documents. A governed design doesn't force every source into one store. It gives each kind of source its own contract and joins them into one typed package.
| Context type | Examples | What to keep with it |
|---|---|---|
| Instructions and constraints | Task, output schema, policy-derived limits | Version, owner, and strict separation from evidence |
| User request and assertions | The ask, uploads, selected account | Who said it, when, and whether it's been checked |
| Documents | Contracts, policies, letters, reports | Source, revision, scope and how it was chunked or extracted |
| Live operational state | Balances, limits, case status, approvals | Point-in-time value, record revision, authority |
| Features and derived facts | Exposure, risk indicators, ratios | Definition version, lineage, effective time |
| Memory and prior decisions | Conversation summary, earlier rulings | What it applies to, status, expiry |
| Tool results | API responses, status checks | Which tool, when, and whether a change was committed |
| Policy and authority facts | Tenant, role, purpose, residency | Authoritative source and validity |
Documents and records have to meet through explicit meaning, not prompt concatenation. A clause describing a 12-month lookback and a count of prior waivers only line up if the time window, legal entity, borrower ID and units match. Matching words don't prove compatible meaning. For how the two kinds of data share one execution, see structured and unstructured context.

Who is allowed to see this context?
Apply scope (tenant, legal entity, purpose, classification and residency) before anything is ranked, not after. A source can be relevant and still be off-limits, and filtering late lets forbidden items shape the result even if they're never shown.
If permission filters run only after global candidate ranking, off-limits items can still consume top-k slots and push permitted evidence out. The same applies to caches, features, memory and tool results. And permission is layered: a document a user may read on screen may still be barred from a particular model provider or a prompt cache. Eligibility is a first stage of assembly, not a cleanup step. The retrieval side of this is covered in permission-aware retrieval.
Is the latest data always the right data?
No. Each fact needs the right time, not the newest timestamp: a contract from last year, a balance from seconds ago and today's policy revision can all be correct together. What matters is that their time meanings fit the decision.
Distinguish when a value was observed, when it took effect, which decision date you're evaluating, how stale it may be and what invalidates it. A legal clause stays valid for years; an available balance doesn't. A policy revision can exist before its effective date. Reconstructing a past decision needs the facts as they were then. Authorizing an action now needs present-state checks.
| Time question | Why it matters |
|---|---|
| When was it observed? | A fresh read may describe an earlier period |
| When did it take effect? | A revision may exist before it applies |
| Which decision time? | Replay and live execution need different states |
| How stale may it be? | Clauses last; balances don't |
| What invalidates it? | A new record revision, approval or policy change |
Evidence informs. It never gives orders.
A context package mixes instructions, evidence, user claims, model-written summaries, prior decisions and tool results. They aren't interchangeable, and prompt order shouldn't decide which one wins.
A retrieved document can contain text that reads like an instruction; OWASP lists this indirect prompt injection as the top LLM risk. A memory can hold a superseded conclusion. A model summary is useful but less authoritative than the record it summarizes. A tool result can be current and still be advisory rather than committed.
- Keep contradictory evidence visible when the decision needs judgment.
- Never let imperative text in a document become application policy.
- Never let stale memory override a newer record.
- Never treat a summary as equal to its source.
- Record which rule resolved each conflict.
Transformations and budgets change meaning
Chunking, OCR, translation, redaction, summarization, unit conversion, aggregation and mapping all change what context means. Version them and record what they did. A balance query, date calculation or unit conversion shouldn't be handed to a model just because a model will read the final package; settle those exactly first.
Token, latency and cost limits look like serving concerns, but they decide which facts survive. An optional market report mustn't displace a mandatory contract exception. A long conversation history mustn't crowd out current state or policy. Allocate budget by role and importance, not relevance score. More context isn't better context: the goal is the least context sufficient for the decision, which also limits what leaks and what it costs.
When is context sufficient to act?
Context is sufficient when it meets the decision's declared requirements for coverage, freshness, scope and consistency, checked before the model is asked to judge. A successful query or a non-empty result proves nothing on its own.
Sufficiency depends on the decision. Contract review may need the agreement and every effective amendment. A credit decision needs exposure, risk grade, prior exceptions and policy. A support draft can tolerate missing background; a payment release can't. Check the assembled package and return a typed outcome:
| Outcome | Meaning | Next step |
|---|---|---|
| Ready | Requirements met | Proceed to judgment or policy |
| Source unavailable | A required source can't be reached | Wait, use an approved alternative, or review |
| Stale | A value is past its freshness limit | Refresh or stop |
| Denied | Scope or policy forbids a source | Exclude; continue only if still sufficient |
| Conflict | Sources disagree | Reconcile by rule or send for judgment |
| Incomplete | A mandatory fact is missing | Fetch more, review or abstain |
Fallback must never quietly weaken the requirement. If the exposure service is down, the application shouldn't carry on with documents alone unless that degraded mode is explicitly allowed, with its own controls.

Record what the model actually saw
The rules describe what's permitted. A record of each run shows what actually happened: which items were eligible, which were selected, transformed, excluded and in what order, and the exact package the model received. That distinction matters for replay. Running today's query against today's index can't reconstruct yesterday's context. Investigating a past decision needs the original revisions, features, memory and final package, or an honest statement of what can no longer be reproduced. See context provenance.
Common anti-patterns
| Anti-pattern | Why it fails | What to do instead |
|---|---|---|
| RAG is the context architecture | Documents become the whole decision boundary | Declare every required source type per decision |
| Top-k means complete | A count says nothing about mandatory facts | Check sufficiency against declared requirements |
| Latest means correct | Facts have different valid times | Define freshness and point-in-time rules per source |
| Everything is text | State, features and policy get flattened or dropped | Use typed context items and governed joins |
| Order decides authority | The last or longest item wins silently | Declare roles, trust levels and precedence |
| Fallback means carry on with less | A failed source silently lowers the bar | Publish typed degraded modes, escalation or abstention |
| Filter after ranking | Off-limits items crowd out permitted ones | Apply scope before ranking and selection |
| Context logic lives in prompt code | Nobody can review joins, filters or budgets | Make the context plan versioned and inspectable |
Ten rules for governed context assembly
- Start from the decision and its required facts, not a search query.
- Treat retrieval as one input among several.
- Type documents, state, features, memory, tool results and policy separately.
- Apply scope and residency before anything is ranked.
- Give every fact a time meaning and a freshness limit.
- Declare roles and precedence; never let evidence give orders.
- Version every transformation and record what it changed.
- Budget by importance, not relevance score.
- Check sufficiency before judgment, with typed outcomes.
- Record the exact package each decision used.
The result: decisions built on enough, not just on related
RAG stays essential. The mistake is asking it to carry responsibilities it wasn't built for. A governed context pipeline starts from the decision, combines every kind of source, keeps identity and policy intact, reconciles time and meaning, checks sufficiency, and records the exact boundary the model received.
What you get isn't just a better prompt. It's an inspectable part of the application: reviewed before it ships, enforced at runtime and reconstructable afterwards. Retrieval supplies candidates. Context assembly decides what's allowed to become part of the judgment.
Frequently asked questions
What is the difference between RAG and context engineering?
RAG answers which documents look relevant to a request. Context engineering answers what a specific decision needs: which sources are mandatory, which the requester may use, how current each must be, how conflicts resolve, and whether the assembled package is complete enough to act on.
Why isn't top-k retrieval enough for enterprise AI agents?
A top-k result counts candidates, not coverage. Ten relevant passages can still miss a balance, a prior exception or a policy rule held in another system. Completeness has to be checked against the decision's declared requirements, not inferred from a non-empty result.
How should an AI agent handle missing or stale context?
Stop and say so with a typed outcome rather than continuing on less. Depending on the rules, the agent fetches more, verifies, routes the case to a person with the gap shown, or abstains. Continuing with documents alone should be an explicit, approved degraded mode.
How does this work for agents we already run?
Route the agent's tool calls through a governed runtime over MCP or HTTPS. Before each consequential call, the runtime assembles a checked context package from your documents, records, features and policy, scoped to the requester, and keeps a record of exactly what the agent saw.
How Frozion assembles the context behind each action
Frozion's Context Store & Assembly puts a checked context package behind every action, and evidence never gives orders. Structured facts come from typed operational collections in Collections & Query Builder, with join and result contracts and query receipts. Features come from the Feature Store, authored in SQL or visually, with freshness limits you define. Authorization applies roles, conditions, taxonomy scope, purpose and record-level checks, and Provenance & Evidence keeps one tamper-evident record of the facts behind each decision.
Sources
- NIST AI Risk Management Framework (AI RMF 1.0)AI risk as a lifecycle responsibility tied to context of use.
- NIST AI 600-1, Generative AI ProfileRisks across retrieval, integration, provenance and privacy.
- OWASP LLM01:2025 Prompt InjectionRetrieved content can carry instructions that steer a model.
- OWASP LLM08:2025 Vector and Embedding WeaknessesRetrieval and embedding risks, including cross-tenant leakage.
- NIST SP 800-53 Rev. 5Information-flow enforcement, least privilege and audit records.
- W3C PROV-ONeutral model for derivation and use of context items.
- JSON SchemaMachine-readable contracts for typed context items.
- RFC 8785, JSON Canonicalization SchemeStable hashing of the exact package a model received.
More in Data & context
Context assembly 2
Retrieval & data access 3
State, memory & features 2
Other topics



