Every generation of Context Runtime through v3 answered variations of a single question — how should the runtime execute? v4 changes the question itself:
v3 → How should the runtime execute?
(which plan, which model, under which policy, at what cost)
v4 → What knowledge representation must the runtime reason over
BEFORE an execution plan can even exist?That is not another capability bolted onto execution planning — it is a new stage above it. v3 optimizes execution; v4 decides what kind of knowledge the question is even about, and only then hands a representation-scoped problem down to the planning machinery below. We call the component as a whole the decision engine: earlier generations called it the planner, but selecting an execution plan is now only one of its jobs. It is the difference between a better query plan and choosing which engine class the query belongs to in the first place.
Production AI no longer operates over documents alone. It operates over documents, graphs, temporal history, analytical warehouses, codebases, images, video, and continuously changing operational data. Retrieval is therefore not the optimization target — knowledge representation is. Retrieval becomes a lower-level physical planning decision within each representation.
Compatibility with v2. Whitepaper v2 modeled sparse, dense, hybrid, graph and memory as peer retrieval arms. That remains the physical execution layer. v4 adds a logical planning stage above it: the decision engine first selects a knowledge representation, then evaluates the retrieval methods available within it — analogous to a database separating a logical relation from its physical scan operator. v4 extends v2; it does not reclassify or invalidate it.
Early RAG systems assumed every answer lived inside documents. That assumption breaks for production systems, where the same question can require entirely different representations of knowledge:
| Question | Representation required |
|---|---|
| "What changed between March and May?" | Temporal |
| "What depended on this requirement?" | Graph |
| "What was promised to this customer?" | Conversation history |
| "Show revenue by region." | Analytical (OLAP) |
| "Why did inventory disappear?" | Multi-source analytical |
These are not different retrievers over the same store — they are different representations of knowledge. A decision engine that treats them all as document search returns the plausible-but-wrong answer. The decision engine must select the representation before it optimizes retrieval.
The shift is one stage, inserted at the top of the decision engine — and it composes with every capability the earlier generations added rather than replacing them.
Policy is applied twice, for two different jobs. First a policy-scoped capability registry removes the representations, sources and plugins the principal may not use — so a user without CRM or medical access never has those representations even considered as candidates. Then, once candidate plans exist, plan-level validation checks the execution-specific constraints: row access, budgets, data residency and approvals. This preserves v3’s rule — a prohibited plan is never part of the feasible search space — and prevents the decision engine from ever learning unauthorized capability availability through timing, EXPLAIN output or rejected-plan metadata. v4 does not replace v3’s governance or v2’s measured cost model; it feeds them a richer, already-scoped decision. A single deployment runs every generation at once.
How it is wired (shipped in the core). Knowledge-aware planning is three concrete stages, not a rewrite of the ones below it:
KnowledgeRepresentation alongside the intent bucket, and is hybrid: a fast keyword head resolves explicit cues for free, and an LLM head fires only when the keyword head is unsure (it defaulted to document or was low-confidence) — the implicit multi-hop or temporal intent a keyword rule cannot see. Content signals reach representations no bucket produces on its own: “how many… per week” or “records in the orders table where…” → the analytical (structured-store) representation, which routes to the plugged-in database's retriever — SQL, or MongoDB / Elasticsearch where SQL is not applicable; “what’s in this screenshot” → multimodal.methods_for(representation)) instead of a flat per-bucket table, plus a document fallback so a missing or infeasible representation engine degrades gracefully.Every decision the engine makes is inspectable in one trace — representation choice included:
EXPLAIN ├── representation decision ├── candidate execution plans ├── physical retrieval / access methods ├── policy decisions ├── estimated vs actual measurements └── reward provenance
Learning is cumulative, not replaced each generation: Gen. 1 introduced the bandit seam, v2 added measured evidence and quality-aware routing, v3 added controlled exploration under drift, and v4 applies the same loop to representation selection.
Measured — v4 routing benchmark (real HippoRAG + Graphiti, three graph regimes). The hybrid keyword+model head routes at 1.00 / 0.90 / 1.00 (document / graph / temporal) versus the keyword head alone at 0.95 / 0.00 / 0.00 — and holds on a shuffled 45-query interleaved stream (1.00 / 0.93 / 1.00): genuine per-query routing, not per-dataset memorization. On multi-hop, real HippoRAG lifts gold-recall 0.650 → 0.988. On answer quality (independent judge), CR-routed context ties full-context dumping at roughly a third of the tokens and beats naïve retrieval by +0.206 — better context ≈ more context, far cheaper. Temporal routing is validated; the Graphiti engine earns its keep at haystack scale (on a tiny oracle set, hybrid retrieval dominates it).
The organizing concept of v4 is not a list of retrievers — it is a small, ordered set of knowledge representations. A request is assigned a primary knowledge representation, while the decision engine may retain fallback candidates from other representations; that choice, not the retrieval algorithm, is what the decision engine decides first.
Documents flat text · the RAG default ↓ Graphs entities and the relationships between them ↓ Temporal history facts with validity intervals — what changed, and when ↓ OLAP aggregates over columnar warehouses ↓ Images / Vision visual and multimodal content ↓ Code symbols, ASTs, call graphs ↓ Community global summaries over a corpus
Retrieval is an implementation detail within each representation. "Hybrid search," "Personalized PageRank," "as-of query," "materialized-view scan" are not competing retrievers the decision engine chooses between — they are how their respective representations happen to be searched. The decision engine reasons one level up: it picks the representation; the representation owns its retrieval.
Each representation currently binds through the existing RetrieverPlugin compatibility seam, so the decision engine routes across them and the application never changes. The broader abstraction is a KnowledgePlugin, whose operation may be retrieval, structured query, graph traversal or multimodal analysis — the present interface may be renamed later, but the routing semantics are already representation-first. The engine behind a representation is replaceable — a reference implementation ships in the open core; a heavier or proprietary engine binds at construction time.
| Representation | Open-core reference | Optional / enterprise binding | Core status | Binding status |
|---|---|---|---|---|
| Document | hybrid (BM25 + dense + RRF) | ReDevOps-RAG | Shipped | Available |
| Graph | SimGraph (2-hop spreading) | HippoRAG (PPR) | Shipped | Optional |
| Temporal | in-memory bi-temporal store | Graphiti | Shipped | Optional |
| Community | community summaries | GraphRAG | Shipped | Optional |
| Conversational memory | 3-index chat memory | — | Shipped | — |
| Analytical (structured store) | generic structured-store seam | Doris · Postgres · ClickHouse · MongoDB · Elasticsearch | Roadmap / partial | Doris enterprise binding exists |
| Code | hybrid + code routing | AST / symbol graph | Partial | Roadmap |
| Vision / Image | multimodal retriever | ColPali / video | Partial | Optional |
The decision engine selects among these by intent, policy, and measured cost — exactly the machinery from v2/v3, now ranging over representations instead of only document-retrieval methods. Adding a representation never regresses the default: an unbound or non-matching representation falls back to document retrieval.
A large class of production questions asks not "what is true?" but "what was true, and when did it change?" — what a team decided in chat and later reversed, which requirement replaced another, which policy was in force as of a given date. Flat semantic search over a message dump reliably surfaces the stale version.
Answering these needs facts that carry their own validity interval (valid_from / valid_to) plus a transaction time (recorded_at), and a retrieval mode that can query the graph as of a point in time and surface how a fact was superseded — the property of a bi-temporal knowledge graph (the Graphiti / Zep lineage), distinct from multi-hop retrieval, which traverses connections but has no notion of when a fact began or ceased to be true.
In the runtime this is not a new layer — it is one more representation the decision engine routes to. A time-anchored intent (as of · what changed · superseded · point-in-time) proposes the temporal method alongside hybrid; the cost model decides when its bookkeeping earns its cost. Shipped as of v4: a dependency-free bi-temporal store as the reference implementation, with the full Graphiti engine available as an optional binding.
Adding a capability should not enlarge the prompt. There are two ways to give a model a new capability:
Swapping Postgres for ClickHouse or Doris becomes an adapter-and-template change, invisible to the model's context. For the rare case where the model genuinely must author a query, the runtime supplies schema on demand — the minimal schema of the specific tables the plan touches, scoped by policy — never the whole catalog.
Enterprise AI increasingly combines documents, warehouses, ERP, CRM, object storage, event streams, and graphs. Under v4 these are not integrations bolted onto a chatbot — they are planning inputs, each a representation behind the uniform plugin interface. The decision engine learns which representation minimizes cost while maximizing trust, and governance (which identity may read which source, in which region) is expressed as data-scope constraints in the policy layer inherited from v3.
| Generation | Stage | Status |
|---|---|---|
| 1 | Static cost model | Industry default |
| 2 | Measured execution | Context Runtime today |
| 3 | Observable planning (EXPLAIN) | Shipped |
| 4 | Online learning (bandit + exploration) | Partial |
| 5 | Trust-aware execution · policy-constrained planning | Enterprise (v3) |
| 6 (v4) | Knowledge-aware planning | Shipped (core) |
The decision engine evolves from selecting execution strategies to selecting knowledge representations. Retrieval becomes one specialization within a broader execution-planning architecture — and the applications above it never change as the knowledge beneath them does.
This is why "planner" undersells it. The decision engine classifies intent, selects the knowledge representation, enforces policy, ranks candidates on measured cost, routes execution, verifies, and learns from every outcome — planning is now one of its jobs. What began as a query planner is a decision engine: the layer that decides what to reason over, how, and under which constraints.